/* =========================================================================
   ScienceApp Premium Modern UI
========================================================================= */

:root {
    /* Color Palette */
    --base-black: #050507;
    --base-white: #ffffff;
    
    /* Dark Theme Default */
    --bg-main: #0a0a0c;
    --bg-surface: rgba(20, 20, 25, 0.4);
    --bg-card: rgba(30, 30, 36, 0.4);
    
    --text-primary: #f8f9fa;
    --text-secondary: #a0a0a8;
    --text-muted: #6c6c75;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(255, 255, 255, 0.2);
    
    --primary-glow: rgba(0, 102, 255, 0.5);
    --primary-gradient: linear-gradient(135deg, #0055eb 0%, #0099ff 100%);
    --primary-gradient-hover: linear-gradient(135deg, #0066ff 0%, #33aaff 100%);
    --blob-1: rgba(0, 80, 200, 0.25);
    --blob-2: rgba(120, 0, 200, 0.25);
    
    --glass-blur: blur(24px);
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.2);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 24px rgba(0, 102, 255, 0.4);

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    /* Transition Speeds */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --nav-height: 80px;
    --container-max: 1200px;
}

[data-theme="light"] {
    --bg-main: #f8f9fa;
    --bg-surface: rgba(255, 255, 255, 0.6);
    --bg-card: rgba(255, 255, 255, 0.8);
    
    --text-primary: #111115;
    --text-secondary: #555560;
    --text-muted: #9999a0;
    
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-focus: rgba(0, 0, 0, 0.15);
    
    --primary-glow: rgba(0, 102, 255, 0.3);
    --blob-1: rgba(0, 100, 255, 0.15);
    --blob-2: rgba(150, 50, 255, 0.15);
    
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-md: 0 12px 32px rgba(0,0,0,0.08);
    --shadow-glow: 0 8px 24px rgba(0, 102, 255, 0.2);
}

/* =========================================================================
   Reset & Base
========================================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Manrope', -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color var(--transition-medium), color var(--transition-medium);
}

section {
    scroll-margin-top: var(--nav-height);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
    outline: none;
}

/* =========================================================================
   Backgrounds & Blobs
========================================================================= */

.noise-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 99;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.blob-bg {
    position: fixed;
    top: -10vh;
    left: 20vw;
    width: 60vw;
    height: 60vw;
    max-width: 800px;
    max-height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--blob-1) 0%, transparent 70%);
    filter: blur(80px);
    z-index: -1;
    animation: floatBlob 20s ease-in-out infinite alternate;
}

.blob-bg.blob-2 {
    top: auto;
    bottom: -20vh;
    left: auto;
    right: 10vw;
    background: radial-gradient(circle, var(--blob-2) 0%, transparent 70%);
    animation-delay: -10s;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

#particles-canvas {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100vh;
    z-index: -1;
    pointer-events: none;
    opacity: 0.8;
}

/* =========================================================================
   Navigation
========================================================================= */

.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: var(--nav-height);
    z-index: 100;
    transition: all var(--transition-medium);
}

.navbar.scrolled {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
}

.brand-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 32px;
    margin-left: auto;
    margin-right: 32px;
}

.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    border-radius: var(--radius-full);
}

.lang-select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    outline: none;
}
.lang-select option {
    background: var(--bg-main);
    color: var(--text-primary);
}

.btn-icon {
    width: 40px; height: 40px;
    display: flex; justify-content: center; align-items: center;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--border-focus);
    transform: scale(1.05);
}

.btn-icon svg { width: 20px; height: 20px; }

.mobile-only { display: none; }

.mobile-nav {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0; width: 100%;
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-subtle);
    padding: 24px;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.mobile-nav.active { display: flex; }

/* =========================================================================
   Hero Section
========================================================================= */

.hero-section {
    min-height: 100vh;
    padding-top: var(--nav-height);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 120px 24px 60px 24px;
}

.hero-title {
    font-size: clamp(48px, 8vw, 84px);
    letter-spacing: -2px;
    margin-bottom: 24px;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(18px, 3vw, 24px);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 40px auto;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--primary-gradient);
    color: #fff;
    padding: 16px 36px;
    border-radius: var(--radius-full);
    font-size: 16px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.glow-effect {
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 102, 255, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-card);
    color: var(--text-secondary);
    box-shadow: none;
    border: 1px solid var(--border-subtle);
}

.btn-icon-right { width: 20px; height: 20px; }

.download-meta {
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}
.dot-separator { margin: 0 8px; }

.hero-visual {
    margin-top: 80px;
    width: 100%;
}

.mockup-frame {
    position: relative;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 8px;
    box-shadow: var(--shadow-md);
    transform: perspective(1000px) rotateX(2deg);
    transition: transform var(--transition-medium);
}
.mockup-frame:hover {
    transform: perspective(1000px) rotateX(0deg);
}

.mockup-image {
    width: 100%;
    border-radius: 12px;
    display: block;
}

/* =========================================================================
   Scroll to Top
========================================================================= */

.scroll-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-sm);
}

.scroll-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-to-top:hover {
    background: var(--bg-card);
    border-color: var(--primary-glow);
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-md);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
}

/* =========================================================================
   Sections
========================================================================= */

.section-header {
    margin-bottom: 60px;
}

.section-title {
    font-size: clamp(32px, 5vw, 48px);
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
}

.features-section, .support-section, .cta-section {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 120px 24px;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 40px;
    transition: all var(--transition-fast);
}

.feature-card:hover {
    transform: translateY(-8px);
    background: var(--bg-surface);
    border-color: var(--border-focus);
    box-shadow: var(--shadow-md);
}

.feature-icon-wrapper {
    width: 64px; height: 64px;
    border-radius: 16px;
    background: rgba(0, 102, 255, 0.1);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 24px;
}

.feature-icon {
    width: 32px; height: 32px;
    object-fit: contain;
}

.feature-title {
    font-size: 24px;
    margin-bottom: 12px;
}

.feature-desc {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* CTA Section */
.cta-box {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 80px 40px;
}

.cta-title {
    font-size: clamp(36px, 6vw, 56px);
    margin-bottom: 16px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cta-description {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

/* Support FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.faq-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.faq-card:hover {
    background: var(--bg-surface);
    border-color: var(--primary-glow);
    transform: translateX(4px);
}

.faq-title {
    font-size: 18px;
    font-weight: 600;
}

.faq-icon-arrow {
    color: var(--text-muted);
}

/* =========================================================================
   Modal FAQ
========================================================================= */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity var(--transition-fast);
}
.modal-overlay.visible {
    opacity: 1; pointer-events: auto;
}

.modal-box {
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 600px;
    margin: 24px;
    padding: 32px;
    box-shadow: var(--shadow-md);
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-fast);
}
.modal-overlay.visible .modal-box {
    transform: scale(1) translateY(0);
}

.close-modal {
    border-radius: 50%;
    width: 36px; height: 36px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.modal-title { font-size: 24px; }

.modal-text {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* =========================================================================
   Footer
========================================================================= */

.footer {
    border-top: 1px solid var(--border-subtle);
    padding: 60px 24px;
}

.footer-container {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.footer-logo { opacity: 0.7; }

.copyright-text {
    font-size: 14px;
    color: var(--text-muted);
}

.made-in-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.flag-icon, .heart-icon {
    width: 20px; height: 20px;
    object-fit: contain;
}

/* =========================================================================
   Utilities & Animations
========================================================================= */

.text-center { text-align: center; }

.float-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.float-up.visible { opacity: 1; transform: translateY(0); }
.reveal-delay { transition-delay: 0.2s; }

.fade-in {
    opacity: 0;
    transition: opacity 1s ease;
}
.fade-in.visible { opacity: 1; }

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-only { display: flex; }
    .hero-title { letter-spacing: -1px; }
    .mockup-frame { padding: 4px; }
}
