@import url('sections/landing_animations.css');

/* --- Reset & Base --- */
:root {
    --primary: #2563eb;
    --primary-dark: #0a0a7d;
    --secondary: #05054a;
    --accent: #7c3aed;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-light: #94a3b8;

    /* 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;
}

/* 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: #1e293b;
        --text-body: #e2e8f0;
        --text-muted: #94a3b8;
        --text-light: #64748b;
        --bg-light: #0f172a;
        --bg-white: #1e293b;
    }
}

*,
*::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.5;
    -webkit-font-smoothing: antialiased;
    direction: rtl;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- 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.5rem;
    /* Mobile first */
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .title-hero {
        font-size: 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: 0.3s;
    cursor: pointer;
    white-space: nowrap;
}

.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: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    transform: skewX(-25deg);
    animation: btnShimmer 3s infinite;
    z-index: -1;
}

@keyframes btnShimmer {
    0% {
        left: -100%;
    }

    20% {
        left: 200%;
    }

    /* Fast pass */
    100% {
        left: 200%;
    }

    /* 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;
}