/* Basketball Scoreboard — Global Styles */

:root {
    --bg-dark: #0a0a14;
    --bg-card: #151525;
    --bg-card-hover: #1a1a35;
    --accent: #4CAF50;
    --accent-gold: #ffd700;
    --danger: #ff4444;
    --warning: #ff9800;
    --text: #ffffff;
    --text-muted: rgba(255,255,255,0.5);
    --border: rgba(255,255,255,0.08);
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px;
    font-size: 14px; font-weight: 600;
    border: none; border-radius: 8px;
    cursor: pointer; transition: all 0.2s;
    text-decoration: none; color: #fff;
    background: rgba(255,255,255,0.1);
}
.btn:hover { background: rgba(255,255,255,0.2); transform: translateY(-1px); }

.btn-primary { background: var(--accent); }
.btn-primary:hover { background: #45a049; }
.btn-success { background: #2e7d32; }
.btn-success:hover { background: #388e3c; }
.btn-warning { background: var(--warning); color: #000; }
.btn-warning:hover { background: #ffa726; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #e53935; }
.btn-secondary { background: rgba(255,255,255,0.08); }
.btn-secondary:hover { background: rgba(255,255,255,0.15); }

.btn-lg { padding: 14px 32px; font-size: 18px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 4px; }

/* ==========================================
   ADMIN PAGE
   ========================================== */
.admin-page { padding: 40px 20px; }

.admin-container {
    max-width: 1000px; margin: 0 auto;
}

.admin-header {
    text-align: center; margin-bottom: 40px;
}
.admin-header h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 36px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 4px;
}
.admin-header .subtitle {
    font-size: 14px; color: var(--text-muted);
    margin-top: 4px;
}

.admin-section {
    margin-bottom: 40px;
}
.admin-section h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 22px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 2px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.form-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}
.form-row {
    display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end;
}
.form-group {
    display: flex; flex-direction: column; gap: 6px;
    min-width: 140px; flex: 1;
}
.form-group label {
    font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted);
}
.form-group input, .form-group select {
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #fff; font-size: 14px;
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent);
}
.form-group input[type="color"] {
    padding: 4px; height: 42px; cursor: pointer;
}
.form-group input[type="file"] {
    font-size: 12px;
}
.form-actions { justify-content: flex-end; }

.info-text {
    color: var(--text-muted); font-style: italic;
    padding: 20px; text-align: center;
}

/* Team Grid */
.team-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.team-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex; align-items: center; justify-content: space-between;
}
.team-card-header {
    display: flex; align-items: center; gap: 12px;
}
.team-logo-small {
    width: 36px; height: 36px; object-fit: contain;
}
.team-short {
    display: block; font-size: 12px; color: var(--text-muted);
}

.inline-form { display: inline; }

/* Game List */
.game-list {
    display: flex; flex-direction: column; gap: 12px;
}
.game-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 24px;
}
.game-card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.game-card-header h3 { font-size: 16px; font-weight: 600; }
.game-status {
    font-size: 11px; text-transform: uppercase;
    padding: 3px 10px; border-radius: 12px; font-weight: 600;
}
.status-pending { background: rgba(255,152,0,0.2); color: var(--warning); }
.status-live { background: rgba(76,175,80,0.2); color: var(--accent); }
.status-completed { background: rgba(255,255,255,0.1); color: var(--text-muted); }

.game-teams {
    font-size: 14px; color: var(--text-muted); margin-bottom: 12px;
}
.game-teams .vs { margin: 0 8px; opacity: 0.5; }

.game-links {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}

/* ==========================================
   CONTROL PAGE
   ========================================== */
.control-page { padding: 20px; }

.control-container-wide {
    max-width: 1400px; margin: 0 auto;
    padding: 0 20px;
}
.control-header {
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 16px;
}
.control-header h1 { font-size: 18px; font-weight: 600; }
.back-link {
    color: var(--text-muted); text-decoration: none;
    font-size: 14px;
}

/* 3-column layout: Home | Clocks+Actions | Away */
.control-3col {
    display: flex; gap: 16px;
    align-items: flex-start;
}
.control-3col > .team-control {
    flex: 1; min-width: 0;
}
.center-controls {
    flex: 1.4; min-width: 0;
    display: flex; flex-direction: column; gap: 12px;
}
.clocks-row {
    display: flex; gap: 12px;
}
.center-actions {
    display: flex; justify-content: center; align-items: center; gap: 12px;
    flex-wrap: wrap;
}

/* Timer panels */
.control-timer-panel {
    text-align: center;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
}
.timer-panel-label {
    font-family: 'Oswald', sans-serif;
    font-size: 13px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.game-clock-panel {
    flex: 1;
}
.shot-clock-panel {
    width: 220px; min-width: 220px;
    border: 2px solid rgba(255,215,0,0.25);
    display: flex; flex-direction: column;
    align-items: center;
}
.shot-clock-panel .timer-panel-label {
    color: var(--accent-gold);
}
.timer-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 64px; font-weight: 700;
    letter-spacing: 4px;
    margin-bottom: 8px;
}
.shot-clock-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 56px; font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 16px;
    text-shadow: 0 0 16px rgba(255,215,0,0.3);
}
.timer-controls {
    display: flex; justify-content: center; gap: 12px;
    margin-bottom: 12px;
}
.period-display {
    font-size: 16px;
    display: flex; align-items: center; justify-content: center; gap: 12px;
}

/* Score Section */
.team-control {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}
.team-control-header {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-bottom: 12px;
}
.team-control-header h2 { font-size: 16px; font-weight: 600; }
.team-logo-control { width: 32px; height: 32px; object-fit: contain; }

.score-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 56px; font-weight: 700;
    margin-bottom: 12px;
}
.score-buttons {
    display: flex; justify-content: center; gap: 8px;
    margin-bottom: 16px;
}
.btn-score {
    padding: 12px 20px; font-size: 18px; font-weight: 700;
    background: var(--accent); border-radius: 8px;
}
.btn-score:hover { background: #45a049; }
.btn-minus { background: rgba(255,68,68,0.3); }
.btn-minus:hover { background: rgba(255,68,68,0.5); }

.stat-controls {
    display: flex; flex-direction: column; gap: 8px;
}
.stat-row {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 14px;
}

.btn-possession {
    margin-top: 8px;
    border: 2px solid var(--accent-gold);
    background: transparent;
    color: var(--accent-gold);
}
.btn-possession.active {
    background: var(--accent-gold);
    color: #000;
}

/* removed — actions now in center-actions */

/* Modals */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}
.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    min-width: 320px;
    max-width: 90vw;
    text-align: center;
}
.modal-box h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 20px; font-weight: 600;
    margin-bottom: 16px;
}
.modal-form {
    margin: 16px 0;
}
.modal-actions {
    display: flex; gap: 12px; justify-content: center;
    margin-top: 20px;
}

/* Mobile optimizations */
@media (max-width: 900px) {
    .control-3col { flex-direction: column; }
    .clocks-row { flex-direction: column; }
    .shot-clock-panel { width: 100%; min-width: unset; }
    .form-row { flex-direction: column; }
    .timer-display { font-size: 48px; }
    .shot-clock-value { font-size: 42px; }
    .score-value { font-size: 42px; }
}
