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

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border: #30363d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #484f58;
    --accent-primary: #58a6ff;
    --accent-secondary: #1f6feb;
    --accent-glow: rgba(88, 166, 255, 0.4);
    --success: #3fb950;
    --warning: #d29922;
    --danger: #f85149;
    --purple: #a371f7;
    --pink: #db61a2;
    --cyan: #39c5cf;
}

body {
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at top, rgba(88, 166, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(163, 113, 247, 0.03) 0%, transparent 50%);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--purple) 50%, var(--pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

nav a:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

nav a.active {
    color: var(--text-primary);
    background: var(--bg-secondary);
    border-color: var(--border);
}

.search-box {
    max-width: 700px;
    margin: 0 auto 30px;
    position: relative;
}

#search-input {
    width: 100%;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
}

#search-input::placeholder {
    color: var(--text-muted);
}

#search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 8px 32px rgba(0, 0, 0, 0.3);
    background: var(--bg-tertiary);
}

.stats-panel {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-box {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: 24px 40px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border);
    min-width: 160px;
    position: relative;
    overflow: hidden;
}

.stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--purple));
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.results {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

#results-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

#results-table th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 14px 20px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

#results-table th:last-child {
    border-right: none;
}

/* Column widths - must match between th and td */
#results-table .col-release,
#results-table td.release-name {
    width: 50%;
}

#results-table .col-section,
#results-table td.section {
    width: 15%;
    text-align: center;
}

#results-table .col-group,
#results-table td.group {
    width: 15%;
    text-align: center;
}

#results-table .col-time,
#results-table td.time {
    width: 20%;
    text-align: center;
}

#results-table td {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    vertical-align: middle;
}

#results-table td:last-child {
    border-right: none;
}


#results-table tbody tr {
    transition: background 0.15s ease;
}

#results-table tbody tr:hover {
    background: var(--bg-tertiary);
}

#results-table tbody tr:last-child td {
    border-bottom: none;
}

#results-table .placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 20px;
    cursor: pointer;
    font-size: 15px;
}

#results-table .placeholder:hover {
    color: var(--accent-primary);
}

.release-name {
    color: var(--text-primary);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    word-break: break-all;
}

td.section {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--warning);
}

td.section span,
td.group span {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(210, 153, 34, 0.15) 0%, rgba(210, 153, 34, 0.08) 100%);
    border: 1px solid rgba(210, 153, 34, 0.3);
    box-shadow: 0 2px 8px rgba(210, 153, 34, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

td.group {
    font-size: 11px;
    font-weight: 600;
    color: var(--purple);
}

td.group span {
    background: linear-gradient(135deg, rgba(163, 113, 247, 0.15) 0%, rgba(163, 113, 247, 0.08) 100%);
    border: 1px solid rgba(163, 113, 247, 0.3);
    box-shadow: 0 2px 8px rgba(163, 113, 247, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.stats-count {
    color: var(--text-secondary);
    font-size: 14px;
    padding-left: 20px;
}

/* Hide table headers in stats mode */
.stats-mode #results-table thead {
    display: none !important;
}

.stats-mode #results-table {
    border-collapse: collapse;
}

.stats-mode #results-table td.section {
    width: auto;
    text-align: left;
    padding-left: 30px;
}

.stats-mode #results-table .stats-count {
    text-align: left;
}

.time {
    color: var(--text-secondary);
    white-space: nowrap;
    font-size: 13px;
}

.time-ago {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.pagination a.active {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Live mode indicator */
.live-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 12px var(--danger);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.9);
    }
}

.live-new {
    animation: slideIn 0.4s ease-out, glow 2s ease-out;
}

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

@keyframes glow {
    from {
        background: rgba(88, 166, 255, 0.15);
        box-shadow: inset 0 0 30px rgba(88, 166, 255, 0.1);
    }
    to {
        background: transparent;
        box-shadow: none;
    }
}

/* Highlight search matches */
.highlight {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.3), rgba(163, 113, 247, 0.3));
    color: var(--text-primary);
    padding: 1px 4px;
    border-radius: 4px;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 12px;
    vertical-align: middle;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
    border: 2px solid var(--bg-primary);
}

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

/* Site Footer */
.site-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.footer-stats {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.footer-stats #footer-total {
    color: var(--accent-primary);
    font-weight: 600;
}

.footer-links {
    margin-bottom: 8px;
}

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

.footer-links a:hover {
    color: var(--purple);
}

.footer-links .separator {
    margin: 0 10px;
    color: var(--border);
}

.footer-powered {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Help link */
.help-link {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.help-link.hidden {
    display: none !important;
}

.help-link:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--accent-primary);
    font-size: 24px;
}

.help-section {
    margin-bottom: 24px;
}

.help-section h3 {
    color: var(--text-primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

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

.help-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.help-table td:first-child {
    white-space: nowrap;
    width: 1%;
}

.help-table code {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: var(--cyan);
}

.help-section ul {
    list-style: none;
    padding: 0;
}

.help-section li {
    padding: 6px 0;
    color: var(--text-secondary);
}

.help-section li code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: var(--cyan);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    .header h1 {
        font-size: 28px;
    }

    #search-input {
        padding: 14px 18px;
        font-size: 16px;
    }

    .stats-panel {
        gap: 12px;
    }

    .stat-box {
        padding: 16px 24px;
        min-width: 140px;
    }

    .stat-value {
        font-size: 24px;
    }

    #results-table th,
    #results-table td {
        padding: 10px 12px;
    }

    .release-name {
        font-size: 12px;
    }
}
