/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #008cbb;
    --primary-dark: #006d93;
    --primary-light: #44b3d8;
    --accent-color: #fbbf24;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.15);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    background: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =============================================
   LANGUAGE SWITCHER
   ============================================= */
.lang-switcher {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10000;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    color: var(--white);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.lang-current:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

.lang-globe {
    flex-shrink: 0;
}

.lang-label {
    min-width: 20px;
    text-align: center;
}

.lang-arrow {
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.lang-switcher.open .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transition: all 0.25s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.lang-switcher.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.lang-option {
    display: block;
    width: 100%;
    padding: 9px 14px;
    background: none;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.lang-option.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--accent-color);
    font-weight: 700;
}

/* On scrolled pages the switcher adapts to dark bg */
.lang-switcher.scrolled .lang-current {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(30, 41, 59, 0.3);
    color: var(--white);
}

.lang-switcher.scrolled .lang-current:hover {
    background: rgba(30, 41, 59, 0.95);
}

/* RTL Support for Arabic */
html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] .hero .container {
    direction: rtl;
}

html[dir="rtl"] .store-text {
    align-items: flex-end;
}

html[dir="rtl"] .review-footer {
    flex-direction: row-reverse;
}

html[dir="rtl"] .review-info {
    align-items: flex-end;
}

html[dir="rtl"] .stars-row {
    flex-direction: row-reverse;
}

html[dir="rtl"] .review-stars {
    flex-direction: row-reverse;
}

html[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

html[dir="rtl"] .lang-option {
    text-align: right;
}

html[dir="rtl"] .footer-links {
    flex-direction: row-reverse;
}

/* =============================================
   LOADING PROGRESS BAR (Tilda-style)
   ============================================= */
.loading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 9999;
    pointer-events: none;
}

.loading-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #030bff, var(--primary-color));
    transition: width 0.3s ease;
}

.loading-bar.loading {
    width: 70%;
    transition: width 2s cubic-bezier(0.1, 0.05, 0.25, 1);
}

.loading-bar.loaded {
    width: 100%;
    transition: width 0.2s ease;
}

.loading-bar.hidden {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* =============================================
   SCROLL PROGRESS BAR
   ============================================= */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    z-index: 9998;
    transition: width 0.1s ease;
    width: 0;
}

/* =============================================
   TILDA-STYLE SCROLL ANIMATIONS
   ============================================= */

/* Fade In Up */
.anim-fadeinup {
    opacity: 0;
    transform: translate(0, 60px);
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1),
                transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: opacity, transform;
}

.anim-fadeinup.anim-started {
    opacity: 1;
    transform: none;
}

/* Fade In Right */
.anim-fadeinright {
    opacity: 0;
    transform: translate(-40px, 0);
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1),
                transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: opacity, transform;
}

.anim-fadeinright.anim-started {
    opacity: 1;
    transform: none;
}

/* Zoom In */
.anim-zoomin {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1),
                transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: opacity, transform;
}

.anim-zoomin.anim-started {
    opacity: 1;
    transform: scale(1);
}

/* Fade In */
.anim-fadein {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: opacity;
}

.anim-fadein.anim-started {
    opacity: 1;
}

/* =============================================
   KEYFRAME ANIMATIONS
   ============================================= */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes bounceDown {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    50% {
        transform: translateY(10px);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 100px 0 80px;
    background-color: var(--primary-color);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-bottom-animation {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 600px;
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
}

.hero-bottom-animation img {
    width: 100%;
    height: auto;
    display: block;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--white);
    margin-bottom: 20px;
}

.highlight {
    color: var(--accent-color);
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    margin-bottom: 40px;
    letter-spacing: 0.5px;
}

/* Rating Badge */
.rating-badge {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 25px 30px;
    border-radius: 20px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stars-row {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}

.star-icon {
    font-size: 1.5rem;
    color: var(--accent-color);
    display: inline-block;
}

.rating-text {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: 400;
}

.rating-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
}

/* Store Buttons */
.hero-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.store-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 180px;
}

.store-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.store-icon {
    width: 32px;
    height: 32px;
    fill: var(--white);
    flex-shrink: 0;
}

.store-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.store-small {
    font-size: 0.7rem;
    text-transform: uppercase;
    opacity: 0.8;
    letter-spacing: 0.5px;
}

.store-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.google-play:hover {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.2), rgba(52, 168, 83, 0.2));
}

.app-store:hover {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.2), rgba(88, 86, 214, 0.2));
}

/* Hero Image / Phone */
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* iPhone Mockup */
.iphone-mockup {
    position: relative;
    transition: transform 0.3s ease;
}

.iphone-frame {
    position: relative;
    width: 340px;
    height: 690px;
    background: #1a1a1a;
    border-radius: 55px;
    padding: 12px;
    box-shadow: 
        0 0 0 2px #2d2d2d,
        0 0 0 6px #1a1a1a,
        0 20px 60px rgba(0, 0, 0, 0.4),
        inset 0 0 6px rgba(255, 255, 255, 0.1);
    border: 2px solid #000;
}

.iphone-notch {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 30px;
    background: #1a1a1a;
    border-radius: 0 0 20px 20px;
    z-index: 3;
}

.iphone-notch::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 6px;
    background: #2d2d2d;
    border-radius: 3px;
}

.iphone-notch::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #1e3a8a;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.iphone-screen {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 45px;
    overflow: hidden;
    z-index: 1;
}

.iphone-button {
    position: absolute;
    right: -3px;
    top: 180px;
    width: 3px;
    height: 70px;
    background: #2d2d2d;
    border-radius: 0 2px 2px 0;
}

.slider-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 45px;
}

.screen-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.screen-img.active {
    opacity: 1;
    z-index: 1;
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dot:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.2);
}

.dot.active {
    background: var(--accent-color);
    width: 28px;
    border-radius: 5px;
    border-color: var(--accent-color);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    cursor: pointer;
}

.scroll-arrow-wrap {
    animation: bounceDown 1.5s ease-in-out infinite;
}

.scroll-arrow {
    display: block;
}

/* =============================================
   FEATURES SECTION
   ============================================= */
.features {
    padding: 100px 0;
    background: var(--white);
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 60px;
    color: var(--text-dark);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    border: 2px solid #f3f4f6;
    cursor: default;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.feature-icon-wrap {
    margin-bottom: 20px;
}

.feature-icon {
    font-size: 3rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.2) rotate(10deg);
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-dark);
    font-weight: 700;
}

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

/* =============================================
   REVIEWS SECTION (Tilda-style)
   ============================================= */
.reviews {
    padding: 100px 0;
    background-color: var(--primary-color);
    position: relative;
    overflow: hidden;
}

.reviews .section-title {
    color: var(--white);
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.review-card {
    background: var(--primary-light);
    padding: 35px 30px;
    border-radius: 16px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
}

.review-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.review-quote {
    margin-bottom: 15px;
}

.review-text {
    color: var(--white);
    font-size: 1rem;
    line-height: 1.7;
    font-weight: 400;
    flex: 1;
    margin-bottom: 20px;
}

.review-stars {
    display: flex;
    gap: 3px;
    margin-bottom: 20px;
}

.review-star {
    color: var(--accent-color);
    font-size: 1rem;
}

.review-footer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.review-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--white);
    flex-shrink: 0;
}

.review-info {
    display: flex;
    flex-direction: column;
}

.review-author {
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
}

.review-source {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.75rem;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.review-source:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* =============================================
   CTA SECTION
   ============================================= */
.cta {
    padding: 100px 0;
    background: var(--white);
    position: relative;
    overflow: hidden;
}

.cta-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.cta h2 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 20px;
    font-weight: 700;
}

.cta p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 40px;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-store-btn {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.cta-store-btn .store-icon {
    fill: var(--white);
}

.cta-store-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 30px rgba(0, 140, 187, 0.3);
}

.cta-store-btn.google-play:hover {
    background: var(--primary-dark);
}

.cta-store-btn.app-store:hover {
    background: var(--primary-dark);
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
    padding: 50px 0;
    background: #1f2937;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.footer .container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 30px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* =============================================
   FLOATING SHAPES
   ============================================= */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    opacity: 0.04;
    animation: float 10s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, var(--accent-color), #f59e0b);
    border-radius: 50%;
    bottom: 10%;
    left: 50%;
    animation-delay: 4s;
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */
@media (max-width: 968px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        align-items: center;
    }
    
    .store-btn {
        width: 100%;
        max-width: 260px;
        justify-content: center;
    }
    
    .iphone-frame {
        width: 280px;
        height: 570px;
        border-radius: 45px;
        padding: 10px;
    }
    
    .iphone-notch {
        width: 120px;
        height: 25px;
    }
    
    .iphone-screen {
        border-radius: 38px;
    }
    
    .slider-container {
        border-radius: 38px;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .reviews-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .cta h2 {
        font-size: 2rem;
    }
    
    .cta p {
        font-size: 1.1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-store-btn {
        width: 100%;
        max-width: 260px;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 80px 0 60px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        margin-top: 20px;
    }
    
    .store-btn {
        padding: 10px 20px;
        min-width: auto;
    }
    
    .store-icon {
        width: 28px;
        height: 28px;
    }
    
    .store-small {
        font-size: 0.65rem;
    }
    
    .store-name {
        font-size: 1rem;
    }
    
    .hero-bottom-animation {
        width: 90%;
        opacity: 0.1;
    }
    
    .iphone-frame {
        width: 240px;
        height: 490px;
        border-radius: 40px;
        padding: 8px;
    }
    
    .iphone-notch {
        width: 100px;
        height: 22px;
    }
    
    .iphone-screen {
        border-radius: 34px;
    }
    
    .slider-container {
        border-radius: 34px;
    }
    
    .slider-dots {
        bottom: 15px;
        padding: 6px 12px;
    }
    
    .dot {
        width: 8px;
        height: 8px;
    }
    
    .dot.active {
        width: 20px;
    }
    
    .features,
    .reviews,
    .cta {
        padding: 70px 0;
    }
    
    .section-title {
        font-size: 1.6rem;
        margin-bottom: 40px;
    }
    
    .footer .container {
        padding: 0 30px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }

    .rating-badge {
        padding: 20px 25px;
    }

    .star-icon {
        font-size: 1.3rem;
    }

    .rating-score {
        font-size: 1.3rem;
    }

    .lang-switcher {
        top: 10px;
        right: 10px;
    }

    .lang-current {
        padding: 7px 10px;
        font-size: 0.8rem;
    }
}
