@import url('sections/landing_animations.css');

/* --- Reset & Base --- */
:root {
    /* --- Modernized Color Palette --- */
    --primary-h: 221;
    --primary-s: 83%;
    --primary-l: 53%;
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    /* #2563eb */
    --primary-dark: hsl(var(--primary-h), var(--primary-s), 35%);
    --primary-light: hsl(var(--primary-h), var(--primary-s), 95%);

    --secondary-h: 240;
    --secondary-s: 87%;
    --secondary-l: 15%;
    --secondary: hsl(var(--secondary-h), var(--secondary-s), var(--secondary-l));
    /* #05054a */

    --accent-h: 262;
    --accent-s: 83%;
    --accent-l: 58%;
    --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
    /* #7c3aed */

    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-light: #94a3b8;

    /* Spacing Scale (Nuanced) */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;
    --space-3xl: 8rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Dark Mode Variables (Default Light) */
    --bg-body: var(--bg-light);
    --bg-card: var(--bg-white);
    --text-body: var(--text-main);

    --font-main: 'Cairo', sans-serif;
    --container-width: 80rem;
    --container-padding: 1.5rem;
    --navbar-height: 5rem;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Dark Mode Override */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --text-body: #e2e8f0;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --bg-light: #0f172a;
    /* Override */
    --bg-white: #1e293b;
    /* Override */
    --text-main: #f1f5f9;
    /* Fix for invisible text */
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-body: #0f172a;
        --bg-card: rgba(30, 41, 59, 0.7);
        /* Translucent */
        --text-body: #e2e8f0;
        --text-muted: #94a3b8;
        --text-light: #64748b;
        --bg-light: #0f172a;
        --bg-white: rgba(30, 41, 59, 0.7);
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-body);
    margin: 0;
    padding: 0;
    width: 100%;
    line-height: 1.6;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* --- Layout Utilities --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    width: 100%;
}

/* Flexbox Helpers */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

.text-center {
    text-align: center;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.hidden {
    display: none;
}

/* Responsive Helpers */
@media (min-width: 768px) {
    .md-flex {
        display: flex;
    }

    .md-hidden {
        display: none;
    }

    .md-block {
        display: block;
    }

    .md-inline-flex {
        display: inline-flex;
    }
}

/* --- Sections (Full Height Logic) --- */
/* --- Sections (Full Height Logic) --- */
.section {
    position: relative;
    overflow: hidden;
    /* Full Height & Centering */
    min-height: 100vh;
    z-index: 10;
    background-color: var(--bg-body);
    /* Use active theme bg */
    /* Fallback */
    min-height: 100dvh;
    /* Mobile viewport height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* compensate for navbar if needed, or rely on flex centering */
    padding-top: var(--navbar-height);
    padding-bottom: 2rem;
    transition: background-color 0.3s ease;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    :root {
        --container-padding: 1rem;
    }

    .section {
        padding-top: calc(var(--navbar-height) + 1rem);
        padding-bottom: 3rem;
        min-height: auto;
        /* Allow content to dictate height on mobile if needed */
    }
}

/* --- Typography --- */
.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, var(--accent) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: gradientMove 5s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.title-hero {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 2rem;
    font-weight: 800;
}

@media (min-width: 768px) {
    .title-hero {
        font-size: 4.5rem;
    }
}

.title-section {
    font-size: 2rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .title-section {
        font-size: 3rem;
    }
}

.text-lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .text-lead {
        font-size: 1.25rem;
        margin-bottom: 2rem;
    }
}

.text-sub {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none !important;
    /* Remove clunky underline */
    letter-spacing: 0.02em;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* "Static with light move around it" - Subtle Shimmer/Glow Effect */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    transform: skewX(-25deg) translateX(-200%);
    /* Start completely off-screen left */
    animation: btnShimmer 3s infinite;
    z-index: -1;
    will-change: transform;
}

@keyframes btnShimmer {
    0% {
        transform: skewX(-25deg) translateX(-200%);
    }

    20% {
        transform: skewX(-25deg) translateX(400%);
    }

    /* Fast pass */
    100% {
        transform: skewX(-25deg) translateX(400%);
    }

    /* Wait */
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4);
}

.btn-white {
    background: white;
    color: #0f172a !important;
    border: 1px solid #e2e8f0;
}

.btn-white:hover {
    color: var(--primary) !important;
    border-color: var(--primary);
}

/* Navbar Toggle Buttons */
#theme-toggle,
#lang-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--bg-card);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

#theme-toggle:hover,
#lang-toggle:hover {
    background: var(--bg-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

[data-theme="dark"] #theme-toggle,
[data-theme="dark"] #lang-toggle {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

[data-theme="dark"] #theme-toggle:hover,
[data-theme="dark"] #lang-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

#lang-toggle {
    width: auto;
    padding: 0 1rem;
    border-radius: 99px;
    font-size: 0.9rem;
}

/* --- Premium Utilities --- */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .glass {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.text-balance {
    text-wrap: balance;
}

.section-spacing {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
}

@media (min-width: 768px) {
    .section-spacing {
        padding-top: var(--space-3xl);
        padding-bottom: var(--space-3xl);
    }
}