/* ==========================================
   RESET & BASE STYLES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors */
    --primary-dark: #0D416E;
    --secondary-gray: #788C9F;
    --deep-blue: #032D50;
    --ocean-blue: #104B77;
    --navy-blue: #063158;
    --gold: #D4B014;

    /* Additional Colors */
    --white: #FFFFFF;
    --light-gray: #F5F7FA;
    --text-dark: #1A1A1A;
    --text-light: #6B7280;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--ocean-blue) 0%, var(--primary-dark) 50%, var(--deep-blue) 100%);
    --gradient-gold: linear-gradient(135deg, #F4D03F 0%, var(--gold) 50%, #C9A00C 100%);
    --gradient-overlay: linear-gradient(180deg, rgba(3, 45, 80, 0.95) 0%, rgba(13, 65, 110, 0.9) 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(13, 65, 110, 0.1);
    --shadow-md: 0 4px 16px rgba(13, 65, 110, 0.15);
    --shadow-lg: 0 8px 32px rgba(13, 65, 110, 0.2);
    --shadow-xl: 0 16px 48px rgba(13, 65, 110, 0.25);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    font-family: var(--font-family);
    background: var(--deep-blue);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ==========================================
   ANIMATED BACKGROUND
   ========================================== */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    z-index: -2;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.15;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--gold);
    top: 10%;
    left: -10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--ocean-blue);
    top: 60%;
    right: -5%;
    animation-delay: 5s;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: var(--secondary-gray);
    bottom: 10%;
    left: 50%;
    animation-delay: 10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* ==========================================
   CONTAINER & LAYOUT
   ========================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    position: relative;
    z-index: 1;
}

/* ==========================================
   HEADER
   ========================================== */
.header {
    text-align: center;
    padding: var(--spacing-sm) 0;
    animation: fadeInDown 1s ease-out;
}

.logo-container {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: var(--spacing-xs) var(--spacing-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo-container:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-xl);
}

.logo {
    width: 200px;
    height: auto;
    display: block;
    object-fit: contain;
}

/* ==========================================
   HERO SECTION
   ========================================== */
.hero {
    text-align: center;
    padding: var(--spacing-xl) 0;
}

.hero-content {
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.3);
    }
}

.hero-subtitle {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 500;
    color: var(--secondary-gray);
    margin-bottom: var(--spacing-sm);
}

.hero-description {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin: 0 auto var(--spacing-xl);
    line-height: 1.8;
}

/* ==========================================
   APP PREVIEW
   ========================================== */
.app-preview {
    margin: var(--spacing-xl) auto;
    max-width: 300px;
    position: relative;
}

.app-screenshot {
    width: 100%;
    height: auto;
    border-radius: 32px;
    box-shadow: var(--shadow-xl);
    border: 4px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    animation: phoneFloat 6s ease-in-out infinite;
}

.app-screenshot:hover {
    transform: scale(1.05) rotateY(5deg);
    box-shadow: 0 20px 60px rgba(212, 176, 20, 0.3);
}

@keyframes phoneFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* ==========================================
   DOWNLOAD SECTION
   ========================================== */
.download-section {
    margin-top: var(--spacing-2xl);
    padding: var(--spacing-xl);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* box-shadow: var(--shadow-lg); */
}

.download-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.download-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--spacing-md);
}

.download-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    justify-content: center;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.download-btn {
    display: inline-block;
    text-decoration: none;
    /* transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease; */
    /* animation: fadeInScale 0.8s ease-out; */
    /* animation-fill-mode: both; */
}

.download-btn:hover {
    /* transform: translateY(-8px) scale(1.05); */
    filter: brightness(1.1);
}

.ios-btn {
    animation-delay: 0.2s;
}

.android-btn {
    animation-delay: 0.4s;
}

.store-badge {
    height: 100px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    /* filter: drop-shadow(var(--shadow-md));
    transition: filter 0.3s ease; */
}

/* Hide buttons by default when JS detects device */
.download-btn.hidden {
    display: none;
}

.device-info {
    margin-top: var(--spacing-lg);
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* CBL License Section */
.cbl-license {
    margin-top: var(--spacing-lg);
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.cbl-logo {
    height: 64px;
    width: auto;
    display: block;
    margin: 0 auto;
    filter: brightness(0) invert(1);
}

.cbl-licensed-logo {
    text-align: center;
    margin: var(--spacing-sm) 0;
}

.cbl-link {
    margin-top: 0;
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
}

.cbl-link a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease, text-decoration 0.3s ease;
    border-bottom: 1px solid transparent;
}

.cbl-link a:hover {
    color: #F4D03F;
    border-bottom: 1px solid #F4D03F;
}

.cbl-link a:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: 2px;
}


/* ==========================================
   FOOTER
   ========================================== */
.footer {
    text-align: center;
    padding: var(--spacing-xl) 0 var(--spacing-lg);
    margin-top: var(--spacing-2xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 1.5s ease-out;
}

.footer-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--spacing-xs);
}

.footer-text strong {
    color: var(--gold);
    font-weight: 600;
}

.footer-copyright {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-md);
    }

    .logo {
        width: 100px;
        height: 100px;
    }

    .download-section {
        padding: var(--spacing-lg);
    }

    .download-subtitle {
        margin-bottom: var(--spacing-xs);
    }

    .download-buttons {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .store-badge {
        height: 120px;
    }

    .shape {
        filter: blur(40px);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .download-title {
        font-size: 1.5rem;
    }

    .app-preview {
        max-width: 250px;
    }

    .store-badge {
        height: 140px;
    }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.download-btn:focus {
    outline: 3px solid var(--gold);
    outline-offset: 4px;
}

.download-btn:focus:not(:focus-visible) {
    outline: none;
}

/* ==========================================
   RTL SUPPORT (Arabic)
   ========================================== */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .hero-title,
[dir="rtl"] .hero-subtitle,
[dir="rtl"] .hero-description,
[dir="rtl"] .download-title,
[dir="rtl"] .download-subtitle,
[dir="rtl"] .device-info,
[dir="rtl"] .footer-text,
[dir="rtl"] .footer-copyright {
    text-align: center;
}

/* Adjust letter spacing for Arabic */
[dir="rtl"] .hero-title {
    letter-spacing: 0;
}

/* Ensure download buttons stay centered in RTL */
[dir="rtl"] .download-buttons {
    direction: ltr;
}
