/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a2e;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.hidden { display: none !important; }

/* ===== Header ===== */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: #16a34a;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-icon { font-size: 1.5rem; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    text-decoration: none;
    color: #555;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover { color: #16a34a; }

.btn-nav {
    background: #16a34a;
    color: #fff !important;
    padding: 8px 20px;
    border-radius: 8px;
    transition: background 0.2s;
}

.btn-nav:hover { background: #15803d; }

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Language switcher */
.lang-switcher {
    display: flex;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.lang-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.lang-btn.active {
    background: #16a34a;
    color: #fff;
}

.lang-btn:hover:not(.active) {
    background: #f0fdf4;
    color: #16a34a;
}

/* Burger */
.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s;
}

.burger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger.open span:nth-child(2) { opacity: 0; }

.burger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Buttons ===== */
.btn-primary {
    display: inline-block;
    background: #16a34a;
    color: #fff;
    text-decoration: none;
    padding: 14px 36px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    background: #15803d;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.3);
}

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

.btn-small {
    padding: 10px 24px;
    font-size: 0.95rem;
    border-radius: 10px;
}

.btn-large {
    padding: 18px 48px;
    font-size: 1.2rem;
}

/* ===== Hero ===== */
.hero {
    padding: 140px 0 100px;
    text-align: center;
    background: linear-gradient(160deg, #f0fdf4 0%, #ecfeff 50%, #f0f9ff 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(22,163,74,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.2rem;
    color: #555;
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

/* ===== Features ===== */
.features {
    padding: 90px 0;
}

.features h2,
.how-it-works h2,
.analyze-section h2,
.cta h2 {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 48px;
    letter-spacing: -0.01em;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.feature-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    transition: transform 0.25s, box-shadow 0.25s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.feature-icon {
    font-size: 2.8rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-card p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ===== How it works ===== */
.how-it-works {
    padding: 90px 0;
    background: #f8fafb;
}

.steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.step {
    text-align: center;
    max-width: 180px;
}

.step-number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.step p {
    color: #444;
    font-size: 0.95rem;
    font-weight: 500;
}

.step-arrow {
    font-size: 1.5rem;
    color: #ccc;
    font-weight: 300;
}

/* ===== Analyze section ===== */
.analyze-section {
    padding: 90px 0;
    background: linear-gradient(180deg, #fff 0%, #f0fdf4 100%);
}

/* Dropzone */
.dropzone {
    max-width: 560px;
    margin: 0 auto;
    border: 2px dashed #c8e6c9;
    border-radius: 20px;
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafffe;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: #16a34a;
    background: #f0fdf4;
    transform: scale(1.01);
}

.dropzone.dragover {
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
}

.dropzone.has-file {
    border-color: #16a34a;
    border-style: solid;
}

.dropzone-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.dropzone-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.dropzone-or {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.dropzone-hint {
    color: #aaa;
    font-size: 0.8rem;
    margin-top: 12px;
}

/* Preview */
.preview {
    max-width: 560px;
    margin: 20px auto 0;
    text-align: center;
}

.preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    object-fit: contain;
}

.btn-analyze {
    display: block;
    margin: 20px auto 0;
    padding: 16px 48px;
    font-size: 1.1rem;
}

/* Loading */
.loading-section {
    text-align: center;
    padding: 60px 0;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #16a34a;
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.loading-sub {
    color: #888;
    font-size: 0.95rem;
}

/* Error */
.error-section {
    max-width: 560px;
    margin: 20px auto 0;
}

.error-card {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.error-icon { font-size: 1.5rem; }

.error-card p {
    color: #dc2626;
    font-weight: 500;
}

/* ===== Results ===== */
.result-section {
    max-width: 640px;
    margin: 0 auto;
}

.result-section h3 {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.result-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 12px;
    transition: box-shadow 0.2s;
}

.result-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

/* Rating cards */
.rating-good {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.rating-moderate {
    background: #fffbeb;
    border-color: #fde68a;
}

.rating-poor {
    background: #fef2f2;
    border-color: #fecaca;
}

.result-rating {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rating-icon {
    font-size: 2.5rem;
}

.rating-label {
    font-size: 1.3rem;
    font-weight: 700;
}

.rating-product {
    color: #666;
    font-size: 0.9rem;
    margin-top: 2px;
}

/* Card sections */
.result-card-header {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.result-card-header.collapsible {
    cursor: pointer;
    user-select: none;
}

.card-icon {
    margin-right: 6px;
}

.result-card-body {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.7;
}

.result-list {
    list-style: none;
    padding: 0;
}

.result-list li {
    padding: 6px 0;
    color: #666;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.result-list li::before {
    content: '• ';
    color: #f59e0b;
    font-weight: bold;
}

.result-list li:last-child {
    border-bottom: none;
}

/* Warning card */
.card-warning {
    background: #fffbeb;
    border-color: #fde68a;
}

/* Harmful / Beneficial / Neutral cards */
.card-harmful { border-left: 4px solid #ef4444; }
.card-beneficial { border-left: 4px solid #22c55e; }
.card-neutral { border-left: 4px solid #9ca3af; }

/* Collapsible */
.collapse-body {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.collapse-body.collapsed {
    max-height: 0;
}

.collapse-arrow {
    transition: transform 0.3s;
    font-size: 1rem;
    color: #999;
}

.collapse-arrow.rotated {
    transform: rotate(-90deg);
}

.ingredient-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 0.9rem;
}

.ingredient-item:last-child {
    border-bottom: none;
}

.ingredient-item strong {
    display: block;
    color: #333;
    margin-bottom: 2px;
}

.ingredient-item span {
    color: #666;
    line-height: 1.5;
}

/* Nutrition chips */
.nutrition-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nutrition-chip {
    background: #f0fdfa;
    border: 1px solid #ccfbf1;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #0f766e;
}

/* Disclaimer */
.result-disclaimer {
    margin-top: 16px;
    padding: 14px;
    background: #f9fafb;
    border-radius: 10px;
    font-size: 0.8rem;
    color: #999;
    text-align: center;
    line-height: 1.5;
}

.btn-new-analysis {
    display: block;
    margin: 24px auto 0;
}

/* ===== CTA ===== */
.cta {
    padding: 90px 0;
    text-align: center;
    background: #f8fafb;
}

.cta p {
    color: #666;
    margin-bottom: 28px;
    font-size: 1.1rem;
}

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

.btn-android {
    background: #16a34a;
}

.btn-telegram {
    background: #2196F3;
}

.btn-telegram:hover {
    background: #1976D2;
}

.btn-icon {
    margin-right: 4px;
}

/* ===== Footer ===== */
footer {
    padding: 32px 0;
    text-align: center;
    border-top: 1px solid #eee;
    color: #999;
    font-size: 0.85rem;
}

/* ===== Scroll Animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */

/* Tablet */
@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h1 { font-size: 2.5rem; }
}

/* Mobile */
@media (max-width: 640px) {
    .hero {
        padding: 120px 0 70px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
        margin-bottom: 28px;
    }

    .features,
    .how-it-works,
    .analyze-section,
    .cta {
        padding: 60px 0;
    }

    .features h2,
    .how-it-works h2,
    .analyze-section h2,
    .cta h2 {
        font-size: 1.6rem;
        margin-bottom: 32px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .feature-card {
        padding: 24px 20px;
    }

    .steps {
        flex-direction: column;
        gap: 16px;
    }

    .step-arrow {
        transform: rotate(90deg);
        font-size: 1.2rem;
    }

    /* Burger visible */
    .burger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, padding 0.35s ease;
        border-bottom: 1px solid transparent;
    }

    .nav-links.open {
        max-height: 300px;
        padding: 12px 0;
        border-bottom-color: #eee;
    }

    .nav-links a {
        padding: 14px 24px;
        font-size: 1rem;
        width: 100%;
        text-align: left;
    }

    .nav-links .btn-nav {
        margin: 8px 24px;
        width: auto;
        text-align: center;
        border-radius: 10px;
    }

    .dropzone {
        padding: 36px 20px;
    }

    .btn-large {
        padding: 16px 36px;
        font-size: 1.05rem;
    }
}

/* Small mobile */
@media (max-width: 380px) {
    .container {
        padding: 0 16px;
    }

    .hero h1 {
        font-size: 1.7rem;
    }

    .logo {
        font-size: 1.2rem;
    }
}
