:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e293b;
    --light: #f8fafc;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    background: url('assets/bg.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

/* Dark overlay for better readability */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease-out;
}

/* Modern Glass Card */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.15);
}

/* Navigation Buttons - Glassmorphic */
.nav-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.glass-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.glass-btn.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: slideDown 0.5s ease;
}

.header h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, #fff, #e0e0e0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.header .live-badge {
    display: inline-block;
    background: rgba(239, 68, 68, 0.9);
    backdrop-filter: blur(5px);
    color: white;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

/* Black text for better visibility */
.black-text {
    color: #000000 !important;
}

.section-title {
    color: #000000;
    font-weight: 700;
    margin: 20px 0;
}

.refresh-indicator {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
    border-radius: 10px;
    font-size: 0.9rem;
    color: white;
}

.countdown-label {
    color: #000000;
    font-weight: 600;
    margin-right: 10px;
}

.last-update-text {
    color: #000000 !important;
    font-weight: 500;
}

/* Countdown Timer */
.countdown-timer {
    display: inline-block;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    color: #10b981;
    padding: 8px 16px;
    border-radius: 50px;
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    font-weight: bold;
    letter-spacing: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* House Color Schemes */
.house-kartini { background: linear-gradient(135deg, #ff6b6b, #ee5a24); }
.house-tolstoy { background: linear-gradient(135deg, #4ecdc4, #44bd9e); }
.house-tagore { background: linear-gradient(135deg, #f9ca24, #f0932b); }
.house-lincoln { background: linear-gradient(135deg, #7ed6df, #22a6b3); }

/* Score Table Modern */
.score-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.score-table th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.score-table th:first-child { border-radius: 15px 0 0 15px; }
.score-table th:last-child { border-radius: 0 15px 15px 0; }

.score-table td {
    background: white;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.score-table tr:hover td {
    transform: scale(1.01);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.score-table td:first-child { border-radius: 15px 0 0 15px; }
.score-table td:last-child { border-radius: 0 15px 15px 15px; }

.house-score {
    font-weight: bold;
    font-size: 1.3rem;
    position: relative;
    display: inline-block;
}

.score-update {
    animation: scorePop 0.5s ease-out;
}

/* Total Cards */
.total-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.total-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(5px);
}

.total-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.total-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.total-card .points {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Team Total Cards */
.team-total-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 20px;
}

.team-total-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.team-points {
    font-size: 3rem;
    font-weight: bold;
    margin: 15px 0;
}

/* Section Breakdown */
.section-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.breakdown-box {
    background: rgba(255,255,255,0.9);
    padding: 20px;
    border-radius: 15px;
}

/* Champion Card */
.grand-champion {
    background: linear-gradient(135deg, rgba(255,215,0,0.95), rgba(255,165,0,0.95));
    border: 2px solid gold;
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Manual Refresh Button */
.manual-refresh-btn {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
}

.manual-refresh-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Admin Dashboard */
.admin-dashboard {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
}

.sidebar {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    height: fit-content;
}

.game-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.game-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.game-btn.active {
    background: linear-gradient(135deg, #10b981, #059669);
    transform: scale(1.05);
}

/* Score Editor Modern */
.score-editor-modern {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
}

.house-score-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.house-score-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.house-score-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.score-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    min-width: 80px;
    background: #f8fafc;
    padding: 10px;
    border-radius: 10px;
}

.control-btn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn.minus {
    background: #ef4444;
    color: white;
}

.control-btn.minus:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.control-btn.plus {
    background: #10b981;
    color: white;
}

.control-btn.plus:hover {
    background: #059669;
    transform: scale(1.05);
}

.control-btn.set {
    background: #3b82f6;
    color: white;
    width: auto;
    padding: 0 15px;
}

.control-btn.set:hover {
    background: #2563eb;
}

.quick-input {
    width: 80px;
    text-align: center;
    padding: 8px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}

/* Reset Button */
.reset-all-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.reset-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(239,68,68,0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    text-align: center;
    animation: fadeInUp 0.3s ease-out;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
}

.modal-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.modal-btn.confirm {
    background: #ef4444;
    color: white;
}

.modal-btn.cancel {
    background: #64748b;
    color: white;
}

/* Status Bar */
.status-bar {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.status-toast {
    background: white;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid;
}

.status-toast.success { border-left-color: #10b981; }
.status-toast.error { border-left-color: #ef4444; }
.status-toast.warning { border-left-color: #f59e0b; }
.status-toast.info { border-left-color: #3b82f6; }

.status-toast.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

/* Live Badge Admin */
.live-badge-admin {
    display: inline-block;
    background: #10b981;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-left: 10px;
}

/* Game Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

/* Update Notification */
.update-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: bold;
    animation: slideInRight 0.3s ease-out;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes scorePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); color: #10b981; }
    100% { transform: scale(1); }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes highlight {
    0% { 
        background: #fef3c7; 
        transform: scale(1.05);
        color: #f59e0b;
    }
    100% { 
        background: transparent; 
        transform: scale(1);
        color: inherit;
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Score Changed Animation */
.score-changed {
    animation: highlight 0.5s ease-out;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .admin-dashboard {
        grid-template-columns: 250px 1fr;
        gap: 20px;
    }
    
    .house-score-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 10px;
    }
    
    .glass-card {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .glass-btn {
        padding: 8px 20px;
        font-size: 0.85rem;
    }
    
    .score-table th, .score-table td {
        padding: 8px;
        font-size: 0.8rem;
    }
    
    .admin-dashboard {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .section-breakdown {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .total-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .house-score-cards {
        grid-template-columns: 1fr;
    }
    
    .score-control {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .countdown-timer {
        font-size: 1rem;
        padding: 5px 10px;
    }
    
    .status-bar {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .modal-content {
        margin: 20px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .game-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .nav-buttons {
        gap: 10px;
    }
    
    .glass-btn {
        padding: 6px 15px;
        font-size: 0.75rem;
    }
    
    .score-value {
        font-size: 1.5rem;
        min-width: 60px;
    }
    
    .control-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #4f46e5, #5b3a8c);
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    body::before {
        display: none;
    }
    
    .glass-card {
        box-shadow: none;
        padding: 0;
    }
    
    .nav-buttons,
    .manual-refresh-btn,
    .refresh-indicator,
    .status-bar {
        display: none;
    }
    
    .score-table td {
        border: 1px solid #ddd;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.p-20 { padding: 20px; }
.cursor-pointer { cursor: pointer; }

/* Custom header colors for public pages */
.custom-header-kartini {
    background: #FFFF00 !important;
    color: #000000 !important;
}

.custom-header-tolstoy {
    background: #FF6666 !important;
    color: #000000 !important;
}

.custom-header-tagore {
    background: #66B2FF !important;
    color: #000000 !important;
}

.custom-header-lincoln {
    background: #00FFFF !important;
    color: #000000 !important;
}

/* Override default gradient headers */
.public-table th:nth-child(2) {
    background: #FFFF00 !important;
    color: #000000 !important;
}

.public-table th:nth-child(3) {
    background: #FF6666 !important;
    color: #000000 !important;
}

.public-table th:nth-child(4) {
    background: #66B2FF !important;
    color: #000000 !important;
}

.public-table th:nth-child(5) {
    background: #00FFFF !important;
    color: #000000 !important;
}