/* Cyclops ML Review - Styles */
:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-orange: #f97316;
    --accent-green: #22c55e;
    --accent-yellow: #eab308;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    --border-color: #333;
    --radius: 8px;
}

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

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

.screen {
    display: none;
}
.screen.active {
    display: flex;
}

/* Login Screen */
#login-screen {
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1a2e 100%);
}

.login-container {
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    min-width: 360px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.logo h1 {
    font-size: 2.5rem;
    letter-spacing: 8px;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

#login-form input {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-align: center;
    letter-spacing: 2px;
}

#login-form input::placeholder {
    color: var(--text-secondary);
    letter-spacing: normal;
}

#login-form button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    background: var(--accent-orange);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}

#login-form button:hover {
    background: #ea580c;
}

.error {
    color: var(--accent-red);
    margin-top: 1rem;
}

/* Main Review Screen */
#review-screen {
    flex-direction: column;
    height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left h1 {
    font-size: 1.5rem;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    background: var(--accent-purple);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.progress-bar {
    width: 200px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-green);
    width: 0%;
    transition: width 0.3s;
}

#progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#reviewer-name {
    color: var(--text-secondary);
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.icon-btn:hover {
    background: var(--bg-tertiary);
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.panel {
    padding: 1.5rem;
    overflow-y: auto;
}

/* Media Panel */
.media-panel {
    flex: 1;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
}

.media-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#frame-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    overflow: hidden;
}

#frame-image {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.placeholder p:first-child {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

#audio-player {
    flex: 1;
    height: 40px;
}

#play-segment-btn {
    padding: 0.5rem 1rem;
    background: var(--accent-orange);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
}

.segment-info {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Prediction Panel */
.prediction-panel {
    width: 320px;
    background: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.ml-prediction h3 {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

/* ML Phase sections */
.ml-phase {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.ml-phase.primary {
    border: 1px solid var(--accent-orange);
}

.ml-phase-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    cursor: pointer;
    user-select: none;
}

.ml-phase.primary .ml-phase-header {
    background: rgba(249, 115, 22, 0.1);
}

.phase-badge {
    font-size: 0.6rem;
    font-weight: 700;
    background: var(--accent-purple);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.ml-phase.primary .phase-badge {
    background: var(--accent-orange);
}

.phase-title {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 600;
}

.phase-toggle {
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.ml-phase.collapsed .phase-toggle {
    transform: rotate(-90deg);
}

.ml-phase-content {
    padding: 0.75rem;
}

.ml-phase.collapsed .ml-phase-content {
    display: none;
}

.ml-attrs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

.ml-attr {
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
}

.ml-label {
    color: var(--text-secondary);
}

.ml-value {
    color: var(--text-primary);
    font-weight: 500;
}

.ml-value:not(:empty):not([data-empty="true"]) {
    color: var(--accent-green);
}

.prediction-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 1rem;
}

.character-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.confidence-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.confidence-fill {
    height: 100%;
    background: var(--accent-orange);
    width: 0%;
    transition: width 0.3s;
}

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

.ml-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.attr-tag {
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.attr-tag span {
    color: var(--text-primary);
}

/* Action Buttons */
.actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

.action-btn:hover {
    transform: translateY(-2px);
}

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

.action-btn .key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    font-size: 0.75rem;
}

.action-btn.approve {
    background: var(--accent-green);
    color: white;
}

.action-btn.correct {
    background: var(--accent-yellow);
    color: black;
}

.action-btn.skip {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.action-btn.flag {
    background: var(--accent-red);
    color: white;
}

/* Session Stats */
.session-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
}

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

/* Correction Panel - Always visible */
.correction-panel {
    width: 400px;
    background: var(--bg-secondary);
    display: block;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}

.correction-panel small {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.correction-panel select[multiple] {
    height: auto;
}

.correction-panel h3 {
    margin-bottom: 0.5rem;
}

.form-note {
    font-size: 0.8rem;
    color: var(--accent-yellow);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(234, 179, 8, 0.1);
    border-radius: var(--radius);
}

.correction-panel h4 {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 1.5rem 0 0.75rem;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--accent-orange);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
}

.submit-btn:hover {
    background: #ea580c;
}

/* Footer */
footer {
    padding: 0.75rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.keyboard-hints {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

kbd {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    margin-right: 0.25rem;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
}

.stat-card h3 {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.big-stat {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-orange);
}

.stat-card p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.leaderboard {
    width: 100%;
    border-collapse: collapse;
}

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

.leaderboard th {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.leaderboard tbody tr:hover {
    background: var(--bg-tertiary);
}

/* Responsive */
@media (max-width: 1200px) {
    .correction-panel {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        z-index: 100;
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }
}

@media (max-width: 768px) {
    main {
        flex-direction: column;
    }

    .prediction-panel {
        width: 100%;
        border-left: none;
        border-right: none;
        border-top: 1px solid var(--border-color);
    }

    .actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .action-btn {
        flex: 1;
        min-width: 45%;
    }

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