/* MATHEL Webapp - Modern Dark Theme */
:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-hover: #1a1a25;
    --text: #e4e4e7;
    --text-muted: #71717a;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-green: #22c55e;
    --accent-yellow: #eab308;
    --accent-red: #ef4444;
    --border: #27272a;
    --gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== LOGIN SCREEN ========== */
#login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.08) 0%, transparent 60%);
    animation: bgPulse 10s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

.login-container {
    background: rgba(18, 18, 26, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 10;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.logo-text {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.login-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.875rem 1rem 0.875rem 3rem;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.login-btn {
    width: 100%;
    background: var(--gradient);
    border: none;
    color: white;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -10px rgba(59, 130, 246, 0.5);
}

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

.spinner {
    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;
    margin-right: 0.5rem;
    vertical-align: middle;
}

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

.login-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 2rem;
}

/* ========== NAVBAR ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-logo {
    width: 32px;
    height: 32px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient);
    border-radius: 1px;
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.about-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 0.5rem;
}

.about-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* About Modal */
.about-modal-content {
    max-width: 700px;
}

.about-content {
    padding: 1rem 0;
}

.about-intro {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.about-content h3 {
    font-size: 1rem;
    color: var(--accent-blue);
    margin: 1.5rem 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.about-charts {
    list-style: none;
    padding: 0;
}

.about-charts li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.about-charts li strong {
    color: var(--text);
}

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

.citation {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow-x: auto;
    white-space: pre;
}

.models-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.models-table th,
.models-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.models-table th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text);
    font-weight: 600;
}

.models-table td {
    color: var(--text-muted);
}

.models-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* ========== MAIN CONTENT ========== */
main {
    margin-top: 64px;
    padding: 2rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== HERO ========== */
.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
    white-space: nowrap;
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    min-width: 160px;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.stat-card.highlight {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border-color: rgba(59, 130, 246, 0.3);
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 0.25rem;
}

.stat-card.highlight .stat-value {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* ========== SECTIONS ========== */
.section {
    margin-bottom: 3rem;
    scroll-margin-top: 80px;
}

.section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--gradient);
    border-radius: 2px;
}

/* ========== OVERVIEW CONTROLS ========== */
.overview-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s;
}

.toggle-label:hover {
    border-color: var(--accent-blue);
}

.toggle-label input {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    transition: all 0.2s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--text);
    border-radius: 50%;
    transition: all 0.2s;
}

.toggle-label input:checked + .toggle-switch {
    background: var(--accent-green);
}

.toggle-label input:checked + .toggle-switch::after {
    left: 22px;
}

.toggle-label input:checked ~ span:last-child {
    color: var(--accent-green);
}

/* ========== CHARTS ========== */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    transition: all 0.2s;
}

.chart-card:hover {
    border-color: rgba(59, 130, 246, 0.2);
}

.chart-card.wide {
    grid-column: 1 / -1;
}

.chart {
    height: 320px;
}

.chart-card.wide .chart {
    height: 380px;
}

.chart.tall {
    height: 600px;
}

/* ========== FILTERS & TABLE ========== */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filters select,
.filters input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    min-width: 150px;
    transition: all 0.2s;
}

.filters select:focus,
.filters input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.filters input {
    flex: 1;
    min-width: 200px;
}

.table-container {
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
}

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

th, td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: rgba(0, 0, 0, 0.3);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

td a {
    color: var(--accent-blue);
    text-decoration: none;
}

td a:hover {
    text-decoration: underline;
}

.score-perfect { color: var(--accent-green); font-weight: 600; }
.score-good { color: var(--accent-cyan); }
.score-partial { color: var(--accent-yellow); }
.score-zero { color: var(--accent-red); }

.leakage-no_leakage { color: var(--accent-green); }
.leakage-leaked { color: var(--accent-red); }
.leakage-comparable_meaning { color: var(--accent-yellow); }

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
}

.pagination button {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========== FOOTER ========== */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

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

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

/* ========== PROBLEM CARDS ========== */
.problems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.problem-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid var(--accent-blue);
}

.problem-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-blue);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.problem-card.leaked {
    border-left-color: var(--accent-red);
}

.problem-card.clean {
    border-left-color: var(--accent-green);
}

.problem-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.problem-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

.problem-card .card-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.problem-card .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.problem-card .badge.category {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.problem-card .card-scores {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
    font-size: 0.75rem;
}

.problem-card .score-col {
    text-align: center;
}

.problem-card .score-col .label {
    color: var(--text-muted);
    font-size: 0.65rem;
    display: block;
    margin-bottom: 0.2rem;
}

.problem-card .score-col .value {
    font-weight: 600;
}

.problem-card .score-col .value.perfect { color: var(--accent-green); }
.problem-card .score-col .value.good { color: var(--accent-cyan); }
.problem-card .score-col .value.partial { color: var(--accent-yellow); }
.problem-card .score-col .value.zero { color: var(--accent-red); }

.problem-card .problem-preview {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== MODAL ========== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.modal-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.modal-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal-badges .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.modal-badges .badge.competition { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.modal-badges .badge.year { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.modal-badges .badge.category { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.modal-badges .badge.clean { background: rgba(34, 197, 94, 0.15); color: var(--accent-green); }
.modal-badges .badge.leaked { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }

.modal-scores {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.modal-scores .score-item {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.modal-scores .score-item.gemini { border-color: rgba(59, 130, 246, 0.3); }
.modal-scores .score-item.flash { border-color: rgba(6, 182, 212, 0.3); }
.modal-scores .score-item.gpt51 { border-color: rgba(139, 92, 246, 0.3); }
.modal-scores .score-item.gpt52 { border-color: rgba(34, 197, 94, 0.3); }

.modal-scores .score-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.modal-scores .score-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-section {
    margin-bottom: 1.5rem;
}

.modal-section h3 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.problem-text {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.25rem;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.7;
    border: 1px solid var(--border);
}

.modal-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--accent-blue);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.solution-text {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.25rem;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.7;
    border: 1px solid var(--border);
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: 'Inter', -apple-system, sans-serif;
}

.solution-text:empty::after {
    content: 'No solution available';
    color: var(--text-muted);
    font-style: italic;
}

/* ========== SUBCATEGORIES, TECHNIQUES, NOVEL ========== */
.subcategories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.subcategories-list .subcategory-tag {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.subcategories-list .subcategory-tag.primary {
    background: var(--gradient);
    color: white;
}

.subcategories-list .badge.subcategory {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.problem-summary {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.techniques-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.technique-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

.technique-card h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.technique-card h4.human { color: var(--text-muted); }
.technique-card h4.gemini { color: var(--accent-blue); }
.technique-card h4.flash { color: var(--accent-cyan); }
.technique-card h4.gpt51 { color: var(--accent-purple); }
.technique-card h4.gpt52 { color: var(--accent-green); }

.technique-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.technique-card li {
    font-size: 0.8rem;
    color: var(--text);
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.novel-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    padding: 1rem;
}

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

.novel-info .novelty-score {
    background: var(--gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
}

.novel-info .novel-label {
    font-size: 0.9rem;
    color: var(--text);
}

.novel-info .unique-techniques {
    margin-top: 0.75rem;
}

.novel-info .unique-techniques h5 {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.novel-info .unique-techniques ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.novel-info .unique-techniques li {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.simpler-info {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 10px;
    padding: 1rem;
}

.simpler-info .simpler-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.simpler-info .reduction-badge {
    background: var(--accent-green);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
}

.simpler-info .simpler-label {
    font-size: 0.9rem;
    color: var(--text);
}

.simpler-info .length-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Problem card badges for novel/simpler */
.problem-card .special-badges {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.problem-card .special-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
}

.problem-card .special-badge.novel {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
}

.problem-card .special-badge.simpler {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-green);
}

/* Leakage badge in card header */
.problem-card .leakage-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.problem-card .leakage-badge.leakage-clean {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.problem-card .leakage-badge.leakage-leaked {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.problem-card .leakage-badge.leakage-comparable {
    background: rgba(234, 179, 8, 0.2);
    color: var(--accent-yellow);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.problem-card.comparable {
    border-left-color: var(--accent-yellow);
}

/* ========== CROSS-MODEL SECTIONS ========== */
.subsection-title {
    font-size: 1.2rem;
    color: var(--text);
    margin: 2rem 0 1rem 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: -0.5rem 0 1rem 0;
}

/* Grading Matrix */
.grading-matrix {
    overflow-x: auto;
}

.grading-matrix table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.grading-matrix th,
.grading-matrix td {
    padding: 0.6rem;
    text-align: center;
    border: 1px solid var(--border);
}

.grading-matrix th {
    background: var(--bg-hover);
    font-weight: 600;
    font-size: 0.8rem;
}

.grading-matrix th.corner {
    background: transparent;
}

.grading-matrix th.solver-header {
    text-align: right;
    padding-right: 1rem;
}

.grading-matrix td.score {
    font-weight: 600;
    font-size: 1rem;
}

.grading-matrix td.score.perfect {
    color: var(--accent-green);
    background: rgba(34, 197, 94, 0.1);
}

.grading-matrix td.score.good {
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.1);
}

.grading-matrix td.score.partial {
    color: var(--accent-yellow);
    background: rgba(234, 179, 8, 0.1);
}

.grading-matrix td.score.low {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
}

.grading-matrix td.score.na {
    color: var(--text-muted);
    font-weight: normal;
    font-size: 0.85rem;
}

.grading-matrix .disagreement-note {
    font-size: 0.8rem;
    color: var(--accent-yellow);
    margin-top: 0.5rem;
}

/* Leakage Comparison */
.leakage-comparison {
    display: grid;
    gap: 1rem;
}

.leakage-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.leakage-cell {
    background: var(--bg-hover);
    border-radius: 8px;
    padding: 1rem;
}

.leakage-cell h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.leakage-cell .verdict {
    font-weight: 600;
    font-size: 1rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    display: inline-block;
}

.leakage-cell .verdict.leaked {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.leakage-cell .verdict.clean,
.leakage-cell .verdict.no_leakage {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-green);
}

.leakage-cell .verdict.comparable,
.leakage-cell .verdict.comparable_meaning {
    background: rgba(234, 179, 8, 0.2);
    color: var(--accent-yellow);
}

.leakage-cell .confidence {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.leakage-predictions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.leakage-predictions h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.prediction-item {
    background: var(--bg-dark);
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.prediction-item .model-name {
    font-weight: 600;
    color: var(--accent-cyan);
    margin-bottom: 0.3rem;
}

.prediction-item .prediction-text {
    color: var(--text-muted);
    font-family: 'Monaco', monospace;
    font-size: 0.8rem;
}

/* Agreement summary */
.agreement-summary {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg-hover);
    border-radius: 8px;
}

.agreement-summary .agree {
    color: var(--accent-green);
}

.agreement-summary .disagree {
    color: var(--accent-red);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }

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

    .stats-row {
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
        min-width: 140px;
    }

    .login-container {
        margin: 1rem;
        padding: 2rem;
    }

    .compare-grid {
        grid-template-columns: 1fr;
    }
}

/* Difficulty badges */
.modal-badges .badge.difficulty.easy { background: rgba(34, 197, 94, 0.15); color: var(--accent-green); }
.modal-badges .badge.difficulty.medium { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.modal-badges .badge.difficulty.hard { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }

.difficulty-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}
.difficulty-badge.easy { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.difficulty-badge.medium { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.difficulty-badge.hard { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* Compare view */
.compare-btn {
    background: rgba(139, 92, 246, 0.1) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
}
.compare-btn.active {
    background: rgba(139, 92, 246, 0.2) !important;
}

.compare-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.compare-controls select {
    padding: 0.5rem 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.875rem;
}

.compare-vs {
    color: var(--text-muted);
    font-weight: 600;
}

.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.compare-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    max-height: 500px;
    overflow-y: auto;
}

.compare-panel h4 {
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Chart tall variant */
.chart.tall {
    min-height: 400px;
}

/* ========== SOLUTIONS HIDE TOGGLE ========== */
.solutions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.solutions-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.hide-solutions-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-muted);
    user-select: none;
}

.hide-solutions-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

.hide-solutions-toggle:hover {
    color: var(--text);
}

#solutions-container.hidden {
    display: none;
}

#solutions-container .solutions-hidden-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ========== PROBLEM TRACKING (Solved/To-Review) ========== */
.problem-card .card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.problem-card .track-btn {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.problem-card .track-btn:hover {
    border-color: var(--accent-blue);
    color: var(--text);
}

.problem-card .track-btn.active.solved {
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.problem-card .track-btn.active.review {
    background: rgba(234, 179, 8, 0.2);
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
}

/* ========== TECHNIQUE GLOSSARY ========== */
.technique-item {
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.technique-item:hover {
    color: var(--accent-blue);
}

.technique-item .technique-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.technique-item:hover .technique-tooltip {
    opacity: 1;
    visibility: visible;
}

.technique-item .filter-hint {
    color: var(--accent-blue);
    font-size: 0.65rem;
    margin-left: 0.5rem;
}

/* Clickable technique badges in modal */
.techniques-grid .technique-card ul li {
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    margin: 0.25rem 0;
    border-radius: 4px;
    transition: all 0.2s;
}

.techniques-grid .technique-card ul li:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

/* ========== SIMILAR PROBLEMS SECTION ========== */
.similar-problems-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.similar-problems-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.similar-problems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.similar-problem-card {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.similar-problem-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.similar-problem-card .similar-id {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.similar-problem-card .similar-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.similar-problem-card .similar-match {
    font-size: 0.7rem;
    color: var(--accent-purple);
    margin-top: 0.25rem;
}

.similar-problem-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.similarity-score {
    font-size: 0.7rem;
    color: var(--accent-green);
    background: rgba(34, 197, 94, 0.15);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.similar-problem-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.similar-problem-meta .badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
}

.similar-problem-meta .difficulty-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: capitalize;
}

.similar-problem-meta .difficulty-badge.easy {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-green);
}

.similar-problem-meta .difficulty-badge.medium {
    background: rgba(234, 179, 8, 0.2);
    color: var(--accent-yellow);
}

.similar-problem-meta .difficulty-badge.hard {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.match-reasons {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Filter tags in Explorer */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border-radius: 4px;
}

.filter-tag .remove-filter {
    cursor: pointer;
    font-weight: bold;
    margin-left: 0.25rem;
}

.filter-tag .remove-filter:hover {
    color: var(--accent-red);
}
