/* ===================================================
   shared.css — Canonical shared styles (from index.html)
   Loaded by all pages before inline <style>.
   =================================================== */

/* ===== CSS Variables ===== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --accent: #22d3ee;
    --accent-warm: #f472b6;
    --bg-dark: #05050a;
    --bg-card: rgba(15, 15, 25, 0.6);
    --bg-card-solid: #0f0f19;
    --bg-card-hover: rgba(25, 25, 40, 0.8);
    --text: #eef2ff;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --border: rgba(99, 102, 241, 0.12);
    --border-strong: rgba(99, 102, 241, 0.25);
    --success: #10b981;
    --warning: #f59e0b;
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --gradient-2: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    --gradient-3: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
    --glass: rgba(15, 15, 25, 0.5);
    --glass-border: rgba(99, 102, 241, 0.15);
    --glow: 0 0 80px rgba(99, 102, 241, 0.15);
    --radius: 20px;
    --font-display: 'Sora', sans-serif;
    --font-body: 'DM Sans', sans-serif;
}

[data-theme="light"] {
    --bg-dark: #f0f2f8;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-solid: #ffffff;
    --bg-card-hover: rgba(241, 245, 249, 0.9);
    --text: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;
    --border: rgba(99, 102, 241, 0.1);
    --border-strong: rgba(99, 102, 241, 0.2);
    --glass: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(99, 102, 241, 0.12);
    --glow: 0 0 60px rgba(99, 102, 241, 0.08);
}

/* ===== Light Theme Component Overrides ===== */
[data-theme="light"] nav {
    background: rgba(240, 242, 248, 0.85);
    border-bottom-color: rgba(0,0,0,0.06);
}

[data-theme="light"] .hero h1 {
    background: linear-gradient(180deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="light"] .lang-dropdown {
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

[data-theme="light"] .hero-aurora { opacity: 0.3; }
[data-theme="light"] .hero-grid { opacity: 0.03; }
[data-theme="light"] .section-glow { opacity: 0.15; }
[data-theme="light"] footer { background: rgba(255,255,255,0.5); }
[data-theme="light"] .noise-overlay { opacity: 0.015; }

/* ===== Theme Toggle ===== */
.theme-toggle {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}
.theme-toggle:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    transform: scale(1.05);
}
.theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-light { display: block; }
.theme-toggle.mobile-only { display: none; }
@media (max-width: 768px) {
    .theme-toggle.mobile-only { display: flex; }
}

/* ===== Reset & Globals ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Noise Overlay ===== */
.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px;
}

/* ===== Container ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== Scroll Reveal ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ===== Navigation ===== */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 16px 0;
    background: rgba(5, 5, 10, 0.6);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.4s;
}

nav.scrolled {
    padding: 10px 0;
    background: rgba(5, 5, 10, 0.85);
}

[data-theme="light"] nav.scrolled {
    background: rgba(240, 242, 248, 0.92);
}

nav .container { display: flex; justify-content: space-between; align-items: center; }

.logo {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links { display: flex; gap: 36px; list-style: none; }
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 400;
    transition: color 0.3s;
    letter-spacing: 0.01em;
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--gradient-1);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.mobile-nav-actions { display: none; align-items: center; gap: 6px; }

.nav-cta {
    background: var(--gradient-1);
    color: white;
    padding: 10px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.nav-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}
.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
}
.nav-cta:hover::before { opacity: 1; }

/* ===== Mobile Menu ===== */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-dark);
    z-index: 99;
    padding: 80px 24px 24px;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.mobile-menu.active { display: flex; }

.mobile-menu a {
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1.05rem;
    padding: 16px;
    border-radius: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.mobile-menu a:hover { border-color: var(--primary); background: var(--bg-card-hover); }

.mobile-menu a:first-child { margin-top: 16px; }

.mobile-menu .mobile-cta {
    background: var(--gradient-1);
    border: none;
    color: white;
    font-weight: 600;
    text-align: center;
    margin-top: 8px;
}

.mobile-menu .lang-switcher {
    width: 100%;
}

.mobile-menu .lang-switcher-toggle {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: 1.05rem;
    color: var(--text);
}
.mobile-menu .lang-switcher-toggle .lang-switcher-current { margin-right: auto; }

.mobile-menu .lang-switcher-toggle:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.mobile-menu .lang-dropdown {
    position: static;
    margin-top: 8px;
    border-radius: 14px;
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 140px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero-aurora {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0.6;
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    will-change: transform;
}

.aurora-blob-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 70%);
    top: -15%;
    left: 10%;
    animation: aurora1 18s ease-in-out infinite;
}

.aurora-blob-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    top: 20%;
    right: 5%;
    animation: aurora2 22s ease-in-out infinite;
}

@keyframes aurora1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(80px, 40px) scale(1.1); }
    66% { transform: translate(-40px, 60px) scale(0.95); }
}
@keyframes aurora2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-60px, 50px) scale(1.15); }
    66% { transform: translate(40px, -30px) scale(0.9); }
}

.hero-grid {
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.3) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 30%, transparent 100%);
}

.hero .container { position: relative; z-index: 2; text-align: center; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 10px 22px;
    border-radius: 50px;
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--primary-light);
    margin-bottom: 32px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: badgeFade 1s ease-out 0.2s both;
}

.hero-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

@keyframes badgeFade {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 7vw, 5.2rem);
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 28px;
    letter-spacing: -0.03em;
    background: linear-gradient(180deg, #fff 0%, rgba(148, 163, 184, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: heroTitle 1s ease-out 0.4s both;
}

@keyframes heroTitle {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto 48px;
    line-height: 1.8;
    animation: heroDesc 1s ease-out 0.6s both;
}

@keyframes heroDesc {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Buttons ===== */
.btn {
    padding: 15px 36px;
    border-radius: 14px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.3), inset 0 1px 0 rgba(255,255,255,0.15);
    position: relative;
    overflow: hidden;
}
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}
.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.45);
}
.btn-primary:hover::before { opacity: 1; }

.btn-secondary {
    background: var(--glass);
    color: var(--text);
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(10px);
}
.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* ===== Section Styles ===== */
section { padding: 120px 0; position: relative; }

.section-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.2;
    pointer-events: none;
}

.section-header { text-align: center; margin-bottom: 72px; }
.section-header h2 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}
.section-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ===== Footer ===== */
footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 72px 0 32px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand .logo { margin-bottom: 16px; display: inline-block; }
.footer-brand p { color: var(--text-muted); font-size: 0.88rem; max-width: 300px; line-height: 1.7; }
.footer-links h4 {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.footer-links ul { list-style: none; }
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    display: block;
    padding: 7px 0;
    transition: all 0.3s;
}
.footer-links a:hover { color: var(--primary-light); transform: translateX(4px); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 30px; text-align: center; color: var(--text-dim); font-size: 0.85rem; }

/* ===== Language Switcher ===== */
.lang-switcher {
    position: relative;
    display: inline-block;
}

.lang-switcher-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lang-switcher-toggle:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.lang-switcher-toggle svg {
    transition: transform 0.2s;
    flex-shrink: 0;
}

.lang-switcher.open .lang-switcher-toggle svg:last-child {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px;
    min-width: 190px;
    max-height: 420px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.lang-switcher.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
}

.lang-option:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

.lang-option.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
}

/* ===== Form Focus ===== */
input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ===== Utility ===== */
.hidden { display: none !important; }

/* ===== RTL Support ===== */
html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] .nav-links {
    flex-direction: row-reverse;
}

html[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

html[dir="rtl"] .lang-option {
    text-align: right;
}

html[dir="rtl"] .footer-content {
    direction: rtl;
}

html[dir="rtl"] .footer-links {
    text-align: right;
}

html[dir="rtl"] .footer-links a:hover {
    transform: translateX(-4px);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    .mobile-nav-actions { display: flex; }
    .nav-links { display: none; }
    nav .lang-switcher { display: none; }
    nav .theme-toggle.desktop-only { display: none; }
    nav .container { padding: 0 16px; }
    .nav-cta { display: none; }
    .logo { font-size: 1.2rem; }

    .hero { padding: 120px 0 60px; min-height: auto; }
    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1rem; margin-bottom: 36px; }
    .hero-badge { font-size: 0.75rem; padding: 8px 14px; }

    section { padding: 80px 0; }
    .section-header { margin-bottom: 48px; }
    .section-header h2 { font-size: 1.75rem; }
    .section-header p { font-size: 0.95rem; }
    .container { padding: 0 16px; }

    footer { padding: 48px 0 24px; }
    .footer-content { grid-template-columns: 1fr !important; text-align: center; gap: 32px; }
    .footer-brand p { max-width: 100%; }
    .footer-links h4 { margin-bottom: 12px; }
    .footer-links a:hover { transform: none; }

    .btn { width: 100%; max-width: 320px; padding: 14px 28px; justify-content: center; }
    .hero .btn { max-width: none; }

    html[dir="rtl"] .footer-content,
    html[dir="rtl"] .footer-links {
        text-align: center;
    }
    html[dir="rtl"] .footer-links a:hover {
        transform: none;
    }
}
