/* ===================================================
   Art direction: Arabic Smart Advertising App (SMSAR)
   Palette: Custom Red (#E02E2E) primary, white surfaces
   Typography: Almarai (Arabic-optimized font)
   Density: Balanced — spacious sections, clean UI
   =================================================== */

/* ─── CSS Variables ─────────────────────────────── */
:root {
    --primary-color: #E02E2E;
    --primary-dark: #C02626;
    --primary-light: #F04E4E;
    --primary-highlight: rgba(224, 46, 46, 0.1);

    --text-dark: #333333;
    --text-light: #666666;
    --text-faint: #999999;

    --bg: #FFFFFF;
    --surface: #F9F9F9;
    --surface-2: #F4F4F4;
    --border: rgba(0, 0, 0, 0.08);

    --white: #FFFFFF;
    --dark: #1a1a1a;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.14);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --font-family: 'Almarai', sans-serif;

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
    --content-max: 1200px;
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    scroll-padding-top: var(--space-20);
}

body {
    font-family: var(--font-family);
    font-size: 1rem;
    color: var(--text-dark);
    background-color: var(--bg);
    line-height: 1.7;
    min-height: 100dvh;
}

img, picture, video, canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

ul {
    list-style: none;
}

a, button, input, select, textarea {
    font: inherit;
    color: inherit;
}

a {
    text-decoration: none;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
    line-height: 1.2;
}

p {
    text-wrap: pretty;
}

:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ─── Layout ─────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin-inline: auto;
    padding-inline: var(--space-5);
}

/* ─── Header ─────────────────────────────────────── */
header {
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: box-shadow var(--transition);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-block: var(--space-4);
}

.logo {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: var(--space-8);
    list-style: none;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: color var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a:hover::after {
    width: 100%;
}

.mobile-menu {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
    padding: var(--space-2);
    transition: color var(--transition);
}

.mobile-menu:hover {
    color: var(--primary-color);
}

/* ─── Sidebar Overlay ────────────────────────────── */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ─── Buttons ────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.95rem;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    cursor: pointer;
}

.btn:active {
    transform: translateY(0) !important;
}

.btn-primary {
    background-color: var(--white);
    color: var(--primary-color);
    border: 2px solid transparent;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: transparent;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: var(--white);
}

.btn i {
    font-size: 1.1rem;
}

/* ─── Hero Section ───────────────────────────────── */
.hero {
    padding-block: clamp(7rem, 12vw, 10rem) clamp(4rem, 8vw, 7rem);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -10%;
    width: 60%;
    height: 160%;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    pointer-events: none;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: var(--space-5);
    line-height: 1.15;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    max-width: 660px;
    margin-inline: auto;
    margin-bottom: var(--space-6);
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-top: var(--space-6);
}

/* ─── Section Titles ─────────────────────────────── */
.section-title {
    text-align: center;
    margin-bottom: var(--space-16);
}

.section-title h2 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: var(--space-3);
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 4px;
    background: var(--primary-color);
    border-radius: var(--radius-full);
    margin: var(--space-3) auto 0;
}

.section-title p {
    color: var(--text-light);
    max-width: 560px;
    margin-inline: auto;
    font-size: 1rem;
    line-height: 1.8;
}

/* ─── Features Section ───────────────────────────── */
.features {
    padding-block: clamp(var(--space-16), 8vw, var(--space-24));
    background-color: var(--surface);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-8);
}

.feature-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background-color: var(--primary-highlight);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-5);
}

.feature-icon i {
    font-size: 1.75rem;
    color: var(--primary-color);
}

.feature-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: var(--space-3);
    color: var(--text-dark);
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.8;
}

/* ─── App Showcase ───────────────────────────────── */
.app-showcase {
    padding-block: clamp(var(--space-16), 8vw, var(--space-24));
    background-color: var(--white);
}

.showcase-content {
    display: flex;
    align-items: center;
    gap: clamp(var(--space-10), 6vw, var(--space-24));
}

.showcase-text {
    flex: 1;
}

.showcase-text h2 {
    font-size: clamp(1.4rem, 3vw, 2.1rem);
    font-weight: 800;
    margin-bottom: var(--space-5);
    color: var(--text-dark);
}

.showcase-text p {
    color: var(--text-light);
    margin-bottom: var(--space-4);
    line-height: 1.9;
    font-size: 0.98rem;
}

.showcase-text .cta-buttons {
    justify-content: flex-start;
    margin-top: var(--space-8);
}

.showcase-text .btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.showcase-text .btn-primary:hover {
    background-color: var(--primary-dark);
}

.showcase-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.phone-mockup {
    max-width: 300px;
    width: 100%;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.phone-mockup img {
    width: 100%;
    height: auto;
    display: block;
}

/* ─── Download Section ───────────────────────────── */
.download {
    padding-block: clamp(var(--space-16), 8vw, var(--space-24));
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.download::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -5%;
    width: 40%;
    height: 140%;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    pointer-events: none;
}

.download h2 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    margin-bottom: var(--space-4);
}

.download p {
    max-width: 560px;
    margin-inline: auto;
    margin-bottom: var(--space-10);
    opacity: 0.9;
    font-size: 1rem;
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: var(--space-5);
    flex-wrap: wrap;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    background-color: var(--white);
    color: var(--text-dark);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: transform var(--transition), box-shadow var(--transition);
    min-width: 180px;
}

.download-btn:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.download-btn i {
    font-size: 2.25rem;
    color: var(--text-dark);
    flex-shrink: 0;
}

.btn-text {
    text-align: right;
}

.btn-text span {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-light);
    line-height: 1;
    margin-bottom: 3px;
}

.btn-text strong {
    font-size: 1.05rem;
    color: var(--text-dark);
    line-height: 1;
}

/* ─── Footer ─────────────────────────────────────── */
footer {
    background-color: var(--dark);
    color: var(--white);
    padding-block: var(--space-16) var(--space-8);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-10);
    margin-bottom: var(--space-10);
}

.footer-column h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    position: relative;
    color: var(--white);
}

.footer-column h3::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 36px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: var(--radius-full);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    list-style: none;
}

.footer-links li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: #aaaaaa;
    font-size: 0.9rem;
}

.footer-links a {
    color: #aaaaaa;
    transition: color var(--transition);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-links i {
    color: var(--primary-color);
    width: 16px;
    flex-shrink: 0;
}

.social-links {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    color: var(--white);
    font-size: 0.85rem;
    transition: background-color var(--transition), transform var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-8);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #666666;
    font-size: 0.85rem;
}

/* ─── Content Pages (privacy, about) ─────────────── */
.page-hero {
    padding-block: clamp(6rem, 10vw, 9rem) clamp(2.5rem, 5vw, 4rem);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    text-align: center;
}

.page-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
}

.page-hero .breadcrumb {
    margin-top: var(--space-3);
    font-size: 0.9rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.page-hero .breadcrumb a {
    color: var(--white);
    opacity: 0.75;
    transition: opacity var(--transition);
}

.page-hero .breadcrumb a:hover {
    opacity: 1;
}

.content-section {
    padding-block: clamp(var(--space-12), 6vw, var(--space-20));
    background-color: var(--surface);
}

.content-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    padding: clamp(var(--space-8), 5vw, var(--space-16));
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    max-width: 860px;
    margin-inline: auto;
}

.content-body {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 2;
}

.content-body h1,
.content-body h2,
.content-body h3 {
    color: var(--text-dark);
    font-weight: 700;
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
}

.content-body h2 {
    font-size: 1.2rem;
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--primary-highlight);
}

.content-body h3 {
    font-size: 1.05rem;
}

.content-body p {
    margin-bottom: var(--space-4);
}

.content-body ul,
.content-body ol {
    padding-right: var(--space-6);
    margin-bottom: var(--space-4);
}

.content-body li {
    margin-bottom: var(--space-2);
}

.content-body a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ─── FAQ Page ───────────────────────────────────── */
.faq-section {
    padding-block: clamp(var(--space-12), 6vw, var(--space-20));
    background-color: var(--surface);
}

.faq-wrapper {
    max-width: 820px;
    margin-inline: auto;
}

.faq-item {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-3);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
}

.faq-item.open {
    box-shadow: 0 4px 20px rgba(224, 46, 46, 0.12);
    border-color: rgba(224, 46, 46, 0.25);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-5) var(--space-6);
    cursor: pointer;
    gap: var(--space-4);
    user-select: none;
}

.faq-question h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    flex: 1;
    transition: color var(--transition);
}

.faq-item.open .faq-question h3 {
    color: var(--primary-color);
}

.faq-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background-color: var(--primary-highlight);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 0.8rem;
    transition: transform var(--transition), background-color var(--transition), color var(--transition);
}

.faq-item.open .faq-icon {
    transform: rotate(180deg);
    background-color: var(--primary-color);
    color: var(--white);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.faq-answer-inner {
    padding: var(--space-4) var(--space-6) var(--space-6);
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 2;
    border-top: 1px solid var(--border);
}

.faq-item.open .faq-answer {
    max-height: 600px;
}

.faq-empty {
    text-align: center;
    padding: var(--space-20) var(--space-8);
    color: var(--text-light);
}

.faq-empty i {
    font-size: 3.5rem;
    color: var(--primary-highlight);
    margin-bottom: var(--space-4);
    display: block;
}

.faq-empty p {
    font-size: 1rem;
    color: var(--text-faint);
}

/* ─── Back Button (sub-pages) ────────────────────── */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: gap var(--transition), color var(--transition);
}

.back-btn:hover {
    gap: var(--space-4);
    color: var(--primary-dark);
}

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 991px) {
    .showcase-content {
        flex-direction: column;
    }

    .showcase-text,
    .showcase-image {
        flex: none;
        width: 100%;
    }

    .showcase-image {
        order: -1;
    }

    .phone-mockup {
        max-width: 260px;
    }

    .showcase-text .cta-buttons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    /* Mobile Nav */
    .nav-links {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%;
        width: 260px;
        height: 100%;
        background-color: var(--white);
        padding-top: 80px;
        padding-inline: var(--space-6);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease-in-out;
        z-index: 999;
        gap: 0;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        border-bottom: 1px solid var(--border);
    }

    .nav-links a {
        display: block;
        padding-block: var(--space-4);
        font-size: 1rem;
    }

    .nav-links a::after {
        display: none;
    }

    .mobile-menu {
        display: block;
    }

    /* Hero */
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    /* Download */
    .download-buttons {
        flex-direction: column;
        align-items: center;
    }

    .download-btn {
        width: 100%;
        max-width: 280px;
    }

    /* FAQ */
    .faq-question {
        padding: var(--space-4) var(--space-4);
    }

    .faq-answer-inner {
        padding: var(--space-4) var(--space-4) var(--space-5);
    }

    /* Content */
    .content-card {
        padding: var(--space-6) var(--space-5);
    }

    /* Footer */
    .footer-column h3::after {
        right: auto;
        left: 0;
    }
}
