/* CSS Reset & Base Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors from the app theme */
    --primary: #4A2C4A;
    --secondary: #1D1DC9;
    --background: #171A1F;
    --surface: #1F2329;
    --text-primary: #FFFFFF;
    --text-secondary: #9BA1A6;
    --divider: #2D333B;
    --success: #4CAF50;
    --gradient-start: #4A2C4A;
    --gradient-end: #1D1DC9;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(23, 26, 31, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--divider);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--surface);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    background: linear-gradient(180deg, var(--background) 0%, #1a1520 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(74, 44, 74, 0.3) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(29, 29, 201, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
}

.highlight {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 500px;
}

/* Features in hero */
.features {
    display: flex;
    gap: 24px;
    margin-bottom: 40px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.feature-icon {
    font-size: 1.25rem;
}

/* CTA Buttons */
.cta-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-store {
    background: var(--surface);
    border: 1px solid var(--divider);
    padding: 12px 24px;
    color: var(--text-primary);
}

.btn-store:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(74, 44, 74, 0.3);
}

.btn-apk {
    background: linear-gradient(135deg, #3DDC84, #2DA65B);
    border: none;
    padding: 12px 24px;
    color: var(--text-primary);
}

.btn-apk:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(61, 220, 132, 0.4);
}

.btn-apk .btn-small {
    color: rgba(255, 255, 255, 0.85);
}

.btn-icon {
    width: 28px;
    height: 28px;
}

.btn-icon svg {
    width: 100%;
    height: 100%;
}

.btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.btn-small {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.btn-large {
    font-size: 1rem;
    font-weight: 600;
}

.btn-website {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--text-primary);
    padding: 14px 28px;
    font-weight: 600;
    border: none;
}

.btn-website svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.btn-website:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(74, 44, 74, 0.4);
}

.btn-website:hover svg {
    transform: translate(-4px, -4px);
}

/* Phone Mockup */
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-mockup {
    width: 280px;
    height: 560px;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 40px;
    padding: 12px;
    box-shadow:
        0 50px 100px rgba(0, 0, 0, 0.5),
        inset 0 0 0 2px rgba(255, 255, 255, 0.1);
    position: relative;
}

.phone-mockup::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 24px;
    background: #000;
    border-radius: 12px;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: var(--background);
    border-radius: 32px;
    overflow: hidden;
}

.app-preview {
    padding: 50px 16px 16px;
    height: 100%;
}

.app-header {
    text-align: center;
    margin-bottom: 24px;
}

.app-logo {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.content-card {
    background: var(--surface);
    border-radius: 12px;
    height: 120px;
    grid-column: span 2;
    animation: pulse 2s infinite;
}

.content-card.small {
    height: 80px;
    grid-column: span 1;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Features Section */
.features-section {
    padding: 100px 0;
    background: var(--surface);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 60px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
}

.feature-card {
    background: var(--background);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    border: 1px solid var(--divider);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(74, 44, 74, 0.2);
}

.feature-card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Footer */
.footer {
    background: var(--background);
    padding: 60px 0 24px;
    border-top: 1px solid var(--divider);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 8px;
}

.footer-links {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--divider);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 968px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .features {
        justify-content: center;
    }

    .cta-buttons {
        justify-content: center;
    }

    .hero-image {
        order: -1;
    }

    .phone-mockup {
        width: 240px;
        height: 480px;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
    }

    .features {
        flex-direction: column;
        align-items: center;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn-store, .btn-website {
        width: 100%;
        justify-content: center;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

/* LTR Support for English Text */
[dir="rtl"] .btn-store,
[dir="rtl"] .btn-apk {
    flex-direction: row-reverse;
}

[dir="rtl"] .btn-text {
    align-items: flex-end;
}

[dir="rtl"] .btn-website svg {
    transform: scaleX(-1);
}

[dir="rtl"] .btn-website:hover svg {
    transform: scaleX(-1) translate(4px, -4px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: 24px;
    padding: 48px 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 1px solid var(--divider);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-text {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 32px;
}

.modal-btn {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border: none;
    padding: 14px 48px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(74, 44, 74, 0.4);
}

/* Legal Pages Styles */
.legal-page {
    min-height: 100vh;
    padding-top: 100px;
    padding-bottom: 60px;
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
}

.legal-header {
    text-align: center;
    margin-bottom: 48px;
}

.legal-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.legal-header .last-updated {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.legal-section {
    background: var(--surface);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid var(--divider);
}

.legal-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.legal-section p,
.legal-section li {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}

.legal-section ul {
    padding-right: 24px;
    margin-bottom: 16px;
}

.legal-section li {
    margin-bottom: 8px;
}

.legal-section a {
    color: var(--secondary);
    text-decoration: none;
}

.legal-section a:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 32px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--text-primary);
}

.back-link svg {
    width: 20px;
    height: 20px;
}

[dir="rtl"] .back-link svg {
    transform: scaleX(-1);
}