/* ============================================================
   CSS VARIABLES - Orange Branding Theme
   ============================================================ */
:root {
    /* Primary Palette */
    --color-primary: #FF6B35;
    /* Vibrant Orange */
    --color-primary-hover: #FF8C5A;
    /* Lighter Orange for hover/dark mode */
    --color-primary-shadow: #B8251B;
    /* Dark Red-Orange for button depth */

    --color-secondary: #D93025;
    /* Reddish Orange (Secondary/Footer Text) */
    --color-accent: #FFD166;
    /* Yellow (Stars/Accents) */

    /* Backgrounds */
    --bg-light: #FFFFFF;
    /* Pure White */
    --bg-cream: #FFF8F0;
    /* Creamy White (Alt Background) */
    --bg-footer-light: #FFF0E5;
    /* Very Light Orange */

    --bg-dark: #1F1F1F;
    /* Dark Grey (Like Duolingo Dark) */
    --bg-card-dark: #2C2C2C;
    /* Slightly Lighter Dark */
    --bg-footer-dark: #000000;
    /* Pure Black */

    /* Text */
    --text-header-light: #4B4B4B;
    /* Header Links */
    --text-body-light: #3C4043;
    /* Main Body Text */
    --text-body-dark: #E0E0E0;
    /* Dark Mode Text */
    --text-gray: #656565;
    /* Improved from #777777 for better contrast (4.5:1+) */

    /* System */
    --shadow-depth: 4px;
    /* Button depth */
    --radius-btn: 16px;
    /* Rounded buttons */
    --radius-card: 20px;

    --transition-speed: 0.2s;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 5rem;
}

/* ============================================================
   GLOBAL STYLES
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease, opacity 0.3s ease;
}

/* Language Switch Transition */
body.switching-lang {
    opacity: 0;
}

body.no-scroll {
    overflow: hidden;
}

/* Arabic Font */
body[dir="rtl"] {
    font-family: 'Tajawal', sans-serif;
}

/* Dark Mode */
body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-body-dark);
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ============================================================
   NAVBAR / HEADER
   ============================================================ */
.navbar {
    background-color: var(--bg-light);
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    /* Very subtle shadow */
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: var(--spacing-xs) 0;
    /* Reduced padding for image logo */
    transition: background-color var(--transition-speed);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

body.dark-mode .navbar {
    background-color: var(--bg-dark);
    /* or #181818 per request */
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 50px;
    /* Default height */
    width: auto;
    max-width: 150px;
    /* Prevent logo from becoming too wide */
    transition: transform var(--transition-speed), filter var(--transition-speed), opacity 0.4s ease;
    /* Removed animation per brand consistency if it interferes with UX, but keeping it for now as requested */
    animation: rotate-logo 10s ease-in-out infinite;
    /* Rotate every 10s */

    /* SVG Optimization */
    shape-rendering: geometricPrecision;
    /* Crisp edges for SVG */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    position: relative;
    z-index: 1001;
}

/* Dark Mode SVG Logo Enhancement */
body.dark-mode .logo-img {
    /* Optional: Add subtle brightness boost for dark mode */
    filter: brightness(1.1);
}

@keyframes rotate-logo {
    0% {
        transform: rotateY(0deg);
    }

    20% {
        transform: rotateY(360deg);
    }

    100% {
        transform: rotateY(360deg);
    }
}

.logo:hover .logo-img {
    /* Pause animation on hover if desired, or let it spin */
    transform: scale(1.05);
}

/* Responsive Logo Sizing */
@media (max-width: 768px) {
    .logo-img {
        height: 40px;
        max-width: 120px;
    }
}

@media (max-width: 480px) {
    .logo-img {
        height: 35px;
        max-width: 100px;
    }
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
    list-style: none;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-header-light);
    /* #4B4B4B */
    text-decoration: none;
    font-weight: 700;
    transition: color var(--transition-speed);
    padding: var(--spacing-xs);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

body.dark-mode .nav-links a {
    color: var(--text-body-dark);
}

.nav-links a:hover {
    color: var(--color-primary);
}

/* Toggle Buttons */
.toggle-buttons {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    position: relative;
    z-index: 1001;
}

/* Hamburger Menu Button */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    flex-direction: column;
    gap: 6px;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

body.dark-mode .mobile-menu-toggle span {
    background-color: var(--color-primary-hover);
}

/* Hamburger Animation */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.toggle-btn {
    background-color: transparent;
    border: 2px solid rgba(0, 0, 0, 0.1);
    color: var(--text-header-light);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}

body.dark-mode .toggle-btn {
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-body-dark);
    box-shadow: 0 2px 0 rgba(255, 255, 255, 0.1);
}

.toggle-btn:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    padding: var(--spacing-xxl) 0;
    text-align: center;
    background-color: var(--bg-light);
    position: relative;
    overflow: hidden;
}

body.dark-mode .hero {
    background-color: var(--bg-dark);
}

/* New Hero Pattern Background (Subtle Dots) */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(var(--color-primary) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.08;
    /* Slightly reduced opacity */
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-header-light);
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
}

body.dark-mode .hero h1 {
    color: white;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-body-light);
    margin-bottom: var(--spacing-lg);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 500;
}

body.dark-mode .hero p {
    color: var(--text-body-dark);
}

.cta-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    width: 100%;
}

.cta-row-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-md);
    width: 100%;
}

.cta-row-bottom {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: var(--spacing-xs);
}

/* Mobile Responsive Adjustments for new layout */
@media (max-width: 768px) {
    .cta-row-top {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }

    .cta-buttons .btn {
        width: 100%;
        max-width: 320px;
        justify-content: center;
    }

    .cta-row-bottom {
        margin-top: 0;
    }
}

/* BUTTONS
   - Not flat
   - Thickness/Depth
   - Rounded corners
*/
.btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-btn);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    transition: transform 0.1s, box-shadow 0.1s;
    cursor: pointer;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    top: 0;
    /* For animation */
}

/* PRIMARY BUTTON (Orange) */
.btn-primary {
    background-color: var(--color-primary);
    /* #FF6B35 */
    color: white;
    box-shadow: 0 var(--shadow-depth) 0 var(--color-primary-shadow);
    /* #B8251B */
    margin-bottom: var(--shadow-depth);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 calc(var(--shadow-depth) + 4px) 0 var(--color-primary-shadow);
}

.btn-primary:active {
    box-shadow: 0 0 0 var(--color-primary-shadow);
    transform: translateY(var(--shadow-depth));
    margin-bottom: 0;
}

/* Force Tajawal font for direct download & CTA buttons in Arabic */
html[lang="ar"] #directDownloadBtn,
html[lang="ar"] #directDownloadBtn span,
html[lang="ar"] .btn-cta-xl,
html[lang="ar"] .btn-cta-xl span {
    font-family: 'Tajawal', sans-serif !important;
}

/* SECONDARY BUTTON (Outline/White) */
.btn-secondary {
    background-color: var(--bg-light);
    color: var(--color-primary);
    border: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 var(--shadow-depth) 0 rgba(0, 0, 0, 0.1);
    margin-bottom: var(--shadow-depth);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, border-color 0.2s ease;
}

body.dark-mode .btn-secondary {
    background-color: var(--bg-card-dark);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 var(--shadow-depth) 0 rgba(255, 255, 255, 0.1);
    color: var(--color-primary-hover);
}

.btn-secondary:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: 0 calc(var(--shadow-depth) + 4px) 0 rgba(0, 0, 0, 0.15);
    /* Slightly darker shadow on hover */
}

body.dark-mode .btn-secondary:hover {
    box-shadow: 0 calc(var(--shadow-depth) + 4px) 0 rgba(255, 255, 255, 0.15);
}

.btn-secondary:active {
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.1);
    transform: translateY(var(--shadow-depth));
    margin-bottom: 0;
    top: 0;
    /* Reset previously used top property */
}

body.dark-mode .btn-secondary:active {
    box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
}

.hero-illustration {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

/* ============================================================
   FEATURES SECTION
   ============================================================ */
.features {
    padding: var(--spacing-xxl) 0;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-header-light);
    margin-bottom: var(--spacing-xs);
}

body.dark-mode .section-title {
    color: white;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #ff8556;
    margin-bottom: var(--spacing-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 500;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--spacing-lg);
}

.feature-card {
    background-color: var(--bg-light);
    padding: var(--spacing-lg);
    border-radius: var(--radius-card);
    border: 2px solid rgba(0, 0, 0, 0.08);
    /* Subtle border */
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.08);
    /* Flat shadow */
    transition: all var(--transition-speed);
    text-align: center;
}

body.dark-mode .feature-card {
    background-color: var(--bg-card-dark);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
    transition: transform 0.3s ease;
    /* Smooth transition */
}

/* Animate icon on card hover */
.feature-card:hover .feature-icon {
    transform: scale(1.2) rotate(10deg);
}

body.dark-mode .feature-icon {
    color: var(--color-primary-hover);
}

.feature-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--text-header-light);
}

body.dark-mode .feature-card h3 {
    color: white;
}

.feature-card p {
    color: var(--text-body-light);
}

body.dark-mode .feature-card p {
    color: var(--text-body-dark);
}


/* ============================================================
   TRUST SIGNALS SECTION
   ============================================================ */
.trust-signals {
    padding: var(--spacing-xxl) 0;
    background-color: var(--bg-cream);
    border-top: 2px solid rgba(0, 0, 0, 0.05);
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode .trust-signals {
    background-color: var(--bg-card-dark);
    border-color: rgba(255, 255, 255, 0.05);
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
    text-align: center;
}

.stat-card {
    background-color: var(--bg-light);
    padding: var(--spacing-lg);
    border-radius: var(--radius-card);
    border: 2px solid rgba(0, 0, 0, 0.08);
    /* Subtle border */
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.08);
    /* Flat shadow */
    transition: all var(--transition-speed);
    text-align: center;
}

body.dark-mode .stat-card {
    background-color: var(--bg-card-dark);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--color-secondary);
    margin-bottom: var(--spacing-sm);
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.2) rotate(10deg);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: var(--spacing-xs);
    line-height: 1.2;
}

body.dark-mode .stat-number {
    color: var(--color-primary-hover);
}

.stat-card p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-header-light);
}

body.dark-mode .stat-card p {
    color: white;
}

/* ============================================================
   TESTIMONIALS SECTION
   ============================================================ */
.testimonials {
    padding: var(--spacing-xxl) 0;
}

.testimonial-card {
    min-width: 320px;
    background-color: var(--bg-light);
    padding: var(--spacing-lg);
    border-radius: var(--radius-card);
    border: 2px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.08);
    scroll-snap-align: start;
}

body.dark-mode .testimonial-card {
    background-color: var(--bg-card-dark);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}

.testimonial-rating {
    color: var(--color-accent);
    /* Yellow stars */
    font-size: 1.2rem;
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.05);
}

.testimonial-text {
    font-style: italic;
    margin-bottom: var(--spacing-md);
    color: var(--text-body-light);
}

body.dark-mode .testimonial-text {
    color: var(--text-body-dark);
}

.author-avatar {
    width: 50px;
    height: 50px;
    background-color: var(--color-primary);
    border-radius: 15px;
    font-weight: 800;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

/* Alternating avatars */
.testimonial-card:nth-child(2) .author-avatar {
    background-color: var(--color-secondary);
}

.testimonial-card:nth-child(3) .author-avatar {
    background-color: #58CC02;
    /* Green accent for variety */
}

/* ============================================================
   CTA SECTION REDESIGNED
   ============================================================ */
.cta-section-new {
    padding-top: var(--spacing-xxl);
    position: relative;
    overflow: hidden;
    text-align: center;
    background-color: transparent;
    /* Or a very light subtle bg if needed */
}

.relative-container {
    position: relative;
    z-index: 2;
}

.cta-centered-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cta-title-center {
    font-size: 1.5rem;
    color: var(--color-secondary);
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.cta-headline-center {
    font-size: 3.5rem;
    color: var(--text-dark);
    font-weight: 900;
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

body.dark-mode .cta-headline-center {
    color: white;
}

.btn-cta-xl {
    display: inline-block;
    background-color: var(--color-primary);
    background: linear-gradient(135deg, #FF8C5A 0%, #FF6B35 100%);
    color: white;
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    padding: 1rem 4rem;
    border-radius: 50px;
    /* Pill Shape */
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    transition: all 0.2s;
    margin-bottom: var(--spacing-xl);
    position: relative;
    z-index: 10;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-cta-xl:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.5);
    color: white;
}

.phone-showcase {
    position: relative;
    z-index: 5;
    margin-bottom: -180px;
    /* Pull phone DOWN into the wave dip */
    display: flex;
    justify-content: center;
}

/* CSS PHONE ILLUSTRATION */
.css-phone {
    width: 220px;
    height: 400px;
    background-color: white;
    border: 6px solid #FF8C5A;
    /* Thinner sophisticated frame */
    border-radius: 45px;
    position: relative;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Tapered look modification to match style */
    transform: perspective(800px) rotateX(35deg) scale(0.9);
    /* Stronger Tapered Look */
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.phone-screen {
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 38px;
    background: linear-gradient(180deg, #fff 0%, #f9f9f9 100%);
}

.download-icon-container {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #FF9966 0%, #FF5E62 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(255, 94, 98, 0.3);
}

.download-icon-container i {
    color: white;
    font-size: 3rem;
    animation: bounce 2s infinite;
}

.phone-home-indicator {
    position: absolute;
    bottom: 12px;
    width: 35%;
    height: 5px;
    background-color: #EEE;
    border-radius: 3px;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-12px);
    }

    60% {
        transform: translateY(-6px);
    }
}

/* FLOATING WORDS ANIMATION */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.float-word {
    position: absolute;
    font-weight: 800;
    font-size: 1.5rem;
    opacity: 0.8;
    animation: float 6s ease-in-out infinite;
    color: var(--color-accent);
    /* Yellowish default */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.arabic-word {
    font-family: 'Tajawal', sans-serif !important;
}

/* Position and color variations for words - "Scattered around phone" */
.word-1 {
    top: 20%;
    left: 15%;
    color: var(--color-secondary);
    animation-delay: 0s;
    font-size: 1.8rem;
}

.word-2 {
    top: 25%;
    right: 15%;
    color: var(--color-primary);
    animation-delay: 1s;
    font-size: 2rem;
}

.word-3 {
    top: 45%;
    left: 10%;
    color: #58CC02;
    animation-delay: 2s;
}

.word-4 {
    top: 40%;
    right: 12%;
    color: #1CB0F6;
    animation-delay: 3s;
    font-size: 1.6rem;
}

/* Position updates to avoid overlap */
.word-5 {
    top: 10%;
    left: 10%;
    color: #FFD166;
    animation-delay: 1.5s;
    font-size: 1.4rem;
}

/* Moved further out */

/* Higher up */
.word-6 {
    top: 60%;
    right: 25%;
    color: var(--color-secondary);
    animation-delay: 0.5s;
}

.word-7 {
    top: 65%;
    left: 25%;
    color: var(--color-primary);
    animation-delay: 2.5s;
}

.word-8 {
    top: 8%;
    right: 10%;
    color: #CE82FF;
    animation-delay: 3.5s;
    font-size: 1.4rem;
}

/* Moved further out */

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

/* Highlight Pulse Animation for CTA Scroll */
@keyframes highlight-pulse {
    0% {
        box-shadow: 0 0 0 rgba(255, 107, 53, 0);
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 107, 53, 0.4);
    }

    100% {
        box-shadow: 0 0 0 rgba(255, 107, 53, 0);
    }
}

.highlight-effect {
    animation: highlight-pulse 0.8s ease-in-out 2;
    /* Run twice swiftly */
    border-radius: 20px;
    /* Ensure highlight follows shape */
}

/* WAVE SEPARATOR */
.wave-separator {
    line-height: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 4;
    /* Behind phone, in front of bg */
    margin-top: -60px;
    /* Adjusted for stronger phone overlap */
    margin-bottom: -1px;
}

.wave-img {
    width: 100%;
    height: auto;
    display: block;
    min-height: 100px;
    /* Ensure visibility on mobile */
    object-fit: cover;
    /* Cover width */
    aspect-ratio: 1440 / 520;
    /* Prevent layout shifts */
}

/* ============================================================
   FOOTER (REDESIGNED)
   ============================================================ */
.site-footer {
    background-color: var(--color-primary);
    /* Solid Orange matching wave */
    border-top: none;
    padding-top: 0;
    padding-bottom: 0;
    /* Remove bottom padding for white strip */
    color: white;
    position: relative;
    margin-top: -2px;
    /* Fix any sub-pixel gaps globally */
    z-index: 5;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    /* Changed from space-evenly to space-between for 2-col layout */
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    /* Add padding to prevent edge sticking */
}

/* ============================================================
   SCROLL TO TOP BUTTON
   ============================================================ */
#scrollTopBtn {
    display: none;
    /* Hidden by default */
    position: fixed;
    bottom: 30px;
    left: 30px;
    /* Positioned left as requested */
    z-index: 99;
    background-color: var(--color-primary);
    color: white;
    border: none;
    outline: none;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    transition: transform 0.3s, background-color 0.3s;
    animation: pulse-glow 2s infinite;
}

#scrollTopBtn:hover {
    background-color: #e55a2b;
    transform: translateY(-5px);
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 107, 53, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0);
    }
}

/* ============================================================
   SEO OPTIMIZED SEMANTIC FOOTER
   ============================================================ */
.site-footer {
    background-color: var(--color-primary);
    color: white;
    padding: var(--spacing-xl) 0 var(--spacing-md);
    position: relative;
    z-index: 10;
    font-family: 'Poppins', 'Inter', sans-serif;
}

body[dir="rtl"] .site-footer {
    font-family: 'Tajawal', sans-serif;
}

/* Dark Mode Footer Adaption - Orange background with dark text */
body.dark-mode .site-footer {
    background-color: var(--color-primary);
}

body.dark-mode .site-footer h2,
body.dark-mode .site-footer h3,
body.dark-mode .site-footer p,
body.dark-mode .site-footer a,
body.dark-mode .site-footer .contact-item,
body.dark-mode .site-footer .footer-bottom {
    color: #1a1a1a;
    /* Darker gray for better contrast on orange background (7:1+) */
    opacity: 1;
}

body.dark-mode .site-footer .footer-section h3::after {
    background-color: var(--color-accent);
}

body.dark-mode .footer-nav a:hover {
    color: white;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

/* Brand Section */
.footer-brand h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
    color: white;
    letter-spacing: -0.5px;
}

.footer-brand p {
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 600;
    opacity: 1;
    max-width: 300px;
}

/* Footer Sections General */
.footer-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: white;
    position: relative;
    padding-bottom: 8px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--color-accent);
}

body[dir="rtl"] .footer-section h3::after {
    left: auto;
    right: 0;
}

/* Quick Links */
.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav li {
    margin-bottom: 12px;
}

.footer-nav a {
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 1;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-nav a:hover {
    opacity: 1;
    transform: translateX(5px);
    color: var(--color-accent);
}

body[dir="rtl"] .footer-nav a:hover {
    transform: translateX(-5px);
}

/* Contact Section */
.footer-contact address {
    font-style: normal;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 1;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
}

.contact-item:hover {
    opacity: 1;
    transform: translateX(5px);
    color: var(--color-accent);
}

body[dir="rtl"] .contact-item:hover {
    transform: translateX(-5px);
}

body.dark-mode .contact-item:hover {
    color: white;
}

.contact-item i {
    width: 20px;
    text-align: center;
    color: var(--color-accent);
}

body.dark-mode .contact-item i {
    color: var(--color-accent);
}

/* Social Links Enhancement - Original Style */
.social-links {
    margin-top: 1rem;
    display: flex;
    gap: 15px;
}

.social-links a {
    color: var(--color-primary);
    background: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transition:
        background-color 0.4s ease,
        box-shadow 0.4s ease,
        padding 0.3s ease,
        transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-links a:hover {
    transform: translateY(-5px) scale(1.1) rotate(10deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* DARK MODE */
body.dark-mode .social-links a {
    color: var(--color-primary);
    background: #2C2C2C;
}

body.dark-mode .social-links a:hover {
    background: var(--color-primary);
    color: white;
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-md);
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 1;
}

body.dark-mode .footer-bottom {
    border-top-color: rgba(255, 255, 255, 0.05);
}

/* Responsive Footer */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr;
    }

    .footer-social {
        grid-column: span 3;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .site-footer {
        padding: var(--spacing-xl) 0 var(--spacing-lg);
        text-align: center;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .footer-brand p {
        margin: 0 auto;
    }

    .footer-section h3::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-nav a:hover {
        transform: translateY(-2px);
    }

    .footer-contact address {
        align-items: center;
    }

    .footer-social {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {

    .footer-nav a,
    .social-icon,
    .contact-item {
        transition: none;
    }

    .social-icon:hover {
        transform: none;
    }
}


/* ============================================================
   PAGE HERO (for Blog & Downloads pages)
   ============================================================ */
.page-hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, #ff8a5c 100%);
    padding: calc(var(--spacing-xxl) + 60px) 0 var(--spacing-xxl);
    text-align: center;
    color: white;
}

.page-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
}

.page-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================================
   BLOG SECTION
   ============================================================ */
.blog-section {
    padding: var(--spacing-xxl) 0;
    background-color: var(--bg-light);
}

body.dark-mode .blog-section {
    background-color: var(--bg-dark);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-lg);
}

.blog-card {
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

body.dark-mode .blog-card {
    background: var(--bg-card-dark);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.15);
}

.blog-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-category {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    background: var(--color-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.blog-card-content {
    padding: var(--spacing-md);
}

.blog-date {
    color: var(--text-gray);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--spacing-xs);
}

.blog-card-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-header-light);
    margin-bottom: var(--spacing-xs);
    line-height: 1.4;
}

body.dark-mode .blog-card-content h3 {
    color: var(--text-header-dark);
}

.blog-card-content p {
    color: var(--text-body-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
}

body.dark-mode .blog-card-content p {
    color: var(--text-body-dark);
}

.blog-read-more {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap var(--transition-speed);
}

.blog-read-more:hover {
    gap: 10px;
}

/* ============================================================
   DOWNLOADS SECTION
   ============================================================ */
.downloads-section {
    padding: var(--spacing-xxl) 0;
    background-color: var(--bg-light);
}

body.dark-mode .downloads-section {
    background-color: var(--bg-dark);
}

.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.download-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode .download-card {
    background: var(--bg-card-dark);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.05);
}

.download-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.12);
}

.download-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #ff8a5c 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.download-icon.icon-green {
    background: linear-gradient(135deg, #58CC02 0%, #89e219 100%);
}

.download-icon.icon-blue {
    background: linear-gradient(135deg, #1CB0F6 0%, #0091d4 100%);
}

.download-icon.icon-purple {
    background: linear-gradient(135deg, #CE82FF 0%, #a855f7 100%);
}

.download-icon.icon-yellow {
    background: linear-gradient(135deg, #FFC800 0%, #ffb300 100%);
}

.download-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-header-light);
    margin-bottom: 4px;
}

body.dark-mode .download-info h3 {
    color: var(--text-header-dark);
}

.download-info p {
    color: var(--text-body-light);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: var(--spacing-xs);
}

body.dark-mode .download-info p {
    color: var(--text-body-dark);
}

.download-meta {
    color: var(--text-gray);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.download-btn {
    background: var(--color-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background var(--transition-speed), transform var(--transition-speed);
    align-self: flex-start;
}

.download-btn:hover {
    background: #e55a2b;
    transform: scale(1.02);
}

/* ============================================================
   INTERACTIVE BUTTON ANIMATION
   ============================================================ */
/* ============================================================
   SMART HOVER BUTTONS (UNIFIED UX)
   ============================================================ */
.btn-smart-hover {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Match standard .btn padding/radius */
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-btn);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Ensure minimum width for text stability */
    min-width: 260px;
    /* Remove default button borders if any */
    border: 2px solid transparent;
    box-shadow: 0 var(--shadow-depth) 0 rgba(0, 0, 0, 0.1);
    margin-bottom: var(--spacing-sm);
}

/* --- THEME VARIANTS --- */

/* 1. PRIMARY (App Store - Solid Orange) */
.btn-smart-hover-primary {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 var(--shadow-depth) 0 var(--color-primary-shadow);
}

.btn-smart-hover-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 calc(var(--shadow-depth) + 4px) 0 var(--color-primary-shadow);
}

.btn-smart-hover-primary:active {
    transform: translateY(var(--shadow-depth));
    box-shadow: 0 0 0 var(--color-primary-shadow);
    margin-bottom: 0;
}

/* 2. SECONDARY (Web App/Direct - Outline) */
.btn-smart-hover-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 var(--shadow-depth) 0 rgba(0, 0, 0, 0.1);
    /* Ensure border matches text initially like old secondary btn */
    border: 2px solid rgba(0, 0, 0, 0.1);
}

body.dark-mode .btn-smart-hover-secondary {
    color: var(--color-primary-hover);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 var(--shadow-depth) 0 rgba(255, 255, 255, 0.1);
}

/* FIX: Ensure text turns white on hover in Dark Mode (overriding specificity) */
body.dark-mode .btn-smart-hover-secondary:hover {
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 calc(var(--shadow-depth) + 4px) 0 rgba(255, 255, 255, 0.15);
}

.btn-smart-hover-secondary:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 calc(var(--shadow-depth) + 4px) 0 rgba(255, 107, 53, 0.3);
}

.btn-smart-hover-secondary:active {
    transform: translateY(var(--shadow-depth));
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
}


/* --- INTERNAL ELEMENTS ANIMATION --- */

/* Icon Circle */
.btn-smart-hover .icon-circle {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 2;
}

.btn-smart-hover .icon-circle i {
    font-size: 1.1rem;
}

/* Primary Variant Circle */
.btn-smart-hover-primary .icon-circle {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Secondary Variant Circle */
.btn-smart-hover-secondary .icon-circle {
    background-color: rgba(255, 107, 53, 0.1);
    color: var(--color-primary);
}

body.dark-mode .btn-smart-hover-secondary .icon-circle {
    background-color: rgba(255, 255, 255, 0.1);
}

/* HOVER STATE: Circle Movement */
.btn-smart-hover:hover .icon-circle {
    left: calc(100% - 42px);
    /* Move to right */
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
}


/* Text Labels */
.btn-smart-hover .text-label,
.btn-smart-hover .text-hover {
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
    /* Important for spacing */
    padding-left: 24px;
    /* Space for icon initially */
}

/* Main Text (Defines Width) */
.btn-smart-hover .text-label {
    opacity: 1;
    transform: translateX(0);
}

/* Hover Text (Hidden) */
.btn-smart-hover .text-hover {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) translateX(20px);
    opacity: 0;
    width: 100%;
    text-align: center;
    padding-left: 0;
    /* Centered, no padding needed */
    padding-right: 30px;
    /* Offset for icon on right */
}

/* HOVER STATE: Text Swap */
.btn-smart-hover:hover .text-label {
    opacity: 0;
    transform: translateX(-20px);
}

.btn-smart-hover:hover .text-hover {
    opacity: 1;
    transform: translate(-50%, -50%) translateX(0);
}

/* ============================================================
   ANNOUNCEMENT BANNER
   ============================================================ */
.announcement-banner {
    background: linear-gradient(135deg, var(--color-primary) 0%, #ff8a5c 100%);
    padding: var(--spacing-lg) 0;
    text-align: center;
    color: white;
}

.announcement-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.announcement-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.announcement-text {
    font-size: 1.1rem;
    font-weight: 500;
    max-width: 600px;
}

.announcement-btn {
    background: white;
    color: var(--color-primary);
    padding: 10px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.announcement-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Active Nav Link */
.nav-links a.active {
    color: var(--color-primary);
    font-weight: 700;
}

/* ============================================================
   UTILITIES & RESPONSIVENESS
   ============================================================ */
html {
    scroll-behavior: smooth;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background-color: var(--bg-light);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: var(--spacing-lg);
        transition: right 0.4s cubic-bezier(0.77, 0.2, 0.05, 1), visibility 0.4s, opacity 0.4s;
        visibility: hidden;
        opacity: 0;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        padding: var(--spacing-xl);
    }

    body.dark-mode .nav-links {
        background-color: var(--bg-dark);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        right: 0;
        visibility: visible;
        opacity: 1;
    }

    /* RTL Support for Mobile Menu */
    body[dir="rtl"] .nav-links {
        right: auto;
        left: -100%;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    }

    body[dir="rtl"] .nav-links.active {
        left: 0;
    }

    .nav-links a {
        font-size: 1.2rem;
        width: 100%;
        text-align: center;
        padding: var(--spacing-md);
    }

    /* Adjust logo for mobile */
    .logo-img {
        height: 40px;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: start;
        /* Adapts to RTL/LTR */
        align-items: flex-start;
        /* Adapts to RTL/LTR (Right in Arabic, Left in English) */
        padding-right: 0;
        padding-left: 0;
    }

    .social-links {
        justify-content: flex-start;
    }

    .cta-headline-center {
        font-size: 2rem;
        margin-bottom: var(--spacing-md);
    }

    /* Fix Button Size on Mobile */
    .btn-cta-xl {
        width: auto;
        /* Don't force full width */
        max-width: 90%;
        font-size: 1.1rem;
        padding: 0.8rem 2rem;
        display: inline-block;
        /* Ensure pill shape is kept */
    }

    /* Make phone smaller and adjust overlap on mobile */
    .css-phone {
        width: 140px;
        height: 280px;
        border-width: 5px;
        transform: perspective(800px) rotateX(35deg) scale(0.9);
        margin-bottom: 20px;
        border-radius: 30px;
    }

    .phone-showcase {
        margin-bottom: -70px;
        /* Raised further for mobile (was -90px) */
    }

    .wave-separator {
        margin-top: -30px;
    }

    /* Scale down floating words for mobile/tablets to avoid clutter */
    .float-word {
        font-size: 0.9rem !important;
        opacity: 0.7;
    }

    /* Reposition words to clear the center completely */
    .word-1 {
        left: 2%;
        top: 20%;
    }

    .word-2 {
        right: 2%;
        top: 25%;
    }

    .word-3 {
        left: 5%;
        top: 40%;
    }

    .word-4 {
        right: 5%;
        top: 38%;
    }

    /* Move these dangerous ones way out */
    .word-5 {
        left: 0%;
        top: 5%;
        font-size: 0.8rem;
        opacity: 0.5;
    }

    .word-8 {
        right: 0%;
        top: 8%;
        font-size: 0.8rem;
        opacity: 0.5;
    }

    /* Hide lower words if they interfere with phone */
    .word-6 {
        display: none;
    }

    .word-7 {
        display: none;
    }

    /* Raise footer on mobile to close gap */
    .site-footer {
        margin-top: -40px;
    }
}

@media (max-width: 480px) {

    /* Even smaller for phones */
    .phone-showcase {
        margin-bottom: -90px;
    }

    .css-phone {
        width: 120px;
        height: 240px;
    }

    .cta-headline-center {
        font-size: 1.5rem;
    }

    /* Ensure button fits */
    .btn-cta-xl {
        width: 100%;
        max-width: 280px;
        font-size: 1rem;
    }
}

/* ============================================================
   DIRECT DOWNLOAD MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--bg-light);
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    padding: 2rem;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.dark-mode .modal-container {
    background: var(--bg-card-dark);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-gray);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-primary);
    transform: rotate(90deg);
}

body.dark-mode .modal-close:hover {
    background: rgba(255, 255, 255, 0.05);
}

.modal-content {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-content.hidden {
    display: none;
    opacity: 0;
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--color-primary), #ff8a5c);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
    animation: modalIconPulse 2s ease-in-out infinite;
}

@keyframes modalIconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.modal-icon.progress-icon {
    animation: modalIconSpin 2s linear infinite;
}

@keyframes modalIconSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.modal-icon.success-icon {
    background: linear-gradient(135deg, #58CC02, #89e219);
    animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

.modal-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-header-light);
    margin-bottom: 0.5rem;
}

body.dark-mode .modal-header h2 {
    color: white;
}

.modal-header p {
    color: var(--text-gray);
    font-size: 1rem;
}

/* Modal Options */
.modal-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-light);
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    width: 100%;
}

body.dark-mode .modal-option {
    background: var(--bg-dark);
    border-color: rgba(255, 255, 255, 0.1);
}

.modal-option:hover {
    border-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.15);
}

.option-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--color-primary), #ff8a5c);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    flex-shrink: 0;
}

.modal-option:nth-child(2) .option-icon {
    background: linear-gradient(135deg, #1CB0F6, #0091d4);
}

.option-content {
    flex: 1;
}

.option-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-header-light);
    margin-bottom: 0.25rem;
}

body.dark-mode .option-content h3 {
    color: white;
}

.option-content p {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin: 0;
}

.option-arrow {
    font-size: 1.2rem;
    color: var(--text-gray);
    transition: transform 0.3s;
}

.modal-option:hover .option-arrow {
    transform: translateX(5px);
    color: var(--color-primary);
}

/* Download Progress */
.download-progress {
    margin: 2rem 0;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

body.dark-mode .progress-bar-container {
    background: rgba(255, 255, 255, 0.1);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), #ff8a5c, var(--color-primary));
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    animation: progressShimmer 2s linear infinite;
}

@keyframes progressShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

#progressPercent {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 1.1rem;
}

#progressSpeed {
    color: var(--text-gray);
    font-weight: 600;
}

.download-file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 107, 53, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 53, 0.1);
    margin-top: 1.5rem;
}

body.dark-mode .download-file-info {
    background: rgba(255, 107, 53, 0.1);
}

.download-file-info i {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.download-file-info span {
    font-weight: 600;
    color: var(--text-header-light);
}

body.dark-mode .download-file-info span {
    color: white;
}

/* Success Actions */
.success-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modal-container {
        padding: 1.5rem;
        width: 95%;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-icon {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }

    .option-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .option-content h3 {
        font-size: 1rem;
    }

    .option-content p {
        font-size: 0.85rem;
    }

}

/* ============================================================
   BUTTON WRAPPER & HELPER TEXT
   ============================================================ */
/* Wrapper to stack button and helper text vertically */
.btn-wrapper-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    /* Space between button and text */
}

/* Ensure buttons in the row align at the top despite differing heights of wrappers */
/* Ensure buttons in the row align at the top despite differing heights of wrappers (Desktop Only) */
@media (min-width: 769px) {
    .cta-row-top {
        align-items: flex-start;
        gap: 2rem;
        /* Increased gap for desktop to accommodate wider buttons */
    }
}

/* Helper Text Styling */
.helper-text-sm {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-body-light);
    /* Default gray */
    text-align: center;
    max-width: 220px;
    /* Match button width approx */
    line-height: 1.4;
    transition: color 0.3s ease;
    opacity: 0.9;
}

/* Dark Mode Helper Text */
body.dark-mode .helper-text-sm {
    color: var(--text-body-dark);
    /* Lighter gray/white for dark mode */
    opacity: 0.8;
}

/* Mobile Adjustment: Ensure consistent spacing */
@media (max-width: 768px) {
    .btn-wrapper-col {
        width: 100%;
    }

    .helper-text-sm {
        max-width: 100%;
        font-size: 0.9rem;
    }

}

/* ============================================================
   BUTTON INTERNAL LAYOUT (Multiline Support)
   ============================================================ */

/* Allow text-label to host multiple lines */
.btn-smart-hover .text-label {
    display: inline-flex !important;
    flex-direction: column;
    align-items: center;
    /* Centered alignment */
    justify-content: center;
    line-height: 1.2;
    text-align: center;
    /* Text centering */
    vertical-align: middle;
}

.text-main {
    font-size: 1rem;
    font-weight: 700;
}

.text-sub {
    font-size: 0.75rem;
    /* Smaller font */
    font-weight: 500;
    opacity: 0.85;
    text-transform: none;
    /* Keep natural case for subtext */
    letter-spacing: 0.3px;
    margin-top: 2px;

}

/* Ensure buttons align layout correctly on Desktop */
@media (min-width: 769px) {
    .cta-row-top {
        align-items: flex-start;
        gap: 2rem;
        max-width: 780px;
        /* Force 2+1 layout */
        margin: 0 auto;
        /* Center container */
        justify-content: center;
    }
}