:root {
    /* Modern Minimalist Palette (Aikido.dev inspired) */
    --bg-body: #ffffff;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f9fafb;
    --bg-subtle: #f3f4f6;

    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;

    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --border-dark: #111827;
    /* High contrast border for active states */

    --primary: #111827;
    /* Black */
    --primary-hover: #000000;
    --primary-text: #ffffff;

    /* Functional Colors (Muted/Pastel for sophistication) */
    --danger-bg: #fef2f2;
    --danger-text: #991b1b;
    --danger-border: #fecaca;

    --warning-bg: #fffbeb;
    --warning-text: #92400e;
    --warning-border: #fde68a;

    --success-bg: #ecfdf5;
    --success-text: #065f46;
    --success-border: #a7f3d0;

    --info-bg: #eff6ff;
    --info-text: #1e40af;
    --info-border: #bfdbfe;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.tagline {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    background: var(--bg-subtle);
    padding: 4px;
    border-radius: var(--radius-md);
    width: fit-content;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 24px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

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

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
    min-height: calc(100vh - 400px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Section */
.search-section {
    max-width: 720px;
    margin: 0 auto 60px;
    text-align: center;
}

.search-section h2 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 32px;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    position: relative;
    background: var(--bg-surface);
    padding: 8px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.search-box:focus-within {
    border-color: var(--border-dark);
    box-shadow: var(--shadow-md);
}

#cve-input,
#keyword-input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    font-size: 1rem;
    outline: none;
    color: var(--text-primary);
    background: transparent;
    width: 100%;
}

#cve-input::placeholder,
#keyword-input::placeholder {
    color: var(--text-tertiary);
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-text);
    border: none;
    padding: 12px 32px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-top: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    text-align: left;
    display: none;
    overflow: hidden;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-subtle);
    transition: background 0.1s;
}

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

.suggestion-item:hover {
    background: var(--bg-surface-hover);
}

/* Examples */
.examples {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.examples span {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    font-weight: 500;
}

.example-btn,
.keyword-btn {
    background: var(--bg-subtle);
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.example-btn:hover,
.keyword-btn:hover {
    background: var(--bg-surface);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

/* Results Section */
.results-section,
.overview-section {
    animation: fadeIn 0.5s ease;
    padding-bottom: 80px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.results-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.badge.critical {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-color: var(--danger-border);
}

.badge.high {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: var(--warning-border);
}

.badge.medium {
    background: var(--info-bg);
    color: var(--info-text);
    border-color: var(--info-border);
}

.badge.low {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}

.badge.info {
    background: var(--bg-subtle);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

/* Score Cards */
.score-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.score-card {
    background: var(--bg-surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    text-align: left;
    transition: box-shadow 0.2s;
}

.score-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.score-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 12px;
}

.score-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}

.score-severity {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.score-desc {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Alert */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 40px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border: 1px solid;
}

.alert-danger {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger-text);
}

.alert svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.alert strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.alert p {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Info Sections */
.info-section {
    margin-bottom: 40px;
}

.info-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-section h4::before {
    content: '';
    display: block;
    width: 4px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
}

.info-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
}

/* Two Column Layout */
.two-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

/* CWE Tags */
.cwe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cwe-tag {
    background: var(--bg-subtle);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.cwe-tag strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Product List */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-item {
    padding: 10px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.product-item::before {
    content: '•';
    color: var(--text-tertiary);
    margin-right: 12px;
    font-size: 1.2em;
}

/* Charts */
.chart-container {
    background: var(--bg-surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

/* References */
.references {
    list-style: none;
}

.references li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.references a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.references a:hover {
    color: var(--text-secondary);
    text-decoration: underline;
}

/* Overview Form */
.overview-form {
    display: flex;
    gap: 16px;
    background: var(--bg-surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
    align-items: flex-end;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

#period-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-body);
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

#period-select:focus {
    border-color: var(--border-dark);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
}

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

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

/* Table */
.table-container {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-subtle);
}

th {
    padding: 16px 24px;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

td {
    padding: 16px 24px;
    font-size: 0.95rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--bg-surface-hover);
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-light);
    margin-top: 80px;
}

/* Loader */
.loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .search-box {
        flex-direction: column;
        padding: 16px;
    }

    .btn-primary {
        width: 100%;
    }

    .overview-form {
        flex-direction: column;
        align-items: stretch;
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 16px;
    }

    .two-column {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .score-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .search-section h2 {
        font-size: 1.75rem;
    }

    .logo-img {
        height: 32px;
        width: auto;
    }
}