/* SC2 Replay Analyzer - Web GUI Theme */

:root {
    /* Base colors from the existing overlay design */
    --bg-primary: #0f141e;
    --bg-secondary: #141923;
    --bg-card: rgba(20, 25, 35, 0.92);
    --bg-table-row: rgba(255, 255, 255, 0.03);
    --bg-table-hover: rgba(255, 120, 60, 0.08);

    /* Accent colors */
    --accent-terran: #ff9d5c;
    --accent-terran-glow: rgba(255, 120, 60, 0.3);
    --accent-terran-dim: rgba(255, 120, 60, 0.15);

    /* Result colors */
    --color-win: #00ff88;
    --color-loss: #ff4444;
    --color-win-dim: rgba(0, 255, 136, 0.15);
    --color-loss-dim: rgba(255, 68, 68, 0.15);

    /* Text colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-dim: rgba(255, 255, 255, 0.4);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(255, 120, 60, 0.3);

    /* Tag colors (matches Python TAG_COLORS) */
    --tag-cyan: #00d4ff;
    --tag-purple: #b966ff;
    --tag-yellow: #ffd700;
    --tag-pink: #ff6bcd;
    --tag-teal: #00ffc8;
    --tag-blue: #6b9dff;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Rajdhani', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Accent glow line at top of page */
.top-glow {
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--accent-terran) 30%,
        rgba(255, 180, 100, 0.6) 50%,
        var(--accent-terran) 70%,
        transparent 100%);
    box-shadow: 0 0 20px var(--accent-terran-glow);
}

/* Stats cards */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.stat-card:hover {
    border-color: var(--border-accent);
}

.stat-value {
    font-family: 'Roboto Mono', monospace;
    text-shadow: 0 0 8px var(--accent-terran-dim);
}

/* Replay table */
.replay-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.replay-table thead th {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-accent);
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    cursor: default;
}

.replay-table tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color 0.15s;
}

.replay-table tbody tr:hover {
    background-color: var(--bg-table-hover);
}

.replay-table tbody td {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.replay-table tbody td.col-right {
    text-align: right;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
}

.replay-table tbody td.col-left {
    text-align: left;
}

/* Result cell coloring */
.result-win {
    color: var(--color-win);
    font-weight: 700;
}

.result-loss {
    color: var(--color-loss);
    font-weight: 700;
}

/* MMR diff styling */
.mmr-positive {
    color: var(--color-win);
    font-size: 0.7rem;
}

.mmr-negative {
    color: var(--color-loss);
    font-size: 0.7rem;
}

/* Worker benchmark warning */
.worker-warning {
    color: var(--color-loss);
    font-weight: 700;
    font-size: 0.7rem;
}

/* Filter bar */
.filter-bar select,
.filter-bar input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.875rem;
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    transition: border-color 0.2s;
}

.filter-bar select:focus,
.filter-bar input:focus {
    outline: none;
    border-color: var(--accent-terran);
    box-shadow: 0 0 0 1px var(--accent-terran-dim);
}

.filter-bar select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, rgba(255, 120, 60, 0.2), rgba(255, 120, 60, 0.1));
    border: 1px solid var(--border-accent);
    color: var(--accent-terran);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 4px;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(255, 120, 60, 0.3), rgba(255, 120, 60, 0.2));
    box-shadow: 0 0 12px var(--accent-terran-dim);
}

.btn-danger {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.2), rgba(255, 68, 68, 0.1));
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: var(--color-loss);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.3), rgba(255, 68, 68, 0.2));
}

.btn-success {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 255, 136, 0.1));
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: var(--color-win);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

/* Tag items */
.tag-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    transition: border-color 0.2s;
}

.tag-item:hover {
    border-color: var(--border-accent);
}

.tag-icon {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.75rem;
    text-shadow: 0 0 6px currentColor;
}

/* Chart container */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1rem;
}

/* Settings modal */
.modal-overlay {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-accent);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Loading spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    animation: spin 1s linear infinite;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--accent-terran);
    border-radius: 50%;
    width: 1.25rem;
    height: 1.25rem;
}

/* Summary row */
.summary-row {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-accent);
    padding: 0.5rem 0.75rem;
}
