:root {
    /* Light Mode (Default) */
    --bg-body: #f5f7fa;
    --bg-main: #ffffff;
    --bg-card: #ffffff;
    --bg-elevated: #f8f9fb;
    --bg-input: #f1f3f7;
    --text-primary: #1a1d26;
    --text-secondary: #5c6370;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --border-subtle: #eef0f4;
    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #3b82f6;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --ad-bg: #f8f9fb;
    --ad-border: #e5e7eb;
}

[data-theme="dark"] {
    --bg-body: #0f1117;
    --bg-main: #161922;
    --bg-card: #1e222d;
    --bg-elevated: #252a37;
    --bg-input: #252a37;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-color: #2d3344;
    --border-subtle: #252a37;
    --accent-primary: #818cf8;
    --accent-primary-hover: #6366f1;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
    --ad-bg: #1a1e28;
    --ad-border: #2d3344;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Layout with Ad Spaces */
.page-wrapper {
    display: flex;
    min-height: 100vh;
}

.ad-sidebar {
    width: 160px;
    flex-shrink: 0;
    padding: 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ad-slot {
    background: var(--ad-bg);
    border: 1px dashed var(--ad-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ad-slot.vertical {
    flex: 1;
    min-height: 600px;
}

.ad-slot.horizontal {
    height: 100px;
    width: 100%;
}

.main-content {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    min-width: 0;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-info));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-md);
}

.brand-text h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: -2px;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-elevated);
    padding: 0.5rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
}

.theme-btn {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.theme-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.theme-btn:hover:not(.active) {
    color: var(--text-secondary);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2.5rem 0 3rem;
    max-width: 900px;
    margin: 0 auto;
}

        .hero h1 {
            font-size: 2.25rem;
            font-weight: 800;
            letter-spacing: -0.03em;
            line-height: 1.3;
            margin-bottom: 1rem;
            max-width: 800px;
            margin-left: auto;
            margin-right: auto;
        }

        .hero-subtitle {
            font-size: 1.1rem;
            color: var(--text-secondary);
            max-width: 700px;
            margin: 1.5rem auto 0;
            line-height: 1.7;
        }

/* Upload Zone */
.upload-zone {
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.upload-zone:hover {
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.upload-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
    border-style: solid;
}

.upload-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
}

.upload-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.upload-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.file-types {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.file-type {
    background: var(--bg-input);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

#file-input {
    display: none;
}

/* Loading State */
.loading {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.loading.active {
    display: flex;
}

.spinner-ring {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    margin-top: 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.loading-subtext {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Results Section */
.results {
    display: none;
}

.results.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Verdict Card */
.verdict-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
}

.verdict-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.verdict-card.clean::before { background: var(--accent-success); }
.verdict-card.low::before { background: var(--accent-warning); }
.verdict-card.medium::before { background: #f97316; }
.verdict-card.high::before { background: var(--accent-danger); }

.verdict-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.verdict-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.verdict-card.clean .verdict-icon { background: rgba(16, 185, 129, 0.1); }
.verdict-card.low .verdict-icon { background: rgba(245, 158, 11, 0.1); }
.verdict-card.medium .verdict-icon { background: rgba(249, 115, 22, 0.1); }
.verdict-card.high .verdict-icon { background: rgba(239, 68, 68, 0.1); }

.verdict-text h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.verdict-card.clean .verdict-text h3 { color: var(--accent-success); }
.verdict-card.low .verdict-text h3 { color: var(--accent-warning); }
.verdict-card.medium .verdict-text h3 { color: #f97316; }
.verdict-card.high .verdict-text h3 { color: var(--accent-danger); }

.verdict-text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.verdict-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

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

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Findings Sections */
.findings-section {
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.findings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}

.findings-header:hover {
    background: var(--bg-elevated);
}

.findings-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.findings-title-icon {
    font-size: 1.1rem;
}

.findings-count {
    background: var(--accent-danger);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.findings-count.zero {
    background: var(--text-muted);
}

.findings-chevron {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.findings-header.open .findings-chevron {
    transform: rotate(180deg);
}

.findings-body {
    display: none;
    padding: 0 1.25rem 1.25rem;
    max-height: 350px;
    overflow-y: auto;
}

.findings-body.open {
    display: block;
}

.finding-item {
    background: var(--bg-elevated);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.6rem;
    border-left: 3px solid var(--accent-danger);
}

.finding-item:last-child {
    margin-bottom: 0;
}

.finding-location {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.finding-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--bg-input);
    padding: 0.75rem;
    border-radius: 8px;
    word-break: break-all;
    margin: 0.5rem 0;
    border: 1px solid var(--border-subtle);
}

.finding-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.finding-tag {
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid var(--border-subtle);
}

.empty-findings {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-info));
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-input);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* How It Works */
#how-it-works {
    margin: 3rem 0;
}

.how-it-works {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 0;
}

.how-step {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.how-step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.how-step-number {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-info));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0 auto 1.25rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.how-step h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.3;
    text-align: center;
}

.how-step p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    text-align: center;
}

/* Responsive */
@media (max-width: 1200px) {
    .ad-sidebar {
        width: 120px;
    }
}

@media (max-width: 992px) {
    .ad-sidebar {
        display: none;
    }
    
    .main-content {
        max-width: 100%;
        padding: 1.5rem;
    }
}

@media (max-width: 600px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }

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

            .hero-subtitle {
                font-size: 1rem;
            }

    .how-it-works {
        grid-template-columns: 1fr;
    }

    .verdict-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-subtle);
    }

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

    .action-buttons {
        flex-direction: column;
    }

    .upload-zone {
        padding: 2rem 1.5rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Bottom Ad Banner (Mobile) */
.mobile-ad {
    display: none;
    background: var(--ad-bg);
    border: 1px dashed var(--ad-border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1.5rem;
}

@media (max-width: 992px) {
    .mobile-ad {
        display: block;
    }
}


