/* ===========================================
   Mada Educational Platform - Base Styles
   Variables, Reset, Typography, Container
   =========================================== */

/* CSS Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #2f5bff 0%, #12b6a6 100%);
    --secondary-gradient: linear-gradient(135deg, #f6c56b 0%, #f97316 100%);
    --success-gradient: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    --dark-gradient: linear-gradient(135deg, #0b1120 0%, #111827 50%, #0b1120 100%);

    /* Stage Colors */
    --primary-stage: #2f5bff;
    --primary-stage-light: #5f7dff;
    --primary-stage-dark: #1d3fbf;

    --middle-stage: #12b6a6;
    --middle-stage-light: #35d3c4;
    --middle-stage-dark: #0a8a7d;

    --secondary-stage: #f6c56b;
    --secondary-stage-light: #ffd58a;
    --secondary-stage-dark: #d9a447;

    --primary-color: #2f5bff;
    --secondary-color: #12b6a6;
    --accent-color: #f6c56b;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-light: #ffffff;

    --bg-light: #f5f7fb;
    --bg-dark: #0b1120;

    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);

    --border-radius: 22px;
    --transition: all 0.35s ease;
    --header-offset: 156px;
    --font-display: 'Changa', 'Cairo', sans-serif;
    --font-primary: 'Cairo', 'Tajawal', sans-serif;
}

@media (max-width: 900px) {
    :root {
        /* Fallback when JS header offset sync is delayed/blocked */
        --header-offset: 96px;
    }
}

@media (max-width: 640px) {
    :root {
        --header-offset: 90px;
    }
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-offset);
    width: 100%;
    max-width: 100%;
}

body {
    font-family: var(--font-primary);
    background: radial-gradient(circle at 15% 20%, rgba(47, 91, 255, 0.08), transparent 45%),
        radial-gradient(circle at 85% 10%, rgba(18, 182, 166, 0.12), transparent 40%),
        radial-gradient(circle at 20% 90%, rgba(246, 197, 107, 0.12), transparent 35%),
        var(--bg-light);
    color: var(--text-primary);
    line-height: 1.7;
    direction: rtl;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

main {
    width: 100%;
    max-width: 100%;
    padding-top: var(--header-offset);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    font-family: var(--font-display);
    letter-spacing: -0.3px;
}

::selection {
    background: rgba(47, 91, 255, 0.2);
    color: var(--text-primary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 900px) {
    html,
    body,
    main {
        overflow-x: clip;
    }

    body {
        overscroll-behavior-x: none;
    }
}
