/**
 * Theme Styles - Light and Dark Mode
 * M2Y.net Landing Page
 */

:root {
    --bg-primary: #f5f7ff;
    --bg-secondary: #edf3ff;
    --bg-card: rgba(255, 255, 255, 0.78);
    --bg-card-solid: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: rgba(99, 102, 241, 0.14);
    --shadow: rgba(15, 23, 42, 0.12);
    --overlay: rgba(7, 12, 28, 0.58);
    --primary-rgb: 99, 102, 241;
    --secondary-rgb: 6, 182, 212;
    --success-rgb: 16, 185, 129;
}

[data-theme="dark"] {
    --bg-primary: #060b1a;
    --bg-secondary: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.72);
    --bg-card-solid: rgba(15, 23, 42, 0.92);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: rgba(148, 163, 184, 0.18);
    --shadow: rgba(2, 6, 23, 0.45);
    --overlay: rgba(2, 6, 23, 0.72);
}

[data-theme="light"] {
    --bg-primary: #f5f7ff;
    --bg-secondary: #edf3ff;
    --bg-card: rgba(255, 255, 255, 0.78);
    --bg-card-solid: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: rgba(99, 102, 241, 0.14);
    --shadow: rgba(15, 23, 42, 0.12);
    --overlay: rgba(7, 12, 28, 0.58);
}

*,
*::before,
*::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(var(--primary-rgb), 0.14), transparent 0, transparent 32%),
        radial-gradient(circle at top right, rgba(var(--secondary-rgb), 0.12), transparent 0, transparent 28%),
        linear-gradient(180deg, var(--bg-primary) 0%, #f8fbff 100%);
    color: var(--text-primary);
}

[data-theme="dark"] body {
    background:
        radial-gradient(circle at top left, rgba(var(--primary-rgb), 0.18), transparent 0, transparent 30%),
        radial-gradient(circle at bottom right, rgba(var(--secondary-rgb), 0.12), transparent 0, transparent 26%),
        linear-gradient(180deg, #060b1a 0%, #0f172a 100%);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(var(--primary-rgb), 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--primary-rgb), 0.03) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 85%);
    pointer-events: none;
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    right: -8rem;
    bottom: -8rem;
    width: 22rem;
    height: 22rem;
    background: radial-gradient(circle, rgba(var(--secondary-rgb), 0.18), transparent 68%);
    filter: blur(18px);
    pointer-events: none;
    z-index: -1;
}

section {
    position: relative;
}

.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.88);
}

[data-theme="dark"] .navbar.scrolled,
[data-theme="dark"] .navbar {
    background: rgba(6, 11, 26, 0.82);
}

.logo,
.nav-link {
    color: var(--text-primary);
}

.logo i {
    color: var(--primary-color);
}

.nav-link {
    opacity: 0.88;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    opacity: 1;
}

.btn-primary {
    background: linear-gradient(135deg, #5b5bf7 0%, #8b5cf6 58%, #06b6d4 100%);
    box-shadow: 0 16px 36px rgba(var(--primary-rgb), 0.28);
}

.btn-primary:hover {
    box-shadow: 0 22px 48px rgba(var(--primary-rgb), 0.32);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
}

[data-theme="light"] .btn-secondary {
    background: rgba(255, 255, 255, 0.82);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.theme-switcher,
.language-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-primary);
    cursor: pointer;
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.theme-switcher:hover,
.language-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--primary-rgb), 0.35);
    box-shadow: 0 18px 40px rgba(var(--primary-rgb), 0.16);
}

.theme-switcher i,
.language-btn i {
    color: var(--primary-color);
}

.language-switcher {
    position: relative;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 170px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    z-index: 1000;
}

.language-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    color: var(--text-primary);
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: rgba(var(--primary-rgb), 0.08);
}

.language-option.active {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary-color);
}

.language-flag {
    font-size: 1.3rem;
}

.hero-background {
    background:
        radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.18), transparent 0, transparent 20%),
        radial-gradient(circle at 85% 20%, rgba(103, 232, 249, 0.16), transparent 0, transparent 18%),
        linear-gradient(135deg, #081126 0%, #312e81 48%, #0f766e 100%);
}

.gradient-overlay {
    background: linear-gradient(135deg, rgba(7, 12, 28, 0.6), rgba(79, 70, 229, 0.44));
}

.hero-text {
    text-shadow: 0 10px 35px rgba(7, 12, 28, 0.26);
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    margin-bottom: 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px rgba(5, 10, 27, 0.18);
    font-weight: 600;
}

.pulse-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.65);
    animation: pulseRing 2s infinite;
}

@keyframes pulseRing {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.65);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(52, 211, 153, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
    }
}

.title-highlight {
    background: linear-gradient(135deg, #ffffff 0%, #dbeafe 42%, #67e8f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.hero-chips {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: var(--spacing-xl);
}

.hero-chips span {
    padding: 0.65rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    box-shadow: 0 14px 35px rgba(5, 10, 27, 0.14);
    font-size: 0.92rem;
}

.hero-stats {
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-item {
    min-width: 155px;
    padding: 1rem 1.15rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 42px rgba(5, 10, 27, 0.18);
}

.stat-number {
    color: #ffffff;
}

.scroll-indicator {
    padding: 0.55rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.section-badge {
    box-shadow: 0 14px 32px rgba(var(--primary-rgb), 0.22);
}

.section-title {
    letter-spacing: -0.03em;
}

.section-description {
    color: var(--text-secondary);
}

.about,
.features,
.platforms,
.contact {
    background: transparent;
}

.about-card,
.feature-card,
.contact-card,
.contact-form,
.platform-card {
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 255, 0.92));
    box-shadow: 0 20px 60px var(--shadow);
}

[data-theme="dark"] .about-card,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .contact-card,
[data-theme="dark"] .contact-form,
[data-theme="dark"] .platform-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(17, 24, 39, 0.9));
}

.about-card,
.feature-card,
.contact-card {
    position: relative;
    overflow: hidden;
}

.about-card::before,
.feature-card::before,
.contact-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #8b5cf6, #06b6d4);
}

.about-card:hover,
.feature-card:hover,
.contact-card:hover,
.platform-card:hover {
    border-color: rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 26px 75px rgba(var(--primary-rgb), 0.16);
}

.contact-card:hover {
    transform: translateY(-10px);
}

.contact-form {
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-primary);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: rgba(15, 23, 42, 0.75);
    color: var(--text-primary);
}

.platform-overlay {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.74), rgba(6, 182, 212, 0.5));
}

.platform-badge {
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
}

.cta {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #312e81 0%, #5b5bf7 50%, #06b6d4 100%);
}

.cta::before,
.cta::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.cta::before {
    top: -4rem;
    left: -3rem;
    width: 12rem;
    height: 12rem;
    background: rgba(255, 255, 255, 0.12);
}

.cta::after {
    right: -4rem;
    bottom: -4rem;
    width: 14rem;
    height: 14rem;
    background: rgba(255, 255, 255, 0.08);
}

.footer {
    background: linear-gradient(180deg, #081020 0%, #0f172a 100%);
}

.footer-builder {
    border-left: 4px solid var(--primary-color);
}

.back-to-top {
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6, #06b6d4);
}

.section-header,
.about-card,
.feature-card,
.platform-card,
.contact-card,
.contact-form-wrapper,
.cta-content {
    opacity: 0;
    transform: translateY(24px);
}

.section-header.in-view,
.about-card.in-view,
.feature-card.in-view,
.platform-card.in-view,
.contact-card.in-view,
.contact-form-wrapper.in-view,
.cta-content.in-view {
    opacity: 1;
    transform: translateY(0);
}

[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .hero-content,
[dir="rtl"] .section-header,
[dir="rtl"] .hero-text {
    text-align: right;
}

[dir="rtl"] .platform-card,
[dir="rtl"] .feature-card,
[dir="rtl"] .contact-card {
    text-align: right;
}

[dir="rtl"] .platforms-grid,
[dir="rtl"] .features-grid,
[dir="rtl"] .contact-grid {
    direction: rtl;
}

[dir="rtl"] .footer {
    text-align: right;
}

[dir="rtl"] .footer-builder {
    border-left: none;
    border-right: 4px solid var(--primary-color);
}

[dir="rtl"] .language-dropdown {
    right: auto;
    left: 0;
}

@media (max-width: 768px) {
    .theme-switcher span,
    .language-btn .language-text {
        display: none;
    }

    .theme-switcher,
    .language-btn {
        padding: 0.55rem;
        min-width: 42px;
        justify-content: center;
    }

    .hero-eyebrow {
        font-size: 0.88rem;
        line-height: 1.5;
    }

    .hero-chips {
        gap: 0.5rem;
    }

    .hero-chips span {
        font-size: 0.85rem;
    }
}
