/**
 * Admin Interface Styles
 * Desktop-focused design with big screen display
 */

/* ============================================================================
   Global Styles
   ========================================================================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: #1a1a2e;
    color: #eee;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

/* ============================================================================
   Connection Screen
   ========================================================================== */
.connection-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.connection-container {
    text-align: center;
    padding: 2rem;
}

.connection-container h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: white;
}

.connection-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

/* ============================================================================
   Admin Interface Layout
   ========================================================================== */
.admin-interface {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: #0f3460;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #16213e;
}

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

.header-left h1 {
    margin: 0;
    font-size: 1.5rem;
}

.game-id {
    color: #aaa;
    font-size: 0.9rem;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.status-badge {
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.status-badge.created {
    background: #ffa726;
    color: #000;
}

.status-badge.active {
    background: #66bb6a;
    color: #000;
}

.status-badge.paused {
    background: #ffa726;
    color: #000;
}

.status-badge.finished {
    background: #ef5350;
    color: white;
}

.header-right {
    display: flex;
    gap: 0.5rem;
}

/* ============================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 0;
    overflow: hidden;
}

/* ============================================================================
   Left Panel: Players & Controls
   ========================================================================== */
.left-panel {
    background: #16213e;
    padding: 1.5rem;
    overflow-y: auto;
    border-right: 2px solid #0f3460;
}

.panel-section {
    margin-bottom: 2rem;
}

.panel-section h2 {
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    color: #aaa;
    text-transform: uppercase;
    font-weight: 600;
}

/* Players List */
.players-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.player-card {
    background: #0f3460;
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.player-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}

.player-name {
    font-weight: 500;
}

.quality-indicator {
    font-size: 0.8rem;
}

.quality-indicator.excellent {
    color: #66bb6a;
}

.quality-indicator.good {
    color: #9ccc65;
}

.quality-indicator.fair {
    color: #ffa726;
}

.quality-indicator.poor {
    color: #ef5350;
}

.quality-indicator.unknown {
    color: #666;
}

.player-score {
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffa726;
}

.player-points-controls {
    display: flex;
    gap: 0.25rem;
    flex-wrap: nowrap;
    align-items: center;
}

.custom-points-input {
    flex: 1;
    padding: 0.35rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #eee;
    font-size: 0.85rem;
    min-width: 70px;
    transition: all 0.2s;
}

.custom-points-input:focus {
    outline: none;
    border-color: #4caf50;
    background: rgba(255, 255, 255, 0.08);
}

.custom-points-input::placeholder {
    color: #666;
}

.btn-points {
    padding: 0.35rem 0.6rem;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-points:hover {
    background: #66bb6a;
    transform: translateY(-1px);
}

.btn-points.btn-award {
    background: #4caf50;
    font-size: 1rem;
}

.btn-points.btn-award:hover {
    background: #66bb6a;
}

.btn-points.btn-negative {
    background: #f44336;
}

.btn-points.btn-negative:hover {
    background: #ef5350;
}

/* Question Controls */
.question-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Button Presses */
.presses-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.press-card {
    background: #0f3460;
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 4px solid #666;
}

.press-card.rank-1 {
    border-left-color: #ffd700;
    background: #1a1a00;
}

.press-card.rank-2 {
    border-left-color: #c0c0c0;
}

.press-card.rank-3 {
    border-left-color: #cd7f32;
}

.press-rank {
    font-size: 1.5rem;
    font-weight: 700;
    width: 30px;
    text-align: center;
}

.press-card.rank-1 .press-rank {
    color: #ffd700;
}

.press-card.rank-2 .press-rank {
    color: #c0c0c0;
}

.press-card.rank-3 .press-rank {
    color: #cd7f32;
}

.press-info {
    flex: 1;
}

.press-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.press-details {
    font-size: 0.85rem;
    color: #aaa;
    display: flex;
    gap: 0.5rem;
}

.press-confidence {
    color: #66bb6a;
}

.anomaly-badge {
    color: #ef5350;
}

.press-actions {
    display: flex;
    gap: 0.25rem;
}

/* ============================================================================
   Center Panel: Big Screen Display
   ========================================================================== */
.center-panel {
    background: #000;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    position: relative;
    overflow: hidden;
}

.big-screen {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
}

/* Question Display */
.question-display {
    width: 100%;
    height: 100%;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    overflow-y: auto;
}

.question-header {
    margin-bottom: 2rem;
}

.question-header h2 {
    font-size: 2.5rem;
    margin: 0 0 1rem 0;
    color: #ffa726;
}

.question-points {
    font-size: 1.5rem;
    color: #66bb6a;
    font-weight: 600;
}

.question-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 2rem;
    padding: 1rem 0;
}

.question-text {
    font-size: 3rem;
    line-height: 1.4;
    max-width: 90%;
    color: white;
}

.question-text p {
    margin: 0;
}

/* Media Display */
.question-media-image {
    max-width: 90%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
}

.question-media-video {
    max-width: 90%;
    max-height: 70vh;
    border-radius: 8px;
}

.question-audio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.question-audio audio {
    width: 500px;
    max-width: 90%;
}

.audio-text {
    font-size: 2rem;
    color: #aaa;
}

/* Answer Display */
.answer-display {
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(102, 187, 106, 0.1);
    border: 2px solid #66bb6a;
    border-radius: 12px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.answer-label {
    font-size: 1.5rem;
    color: #66bb6a;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.answer-text {
    font-size: 2.5rem;
    color: white;
    line-height: 1.4;
}

/* Game Board */
.game-board {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    box-sizing: border-box;
    overflow: hidden;
}

.board-title {
    font-size: 3rem;
    margin: 0;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    flex: 1;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.board-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.board-category {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.board-cell {
    background: #0f3460;
    border: 2px solid #16213e;
    border-radius: 8px;
    padding: 2rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
}

.board-cell:hover:not(:disabled) {
    background: #1a4d8f;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.board-cell:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #0a1929;
}

.board-cell.answered {
    background: #1a3a1a;
    border-color: #2e7d32;
}

.cell-points {
    font-size: 2rem;
    font-weight: 700;
    color: #ffd700;
}

.board-cell.answered .cell-points {
    color: #4caf50;
}

.cell-check {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
    color: #4caf50;
}

/* ============================================================================
   Right Panel: Scoreboard
   ========================================================================== */
.right-panel {
    background: #16213e;
    padding: 1.5rem;
    overflow-y: auto;
    border-left: 2px solid #0f3460;
}

/* Scoreboard */
.scoreboard {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.scoreboard-row {
    background: #0f3460;
    padding: 0.75rem;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 0.75rem;
    align-items: center;
}

.scoreboard-row.position-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
}

.scoreboard-row.position-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #000;
}

.scoreboard-row.position-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #d4a574 100%);
    color: #000;
}

.scoreboard-position {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
}

.scoreboard-name {
    font-weight: 600;
}

.scoreboard-score {
    font-size: 1.3rem;
    font-weight: 700;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.stat-item {
    background: #0f3460;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #66bb6a;
}

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

.modal-content {
    background: #16213e;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid #0f3460;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.btn-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.btn-close:hover {
    background: #0f3460;
    color: white;
}

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

.questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.question-card {
    background: #0f3460;
    padding: 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
}

.question-card:hover {
    background: #667eea;
    transform: translateY(-2px);
}

.question-card.answered {
    opacity: 0.4;
    cursor: not-allowed;
}

.question-card.answered:hover {
    background: #0f3460;
    transform: none;
}

.question-card-category {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.question-card-points {
    font-size: 2rem;
    font-weight: 700;
    color: #ffa726;
}

.question-card-media {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.2rem;
}

/* ============================================================================
   Form Elements
   ========================================================================== */
.input-field {
    padding: 0.75rem 1rem;
    border: 2px solid #0f3460;
    border-radius: 8px;
    background: #16213e;
    color: white;
    font-size: 1rem;
    outline: none;
}

.input-field:focus {
    border-color: #667eea;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
}

.btn-secondary {
    background: #0f3460;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #16213e;
}

.btn-success {
    background: #66bb6a;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #4caf50;
}

.btn-warning {
    background: #ffa726;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #ff9800;
}

.btn-danger {
    background: #ef5350;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #e53935;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

/* ============================================================================
   Toast Notifications
   ========================================================================== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background: #0f3460;
    color: white;
    font-weight: 500;
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: #66bb6a;
}

.toast.error {
    background: #ef5350;
}

.toast.warning {
    background: #ffa726;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 250px 1fr 250px;
    }
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    .left-panel,
    .right-panel {
        max-height: 200px;
    }
}

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

::-webkit-scrollbar-track {
    background: #0f3460;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* ============================================================================
   Upload Modal
   ========================================================================== */
.upload-modal {
    max-width: 600px;
}

.file-upload-zone {
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(102, 126, 234, 0.05);
}

.file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    font-size: 4rem;
}

.upload-text {
    font-size: 1.2rem;
    color: #eee;
    margin: 0;
}

/* Upload Progress */
.upload-progress {
    margin-top: 2rem;
}

.progress-bar {
    background: #0f3460;
    border-radius: 8px;
    height: 24px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-text {
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
}

/* Upload Results */
.upload-result {
    margin-top: 2rem;
}

.result-success h3,
.result-error h3 {
    margin-top: 0;
}

.result-success {
    color: #4caf50;
}

.result-error {
    color: #ef5350;
}

.result-stats {
    background: rgba(102, 126, 234, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.result-stats h4 {
    margin-top: 0;
    color: #eee;
}

.result-stats ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.result-stats li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.result-stats li:last-child {
    border-bottom: none;
}

.result-stats span {
    color: #667eea;
    font-weight: 700;
}

/* Errors List */
.errors-list {
    margin-top: 1.5rem;
}

.errors-list h4 {
    color: #ef5350;
    margin-bottom: 1rem;
}

.errors-scroll {
    max-height: 300px;
    overflow-y: auto;
    background: rgba(239, 83, 80, 0.1);
    border-radius: 8px;
    padding: 1rem;
}

.error-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border-left: 3px solid #ef5350;
}

.error-item strong {
    color: #ef5350;
    display: block;
    margin-bottom: 0.25rem;
}

.error-item span {
    color: #eee;
    font-size: 0.9rem;
}

/* Final Round Styles */
.final-round-display {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.final-themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 900px;
    padding: 2rem;
}

.final-theme-card {
    background: linear-gradient(135deg, #ffa726 0%, #ff9800 100%);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s;
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.final-theme-card.active:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 152, 0, 0.4);
}

.final-theme-card.eliminated {
    background: linear-gradient(135deg, #666 0%, #555 100%);
    opacity: 0.5;
    text-decoration: line-through;
}

.eliminated-mark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    opacity: 0.8;
}

.final-selected-theme {
    text-align: center;
    padding: 3rem;
}

.final-selected-theme h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #ffa726;
}

.selected-theme-name {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    padding: 2rem;
    background: linear-gradient(135deg, #ffa726 0%, #ff9800 100%);
    border-radius: 16px;
    margin-bottom: 1rem;
}

.btn-warning {
    background: linear-gradient(135deg, #ffa726, #ff9800);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.2rem;
}

.final-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 167, 38, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 2px solid #ffa726;
}

.timer-label {
    font-size: 1rem;
    color: #ffa726;
    font-weight: 600;
}

.timer-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffa726;
    min-width: 60px;
    text-align: center;
}
