:root {
    --bg-dark: #1e1e2e;
    --bg-panel: #252537;
    --bg-header: #181825;
    --text-primary: #cdd6f4;
    --text-secondary: #a6adc8;
    --accent-ct: #5d79ae;
    --accent-t: #de9b35;
    --accent-danger: #f38ba8;
    --accent-success: #a6e3a1;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    overflow: hidden;
    /* App-like feel */
    margin: 0;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.app-header {
    height: 60px;
    background-color: var(--bg-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.logo {
    font-weight: bold;
    font-size: 1.4rem;
    color: #fff;
    letter-spacing: 1px;
}

.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.team-panel {
    width: 280px;
    background-color: var(--bg-panel);
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
    border-left: 1px solid #333;
}

.team-ct {
    border-right: 1px solid #333;
}

.team-t {
    border-left: 1px solid #333;
}

.team-header {
    padding: 20px;
    text-align: center;
    font-weight: bold;
    background-color: rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.team-ct .team-header {
    color: var(--accent-ct);
    border-bottom: 3px solid var(--accent-ct);
}

.team-t .team-header {
    color: var(--accent-t);
    border-bottom: 3px solid var(--accent-t);
}

.player-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.player-card {
    background-color: rgba(255, 255, 255, 0.05);
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
}

.player-card:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.player-card.active {
    border-color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.15);
}

.player-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.player-info {
    flex: 1;
    overflow: hidden;
}

.player-name {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-id-link {
    font-size: 11px;
    color: #89b4fa;
    /* More visible blue */
    margin-top: 2px;
    text-decoration: none;
    display: inline-block;
    /* Fix: prevent full width click area */
    position: relative;
    z-index: 10;
}

.player-id-link:hover {
    text-decoration: underline;
    color: #b4befe;
}

.no-audio-badge {
    font-size: 0.7em;
    background-color: #45475a;
    color: #cdd6f4;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
}

.toxicity-badge {
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    /* Push to right */
    font-weight: bold;
    color: #111;
}

.toxicity-high {
    background-color: var(--accent-danger);
}

.toxicity-medium {
    background-color: #fab387;
}

.toxicity-low {
    background-color: var(--accent-success);
}

.toxicity-neutral {
    background-color: #bac2de;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
    font-family: 'Inter', sans-serif;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

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

.loading-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0.8;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.step.active {
    color: var(--accent-primary);
    font-weight: bold;
}

.step.completed {
    color: var(--accent-success);
    text-decoration: line-through;
}

.center-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-panel);
    /* Match waveform background */
}

.map-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #0d0d15;
    overflow: hidden;
    transition: all 0.3s ease;
}

.map-wrapper.hidden {
    display: none;
}

.waveform-wrapper {
    height: 320px;
    background-color: var(--bg-panel);
    border-top: 1px solid #333;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.waveform-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

#selected-player-name {
    font-size: 1.2rem;
    font-weight: 600;
}

.analysis-result {
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
    border-left: 4px solid var(--accent-ct);
}

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

::-webkit-scrollbar-track {
    background: #1e1e2e;
}

::-webkit-scrollbar-thumb {
    background: #45475a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #585b70;
}

/* Upload page specific */
/* Upload Page Styles */
.upload-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: radial-gradient(circle at center, #2a2a3d 0%, #1e1e2e 100%);
}

.brand-header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

.logo-large {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.upload-dropzone {
    width: 600px;
    height: 300px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-ct);
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.upload-dropzone.dragover .upload-icon {
    transform: scale(1.1) translateY(-5px);
    color: var(--accent-ct);
}

.dropzone-content {
    text-align: center;
    pointer-events: none;
}

.upload-icon {
    color: var(--text-secondary);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.upload-dropzone h2 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.upload-dropzone p {
    margin: 0;
    color: var(--text-secondary);
}

.upload-dropzone .sub-text {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 5px;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Round Timeline Styles */
.round-timeline {
    display: flex;
    width: 100%;
    height: 40px;
    background-color: var(--bg-header);
    overflow-x: hidden;
    white-space: nowrap;
    border-bottom: 1px solid #333;
    align-items: stretch;
    padding: 0;
    gap: 1px;
    /* Tiny gap for visual separation */
}

.round-pill {
    flex: 1;
    /* Distribute space equally */
    background-color: #2a2a3d;
    color: #888;
    border-radius: 0;
    /* Square corners */
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.round-pill:hover {
    filter: brightness(1.2);
    z-index: 2;
}

.round-pill.active {
    background-color: #fff !important;
    color: #000 !important;
    font-weight: bold;
    z-index: 3;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.round-pill.ct-win {
    background-color: var(--accent-ct);
    color: #fff;
}

.round-pill.t-win {
    background-color: var(--accent-t);
    color: #fff;
}

.hidden {
    display: none !important;
}