:root {
            --primary: #4CAF50;
            --secondary: #2196F3;
            --accent: #FF9800;
            --light: #f8f9fa;
            --dark: #212529;
            --success: #28a745;
            --danger: #dc3545;
            --warning: #ffc107;
            --info: #17a2b8;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        body {
            background-color: #f0f2f5;
            color: var(--dark);
        }
        
.app-container {
    max-width: 2000px;
    margin: 0 auto;
    padding: 20px;
    text-align: center; /* Add this to center everything */
}
        
header {
    text-align: center;
    padding: 20px 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* Remove sticky positioning */
    position: relative;
    top: 0;
    z-index: 100;
}
        
        .logo {
            font-size: 2.5rem;
            font-weight: bold;
            margin-bottom: 10px;
        }
        
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background: white;
    border-radius: 50px;
    padding: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* Remove sticky positioning */
    position: relative;
    top: 0;
    z-index: 99;
}
        
        .tab {
            padding: 12px 24px;
            cursor: pointer;
            border-radius: 50px;
            margin: 0 5px;
            transition: all 0.3s ease;
            font-weight: 600;
        }
        
        .tab.active {
            background: var(--primary);
            color: white;
        }

        /* Mode Selection Styles */
        .mode-selection {
            display: flex;
            gap: 20px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }
        
        .mode-option {
            flex: 1;
            min-width: 200px;
            background: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
        }
        
        .mode-option:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
        }
        
        .mode-option.selected {
            border: 3px solid var(--primary);
            background-color: rgba(76, 175, 80, 0.1);
        }
        
        .mode-icon {
            font-size: 2.5rem;
            margin-bottom: 10px;
            color: var(--primary);
        }
        
        .mode-title {
            font-size: 1.2rem;
            font-weight: bold;
            margin-bottom: 10px;
        }
        
        .mode-description {
            font-size: 0.9rem;
            color: #6c757d;
        }
                
        .config-row {
            display: flex;
            gap: 20px;
            margin-bottom: 15px;
            flex-wrap: wrap;
        }
        
        .config-group {
            flex: 1;
            min-width: 200px;
        }

        /* Up Next Section Styles */
        .up-next-section {
            margin: 30px 0;
            background: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .up-next-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }

        .up-next-container {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 15px;
            margin-bottom: 15px;
        }

/* Enhanced Up Next Box Styling */
.up-next-box {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: all 0.3s ease;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.up-next-box.filled {
    border: 2px solid var(--primary);
    background: linear-gradient(135deg, #f8fff8, #f0fff4);
}

.up-next-box-header {
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
    text-align: center;
    font-size: 1.3rem;
    color: var(--dark);
}

.up-next-players {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.up-next-player {
    background: white;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.up-next-player:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-left-color: #007bff;
}

.up-next-player-info {
    flex: 1;
}

.up-next-player-name {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2c3e50;
}

.up-next-player-level {
    background: #17a2b8;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

.up-next-player-stats {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 5px;
}

.btn-aesthetic {
    padding: 14px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-aesthetic:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-aesthetic:active {
    transform: translateY(-1px);
}

.btn-aesthetic::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-aesthetic:hover::before {
    left: 100%;
}

        .up-next-add-player {
            position: absolute;
            top: 10px;
            right: 10px;
            background: var(--secondary);
            color: white;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }

.up-next-remove-player {
    background: var(--danger);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.up-next-remove-player:hover {
    transform: scale(1.1);
    background: #c82333;
}

.up-next-modal-controls {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
    align-items: end;
}

.up-next-player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Add to your CSS section */
.court-player-modal-item .waiting-time-display,
.up-next-player-item .waiting-time-display {
    padding: 3px 8px;
    background: #e7f3ff;
    border-radius: 10px;
    color: #007bff;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    font-weight: 600;
    border: 1px solid #b3d7ff;
}

.court-player-modal-item:hover .waiting-time-display,
.up-next-player-item:hover .waiting-time-display {
    background: #d0e7ff;
    border-color: #007bff;
}

/* Color coding for long waiting times */
.waiting-time-display.long-wait {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.waiting-time-display.very-long-wait {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.up-next-player-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.up-next-player-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: #e9ecef;
}

.up-next-player-item-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.up-next-player-item-level {
    display: inline-block;
    padding: 3px 10px;
    background: var(--info);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    margin: 5px 0;
}

.up-next-player-item-stats {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Partnership indicators for Up Next */
.up-next-partnership-indicator {
    font-size: 0.9rem;
    margin-left: 5px;
    cursor: help;
    position: relative;
}

.up-next-partnership-indicator:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: pre-line; /* This is key for respecting \n line breaks */
    word-wrap: break-word;
    word-break: break-word;
    z-index: 1000;
    pointer-events: none;
    max-width: min(350px, 90vw);
    width: max-content;
    text-align: left;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Add a small arrow to the tooltip */
.up-next-partnership-indicator:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.95);
    z-index: 1001;
    pointer-events: none;
}

.up-next-partnership-indicator.has-partnerships {
    color: #4CAF50; /* Green for partnerships */
}

.up-next-partnership-indicator.has-oppositions {
    color: #FF9800; /* Orange for oppositions */
}

.up-next-partnership-indicator.has-both {
    color: #2196F3; /* Blue for both */
}

        .waitlist-level {
            display: inline-block;
            padding: 3px 10px;
            background: var(--info);
            color: white;
            border-radius: 20px;
            font-size: 0.8rem;
            margin-left: 5px;
        }

        /* Team aesthetics */
        .team-player.court-player {
            cursor: grab;
            transition: all 0.3s ease;
        }

        .team-player.court-player:active {
            cursor: grabbing;
        }

        .team-player.court-player.dragging {
            opacity: 0.5;
            background-color: #e9ecef;
        }

        .tab-content {
            display: none;
            background: white;
            padding: 25px;
            border-radius: 10px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            margin-bottom: 20px;
            text-align: left; /* Reset text alignment for content */
        }
        
        .tab-content.active {
            display: block;
            animation: fadeIn 0.5s;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        
/* Fix for stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 5px;
    /* Remove sticky positioning */
    position: relative;
    top: 0;
    z-index: 1;
}
        
        .stat-card {
            background: white;
            padding: 20px;
            position: sticky;
            border-radius: 10px;
            text-align: center;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
            transition: transform 0.3s ease;
        }
        
        .stat-card:hover {
            transform: translateY(-5px);
        }
        
        .stat-value {
            font-size: 2rem;
            font-weight: bold;
            color: var(--primary);
            margin: 10px 0;
        }
        
        .stat-label {
            color: #6c757d;
            font-size: 0.9rem;
        }
        
        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 50px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s ease;
        }
        
        .btn-primary {
            background: var(--primary);
            color: white;
        }
        
        .btn-secondary {
            background: var(--secondary);
            color: white;
        }
        
        .btn-danger {
            background: var(--danger);
            color: white;
        }
        
        .btn-warning {
            background: var(--warning);
            color: var(--dark);
        }
        
        .btn-sm {
            padding: 5px 10px;
            font-size: 0.8rem;
        }
        
        .btn:hover {
            opacity: 0.9;
            transform: translateY(-2px);
        }
        
        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }
        
        .form-group {
            margin-bottom: 20px;
        }
        
        .form-control {
            width: 100%;
            padding: 12px;
            border: 1px solid #ced4da;
            border-radius: 5px;
            font-size: 1rem;
        }
        
        .player-list, .waitlist {
            margin-top: 20px;
        }

        /* Specifically fix any elements that might be floating left */
.player-list, .court-container, .up-next-section, .waitlist-grid {
    text-align: left;
}

/* Fix for any elements that might have position issues */
[style*="float: left"], [style*="text-align: left"] {
    text-align: center !important;
    float: none !important;
}
        
        .player-item, .waitlist-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px;
            background: white;
            border-radius: 8px;
            margin-bottom: 10px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
            transition: all 0.3s ease;
        }
        
        .player-item:hover, .waitlist-item:hover {
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            transform: translateY(-2px);
        }
        
        .player-info {
            flex: 1;
        }
        
        .player-name {
            font-weight: bold;
            font-size: 1.1rem;
        }
             
        .player-stats {
            font-size: 0.9rem;
            color: #6c757d;
            margin-top: 5px;
        }
        
        .player-actions {
            display: flex;
            gap: 10px;
        }
        
        .status-btn {
            padding: 5px 15px;
            border: none;
            border-radius: 20px;
            cursor: pointer;
            font-size: 0.8rem;
            font-weight: 600;
        }
        
        .status-present {
            background: var(--success);
            color: white;
        }
        
        .status-absent {
            background: var(--danger);
            color: white;
        }
        
        /* COURT CONTAINER CHANGES - 2 courts per column */
.court-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin-top: 25px;
    width: 100%;
}

/* Each row wrapper */
.court-row {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 25px;
    gap: 25px;
}

/* Single court in a row - centered */
.court-row:has(.court-card:only-child) {
    justify-content: center;
}

/* Two courts in a row - centered with equal spacing */
.court-row:has(.court-card:nth-child(2):last-child) {
    justify-content: center;
}

/* Standard 3 courts per row - evenly spaced */
.court-row:has(.court-card:nth-child(3):last-child) .court-card {
    flex: 0 0 calc(33.333% - 17px); /* 3 cards with gap accounted for */
}

/* Responsive adjustments for bigger courts */
@media (max-width: 1200px) {
    .court-container{
        grid-template-columns: repeat(auto-fit, minmax(550px, 1fr));
    }
}

/* Clear button styles for Up Next boxes */
.up-next-clear-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.up-next-clear-btn:hover {
    transform: scale(1.1);
    background: #c82333;
}

/* Draggable player styles */
.up-next-player {
    cursor: grab;
    transition: all 0.3s ease;
    user-select: none;
}

.up-next-player:active {
    cursor: grabbing;
}

.up-next-player.dragging {
    opacity: 0.5;
    background-color: #e9ecef;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.up-next-players.drag-over {
    background: rgba(76, 175, 80, 0.1);
    border: 2px dashed var(--primary);
    border-radius: 8px;
}
        
/* Court header enhancements - Bigger */
.court-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 3px solid #e9ecef;
    text-align: center;
}
        
        .court-title {
            font-weight: bold;
            font-size: 1.4rem;
            color: var(--dark);
        }

.court-title h3 {
    font-weight: bold;
    font-size: 1.8rem;
    color: var(--dark);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.court-title h3::before {
    content: "🏟️";
    font-size: 1.6rem;
}
        
/* Status badge enhancements */
.court-status {
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 700;
    display: inline-block;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
        
.status-available {
    background: linear-gradient(135deg, var(--success), #34d399);
    color: white;
}

.status-ongoing {
    background: linear-gradient(135deg, var(--accent), #fd7e14);
    color: white;
    animation: pulse 2s infinite;
}
        
        .court-players {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-bottom: 15px;
        }
        
        .court-player {
            background: var(--light);
            padding: 18px;
            border-radius: 10px;
            text-align: center;
            position: relative;
            transition: all 0.3s ease;
            padding-right: 30px; /* Added to prevent text overlap with X button */
        }
        
        .court-player:active {
            cursor: grabbing;
        }
        
        .court-player.dragging {
            opacity: 0.5;
            background-color: #e9ecef;
        }
        
        /* BIGGER FONT FOR PLAYER NAMES IN COURTS */
        .court-player .player-name {
            font-size: 1.3rem;
            font-weight: bold;
            margin-bottom: 8px;
            word-break: break-word;
        }

        .court-player .player-stats {
            font-size: 0.95rem;
            color: #6c757d;
            margin-top: 5px;
        }

        .court-player .player-level {
            display: inline-block;
            padding: 4px 12px;
            background: var(--info);
            color: white;
            border-radius: 10px;
            font-size: 1rem;
            font-weight: 600;
            margin: 6px 0 8px 0;
            text-align: left;
        }

        .player-level, .team-player-level {
    display: inline-block;
    padding: 6px 14px;
    background: var(--info);
    color: white;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 700;
    margin-left: 10px;
    margin-top: 0;
    text-align: left;
    vertical-align: middle;
        }
        
.court-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.court-actions .btn {
    padding: 14px 28px;
    font-size: 1.1rem;
    border-radius: 10px;
    flex: 1;
    min-width: 140px;
    text-align: center;
}
        
        .current-time {
            font-size: 7rem;
            font-weight: bold;
            color: var(--primary);
        }
        
        .current-date {
            font-size: 1.2rem;
            color: #6c757d;
        }
        
        .stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.9rem;
}

.stats-table th, .stats-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.stats-table th {
    background: var(--light);
    font-weight: 600;
    white-space: nowrap;
}

.stats-table tr:hover {
    background: #f8f9fa;
}

/* Make tables responsive */
@media (max-width: 768px) {
    .stats-table {
        display: block;
        overflow-x: auto;
    }
    
    .stats-table th, .stats-table td {
        padding: 8px 5px;
        font-size: 0.8rem;
    }

        .waitlist-item {
        padding: 15px;
    }
    
    .waitlist-player-name {
        font-size: 1.2rem;
    }
    
    .add-to-court-btn {
        padding: 10px 16px;
        font-size: 0.95rem;
    }

        [id^="court-"].btn-primary {
        padding: 14px 20px;
        font-size: 1.1rem;
    }

        .up-next-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-aesthetic {
        width: 100%;
        justify-content: center;
    }
    
    .up-next-modal-controls {
        grid-template-columns: 1fr;
    }
    
    .up-next-player-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
        
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }
        
        .modal-content {
            background: white;
            padding: 25px;
            border-radius: 10px;
            width: 90%;
            max-width: 500px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        }
        
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid #e9ecef;
        }
        
        .modal-title {
            font-weight: bold;
            font-size: 1.5rem;
        }
        
        .close {
            font-size: 1.5rem;
            cursor: pointer;
        }
        
        .welcome-hero {
            text-align: center;
            padding: 40px 0;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: white;
            border-radius: 10px;
            margin-bottom: 30px;
        }
        
        .welcome-title {
            font-size: 2.5rem;
            margin-bottom: 15px;
            transition: all 0.3s ease;
        }
        
        .welcome-subtitle {
            font-size: 1.2rem;
            opacity: 0.9;
            margin-bottom: 25px;
        }
        
        .organization-input {
            max-width: 500px;
            margin: 0 auto 30px;
        }
        
        .level-disparity-warning {
            background-color: #fff3cd;
            color: #856404;
            padding: 10px;
            border-radius: 5px;
            margin-top: 10px;
            display: none;
        }
        
.partnership-indicator {
    font-size: 0.9rem;
    margin-left: 5px;
    cursor: help;
    position: relative;
}

.partnership-indicator:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: pre-line; /* This is key for respecting \n line breaks */
    word-wrap: break-word;
    word-break: break-word;
    z-index: 1000;
    pointer-events: none;
    max-width: 350px;
    width: max-content;
    text-align: left;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Add a small arrow to the tooltip */
.partnership-indicator:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.95);
    z-index: 1001;
    pointer-events: none;
}

/* Ensure tooltip doesn't go off screen */
.partnership-indicator:hover::after {
    max-width: min(350px, 90vw);
}

.partnership-indicator.has-partnerships {
    color: #4CAF50; /* Green for partnerships */
}

.partnership-indicator.has-oppositions {
    color: #FF9800; /* Orange for oppositions */
}

.partnership-indicator.has-both {
    color: #2196F3; /* Blue for both */
}

/* Remove the old multi-line tooltip rule since we're using pre now */
.partnership-indicator[data-tooltip*="<br>"]:hover::after {
    white-space: normal;
    width: 200px;
    text-align: left;
}

.up-next-court-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
    min-height: 50px;
    width: 100%;
}

/* Better text wrapping for buttons */
.up-next-court-actions .add-up-next-players .btn-text {
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.2;
}

.up-next-court-actions .add-up-next-players {
    flex: 1 1 calc(33.333% - 10px);
    min-width: 180px;
    max-width: 220px;
    margin: 2px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
    padding: 12px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}

.add-up-next-players {
    padding: 16px 28px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
    min-width: 220px;
    justify-content: center;
}

.add-up-next-players:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.add-up-next-players:active:not(:disabled) {
    transform: translateY(-1px);
}
    
.add-up-next-players::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.add-up-next-players:hover::before {
    left: 100%;
}

.add-up-next-players:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.up-next-court-actions .btn {
    position: relative;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    overflow: hidden;
}

.up-next-court-actions .btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.up-next-court-actions .btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.up-next-court-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.up-next-court-actions .btn .btn-text {
    flex: 1;
    margin: 0 10px;
}

.up-next-court-actions .btn .player-count-badge {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.up-next-court-actions .btn .button-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.up-next-court-actions .btn .button-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.up-next-court-actions .btn:hover .button-tooltip {
    display: block;
}

/* Pulse animation for available Up Next buttons */
@keyframes pulse-glow {
    0% {
        box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(76, 175, 80, 0.6);
    }
    100% {
        box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    }
}

.pulse-animation {
    animation: pulse-glow 2s infinite;
}

/* No Up Next games message */
.no-up-next-message {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.no-up-next-message i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: block;
    color: #adb5bd;
}

/* Enhanced main Up Next section buttons */
.up-next-actions .btn-aesthetic {
    position: relative;
    padding: 16px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    justify-content: center;
}

.up-next-actions .btn-aesthetic:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.up-next-actions .btn-aesthetic:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Live update indicator */
.live-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    margin-left: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(40, 167, 69, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .up-next-court-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .up-next-court-actions .btn {
        width: 100%;
        max-width: 250px;
    }

        .up-next-court-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .add-up-next-players {
        width: 100%;
        max-width: 300px;
    }

    .up-next-court-actions .add-up-next-players {
        flex: 1 1 calc(50% - 8px);
        min-width: 150px;
        max-width: 180px;
        font-size: 0.9rem;
        padding: 10px 6px;
    }
    
    .add-up-next-players .btn-text {
        font-size: 0.9rem;
    }
}
        
        .previous-partners {
            font-size: 0.7rem;
            color: var(--info);
            margin-top: 3px;
            font-style: italic;
        }
        
        .waitlist-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 30px 0 15px 0;
        }
        
        .waitlist-controls {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .winner-option.disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        .waitlist-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 15px;
        }
        
.waitlist-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid #e9ecef;
}
        
.waitlist-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.waitlist-player-name {
    font-weight: bold;
    font-size: 1.4rem;
    color: var(--dark);
    margin-bottom: 5px;
}

.waitlist-level {
    display: inline-block;
    padding: 6px 14px;
    background: var(--info);
    color: white;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

.waitlist-player-details {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 8px;
}

/* Make the select dropdown also full width */
.waitlist-item select.form-control {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ced4da;
    background: white;
    font-size: 0.9rem;
}

.waitlist-item select.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    outline: none;
}
        
        .winner-selection {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin: 20px 0;
        }
        
        .winner-option {
            padding: 20px;
            background: var(--light);
            border-radius: 8px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        
        .winner-option:hover {
            background: #e9ecef;
        }
        
        .winner-option.selected {
            background: var(--success);
            color: white;
        }
        
        .score-input {
            display: flex;
            gap: 10px;
            justify-content: center;
            margin: 15px 0;
        }
        
        .score-input input {
            width: 60px;
            text-align: center;
            padding: 8px;
            border: 1px solid #ced4da;
            border-radius: 5px;
        }
        
        .score-input span {
            padding: 8px;
            font-weight: bold;
        }
        
        /* New styles for searchable dropdown */
        .court-player-select-container {
            position: relative;
        }
        
        .court-player-select-container input {
            width: 100%;
            padding: 12px;
            border: 1px solid #ced4da;
            border-radius: 5px;
            font-size: 1rem;
            padding-right: 35px;
        }
        
        .court-player-select-container i {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            color: #6c757d;
        }
        
        .court-player-select-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            border: 1px solid #ced4da;
            border-top: none;
            max-height: 200px;
            overflow-y: auto;
            z-index: 100;
            display: none;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            border-radius: 0 0 5px 5px;
        }
        
        .court-player-select-option {
            padding: 12px 15px;
            cursor: pointer;
            border-bottom: 1px solid #f0f0f0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: background-color 0.2s;
        }
        
        .court-player-select-option:hover {
            background-color: #f0f2f5;
        }
        
        .court-player-select-option:last-child {
            border-bottom: none;
        }
        
        .court-player-select-option.highlighted {
            background-color: #e9ecef;
        }
        
        .player-level-small {
            font-size: 0.8rem;
            background: var(--info);
            color: white;
            padding: 2px 8px;
            border-radius: 10px;
        }
        
        .player-stats-small {
            font-size: 0.75rem;
            color: #6c757d;
            margin-top: 3px;
        }
        
        .player-info-small {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
        }

        /* Partner identification styles */
        .court-teams {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-bottom: 15px;
        }
        
        .court-team {
            background: var(--light);
            padding: 15px;
            border-radius: 8px;
            position: relative;
        }
        
        .team-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
            padding-bottom: 8px;
            border-bottom: 1px dashed #ccc;
        }
        
        .team-name {
            font-weight: bold;
            font-size: 0.9rem;
            color: var(--secondary);
        }
        
        .team-players {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        
        .team-player {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px;
            background: white;
            border-radius: 5px;
        }
        
        .team-player-info {
            align-items: flex-start; /* aligns content left */
            text-align: left;       /* left-aligns text */
        }
        
        /* Team player details */
.team-player-name {
    font-weight: bold;
    font-size: 1.6rem;
}       

.team-player-stats {
    font-size: 1.1rem;
    color: #6c757d;
    margin-top: 6px;
}

        /* Timer fix - ensure it updates live */
        .court-status[id^="court-"][id$="-timer"] {
    font-size: 1.1rem;
    padding: 10px 18px;
}

        @media (min-width: 768px) {
            .court-header {
                flex-direction: row;
                justify-content: space-between;
                align-items: center;
            }
        }

        @media (max-width: 1000px) {
            .court-container {
                grid-template-columns: 1fr;
            }
            
            .court-title {
                font-size: 1.3rem;
            }
            
            .court-player .player-name {
                font-size: 1.2rem;
            }

            .up-next-container {
                grid-template-columns: repeat(2, 1fr);
            }
            

                .up-next-court-actions .add-up-next-players {
        flex: 1 1 calc(50% - 10px);
        min-width: 160px;
        max-width: 200px;
    }
        }

@media (max-width: 1000px) {
    .court-container {
        grid-template-columns: 1fr;
        max-width: 700px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .court-card {
        max-width: 100%;
        padding: 25px;
    }
}

@media (max-width: 768px) {
    .court-container{
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .court-card {
        padding: 20px;
        min-height: 400px;
    }
    
    .court-title h3 {
        font-size: 1.5rem;
    }
    
    .court-actions {
        flex-direction: column;
    }
    
    .court-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .court-card {
        padding: 15px;
        min-height: 380px;
    }
    
    .court-header {
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .court-title h3 {
        font-size: 1.3rem;
    }

        [id^="court-"].btn-primary {
        padding: 12px 16px;
        font-size: 1rem;
    }

    .up-next-court-actions .add-up-next-players {
        flex: 1 1 100%;
        min-width: 100%;
        max-width: 100%;
        padding: 12px 10px;
    }
}

/* Enhanced button content layout */
.add-up-next-players > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
}

.add-up-next-players i {
    flex-shrink: 0;
    font-size: 1rem;
}

.add-up-next-players .btn-text {
    flex: 1;
    margin: 0 8px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
    font-size: 0.95rem;
}

.add-up-next-players .player-count-badge {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

/* Ensure button content is properly centered */
.add-up-next-players {
    position: relative;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    overflow: hidden;
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
}

        @media (max-width: 768px) {
            .tabs {
                flex-wrap: wrap;
            }
            
            .tab {
                margin-bottom: 5px;
            }
            
            .court-container {
                grid-template-columns: 1fr;
            }
            
            .stats-grid {
                grid-template-columns: 1fr 1fr;
            }
            
            .current-time {
                font-size: 2rem;
            }
            
            .waitlist-grid {
                grid-template-columns: 1fr 1fr;
            }
            
            .winner-selection {
                grid-template-columns: 1fr;
            }
            
            .waitlist-header {
                flex-direction: column;
                gap: 15px;
                align-items: flex-start;
            }
            
            .waitlist-controls {
                width: 100%;
                flex-direction: column;
            }
            
            .court-teams {
                grid-template-columns: 1fr;
            }

            .up-next-container {
                grid-template-columns: 1fr;
            }
            

        }

/* Special handling for odd number of courts */
.court-container:has(.court-card:nth-child(odd):last-child) {
    display: flex;
    flex-wrap: wrap;
}

/* Center single court */
.court-container:has(.court-card:only-child) {
    display: flex;
    justify-content: center;
}

/* Special layout for 3 courts - creates a nice balanced look */
.court-container:has(.court-card:nth-child(3):last-child) {
    grid-template-columns: repeat(2, 1fr);
}

.court-container:has(.court-card:nth-child(3):last-child) .court-card:last-child {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 550px;
}

/* Special layout for 5 courts */
.court-container:has(.court-card:nth-child(5):last-child) {
    grid-template-columns: repeat(3, 1fr);
}

.court-container:has(.court-card:nth-child(5):last-child) .court-card:last-child {
    grid-column: 2 / 3;
    justify-self: center;
}
            
/* Individual court card */
.court-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    width: 100%;
    max-width: 600px;
    min-height: 450px;
    display: flex;
    flex-direction: column;
    flex: 0 0 calc(33.333% - 17px); /* Default for 3 per row */
}

/* For single court - make it larger but still centered */
.court-row:has(.court-card:only-child) .court-card {
    flex: 0 0 calc(50% - 25px); /* Single court takes 50% width */
    max-width: 700px;
}

/* For two courts - adjust sizing */
.court-row:has(.court-card:nth-child(2):last-child) .court-card {
    flex: 0 0 calc(45% - 25px); /* Two courts take 45% each */
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .court-card {
        flex: 0 0 calc(33.333% - 17px);
        max-width: 550px;
    }
}

.court-card.ongoing {
    background: linear-gradient(135deg, #fff5f5, #fff0f0);
    border-left: 6px solid var(--danger);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% { box-shadow: 0 6px 20px rgba(220, 53, 69, 0.1); }
    50% { box-shadow: 0 6px 25px rgba(220, 53, 69, 0.2); }
    100% { box-shadow: 0 6px 20px rgba(220, 53, 69, 0.1); }
}

.court-card.available {
    background: linear-gradient(135deg, #f0fff4, #f8fff8);
    border-left: 6px solid var(--success);
}
        
.court-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

        .court-team {
            background: var(--light);
            padding: 15px;
            border-radius: 8px;
            position: relative;
        }
        
        .team-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
            padding-bottom: 8px;
            border-bottom: 1px dashed #ccc;
        }
        
        .team-name {
            font-weight: bold;
            font-size: 0.9rem;
            color: var(--secondary);
        }
        
        .team-players {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        
        .team-player {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px;
            background: white;
            border-radius: 5px;
        }
        
        .team-player-info {
            align-items: flex-start;
            text-align: left;
        }
        
        
        .up-next-court-actions {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            justify-content: center;
            margin: 15px 0;
        }
        
        .team-name-editable {
            border: 1px dashed transparent;
            padding: 2px 5px;
            border-radius: 4px;
            min-width: 100px;
            display: inline-block;
        }
        
        .team-name-editable:focus {
            border-color: #2196F3;
            outline: none;
            background-color: #f8f9fa;
        }


.add-tournament-team {
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    font-weight: 500;
}

.add-tournament-team:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #0056b3, #004085);
}

.add-tournament-team:disabled {
    opacity: 0.5;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
    background: #6c757d;
}


#tournament-court-${court.id}-up-next-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 50px;
}

.match-status.ongoing {
    color: #856404;
    font-weight: bold;
    background-color: #fff3cd;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.match-status.cancelled {
    color: #721c24;
    font-weight: bold;
    background-color: #f8d7da;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.match-status.scheduled {
    color: #ffc107;
    font-weight: bold;
}

.match-status.completed {
    color: #28a745;
    font-weight: bold;
    background-color: #d4edda;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.round-section {
    margin-bottom: 25px;
}

.round-header {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2196F3;
}

.match-status {
    font-size: 0.8rem;
    margin-top: 5px;
    font-style: italic;
}

.assigned-to-court {
    color: #2196F3;
    font-weight: bold;
}

.match-completed {
    background-color: #f8f9fa !important;
    border-left: 4px solid #28a745 !important;
    opacity: 0.8;
}

.match-completed .team.winner {
    background-color: #d4edda !important;
    font-weight: bold;
}

.match-completed .team.winner::after {
    content: " ✓";
    color: #28a745;
}

.match-completed .team.loser {
    background-color: #f8d7da !important;
    opacity: 0.7;
}

.match-in-progress {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107 !important;
}

.match-cancelled {
    background-color: #f8d7da !important;
    border-left: 4px solid #dc3545 !important;
    opacity: 0.6;
}

.team-status {
    font-size: 0.8rem;
    margin-top: 5px;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

.status-completed {
    background-color: #28a745;
    color: white;
}

.status-eliminated {
    background-color: #dc3545;
    color: white;
}

.status-active {
    background-color: #17a2b8;
    color: white;
}

.team-already-played {
    opacity: 0.6;
    background-color: #fff3cd !important;
    border: 2px dashed #ffc107;
}

.warning-message {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 0.8rem;
}

.team.winner {
    background-color: #d4edda !important;
    font-weight: bold;
    border: 2px solid #28a745;
}

.team.loser {
    background-color: #f8d7da;
    opacity: 0.7;
}

.match-result {
    font-weight: bold;
    margin-top: 10px;
    padding: 8px;
    border-radius: 5px;
    background: #e9ecef;
    text-align: center;
}

.winner-badge {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 8px;
    font-weight: bold;
}

.forfeit-badge {
    display: inline-block;
    background: #ffc107;
    color: #212529;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 8px;
    font-weight: bold;
}

.schedule-team-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.schedule-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.schedule-btn:hover:not(:disabled) {
    background-color: #3d8b40;
}

.schedule-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.schedule-btn.assigned {
    background-color: #ffc107;
    color: #212529;
}

.schedule-btn.completed {
    background-color: #28a745;
    color: white;
}

/* Court selection modal styles */
.court-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.court-option {
    text-align: center;
}

.court-select-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
}

.court-assignment {
    font-weight: bold;
    margin-top: 8px;
    padding: 5px 10px;
    background-color: #e7f3ff;
    border-radius: 4px;
    display: inline-block;
}

.assigned-to-court {
    background-color: #d4edda;
    color: #155724;
}

header {
    text-align: center;
    padding: 20px 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background: white;
    border-radius: 50px;
    padding: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 120px; /* Adjust based on header height */
    z-index: 999;
}

/* Fix for time display */
.time-display {
    text-align: center;
    margin: 20px 0 -10px 0;
    background: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    /* Remove sticky positioning */
    position: relative;
    top: 0;
    z-index: 97;
}

/* Add Unfamiliar Players Button Styles */
.btn-unfamiliar {
    background: linear-gradient(135deg, #9C27B0, #E91E63);
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-unfamiliar:hover {
    background: linear-gradient(135deg, #7B1FA2, #C2185B);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.3);
}

.btn-unfamiliar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-unfamiliar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-unfamiliar:hover::after {
    left: 100%;
}

.unfamiliar-players-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    border-left: 4px solid #9C27B0;
}

.unfamiliar-players-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.unfamiliar-stat {
    text-align: center;
    padding: 8px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.unfamiliar-stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #9C27B0;
}

.unfamiliar-stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 5px;
}

.player-games-indicator {
    display: inline-block;
    padding: 2px 6px;
    background: #e9ecef;
    border-radius: 10px;
    font-size: 0.7rem;
    margin-left: 5px;
    color: #6c757d;
}

.player-games-indicator.low-games {
    background: #d4edda;
    color: #155724;
}

.player-games-indicator.high-games {
    background: #f8d7da;
    color: #721c24;
}

/* Add Player Success Animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Enhanced Modal Styles for Better UX */
#add-player-modal .modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Focus styles for better accessibility */
#player-name:focus,
#player-level:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    outline: none;
}

/* Quick-add shortcut hint */
.quick-add-hint {
    font-size: 0.8rem;
    color: #6c757d;
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

/* Enhanced styles for quick-add modal */
.modal-content.quick-add-active {
    border: 2px solid #4CAF50;
}

#player-name:placeholder-shown {
    border-color: #ced4da;
}

#player-name:not(:placeholder-shown) {
    border-color: #4CAF50;
}

/* Quick-add status indicator */
.quick-add-status {
    text-align: center;
    margin: 10px 0;
    padding: 8px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.quick-add-status.ready {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.quick-add-status.duplicate {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Court Player Selection Modal Styles */
.court-player-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.court-player-modal-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.court-player-modal-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: #e9ecef;
}

.court-player-modal-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.court-player-modal-level {
    display: inline-block;
    padding: 3px 10px;
    background: var(--info);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    margin: 5px 0;
}

.court-player-modal-stats {
    font-size: 0.8rem;
    color: #6c757d;
}

.court-player-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.court-player-modal-search {
    width: 300px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 0.9rem;
}

.court-player-modal-sort {
    width: 200px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 0.9rem;
}

.court-player-modal-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.court-player-modal-empty {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
    grid-column: 1 / -1;
}

/* Enhanced clickable player name */
.waitlist-player-name.clickable-player {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 12px;
    border-radius: 8px;
    margin: -12px -12px 0 -12px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid transparent;
}

.waitlist-player-name.clickable-player:hover {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
}

.waitlist-player-name.clickable-player:active {
    background: linear-gradient(135deg, #dee2e6, #ced4da);
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(76, 175, 80, 0.2);
}

.add-to-court-btn {
    transition: all 0.3s ease;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    width: 100%;
    margin-top: 12px;
    background: linear-gradient(135deg, var(--primary), #3d8b40);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
    position: relative;
    overflow: hidden;
}

.add-to-court-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    background: linear-gradient(135deg, #3d8b40, var(--primary));
}

.add-to-court-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.add-to-court-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.add-to-court-btn:hover::before {
    left: 100%;
}

[id^="court-"].btn-primary {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #3d8b40);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.25);
    transition: all 0.3s ease;
    margin-top: 15px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

[id^="court-"].btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
    background: linear-gradient(135deg, #3d8b40, #2e7d32);
}

[id^="court-"].btn-primary:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
}

[id^="court-"].btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background: linear-gradient(135deg, #6c757d, #5a6268);
}

[id^="court-"].btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

[id^="court-"].btn-primary:hover:not(:disabled)::before {
    left: 100%;
}

/* Court card adjustments to accommodate larger button */
.court-card .form-group {
    margin-top: 20px;
    margin-bottom: 0;
}

.court-card .form-group .btn {
    margin-top: 15px;
}

/* Player count indicator styling */
.court-card .form-group div[style*="font-size: 0.8rem"] {
    text-align: center;
    margin-top: 8px;
    font-weight: 600;
    color: var(--dark);
    background: #f8f9fa;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* Fix for level description bar */
.level-description-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    margin: 15px 0 25px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    flex-wrap: wrap;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    /* Remove sticky positioning */
    position: relative;
    top: 0;
    z-index: 98;
}

.level-description-item {
    text-align: center;
    flex: 1;
    min-width: 150px;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.level-description-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.level-description-item:hover::before {
    left: 100%;
}

.level-description-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.level-description-item .level-range {
    font-weight: 700;
    font-size: 1.1em;
    display: block;
    margin-bottom: 6px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.level-description-item .level-label {
    font-size: 0.95em;
    opacity: 0.95;
    display: block;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    margin-bottom: 8px;
}

.level-description-item .level-player-count {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
    margin-top: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.level-description-item:hover .level-player-count {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

/* Different colors for each level range */
.level-description-item:nth-child(1) {
    border-left: 4px solid #4CAF50;
}

.level-description-item:nth-child(2) {
    border-left: 4px solid #2196F3;
}

.level-description-item:nth-child(3) {
    border-left: 4px solid #FF9800;
}

.level-description-item:nth-child(4) {
    border-left: 4px solid #9C27B0;
}

.level-description-item:nth-child(5) {
    border-left: 4px solid #F44336;
}

/* Players tab adjustments */
#players .level-description-bar {
    margin-top: 0px;
    /* REMOVE: */
    /* top: 120px; */
}

/* Courts tab adjustments */
#courts .level-description-bar {
    margin-top: 20px;
    /* REMOVE: */
    /* top: 120px; */
}

/* Make sure content scrolls properly under the sticky bar */
#players .player-list,
#courts .court-container {
    position: relative;
    /*z-index: 1;*/
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .level-description-item {
        min-width: 130px;
        padding: 8px 6px;
    }
}

@media (max-width: 1200px) {
    .court-row {
        justify-content: center;
    }
    
    .court-card {
        flex: 0 0 calc(50% - 25px) !important; /* 2 per row on medium screens */
        max-width: 550px;
    }
}


@media (max-width: 992px) {
    .level-description-bar {
        flex-wrap: wrap;
        padding: 10px 15px;
        gap: 8px;
    }
    .level-description-item {
        flex: 1 1 calc(50% - 8px);
        min-width: 140px;
        margin-bottom: 8px;
    }

    .level-description-item:last-child {
        flex: 1 1 100%;
    }

    .level-description-item:nth-child(5) {
        flex: 1 1 100%;
    }
}

@media (max-width: 768px) {
    .level-description-bar {
        top: 100px;
    }
    
    #players .level-description-bar,
    #courts .level-description-bar {
        top: 100px;
    }
}

@media (max-width: 576px) {
    .level-description-bar {
        position: relative;
        top: auto !important;
        margin: 10px 0;
    }
    
    .level-description-item {
        flex: 1 1 100%;
        min-width: 100%;
        margin-bottom: 8px;
    }
    
    .level-description-item:last-child {
        margin-bottom: 0;
    }
    
    .level-description-item:hover {
        transform: translateY(-2px);
    }
}

/* Level Filter Toggles for Courts */
.level-toggle.has-players {
    border-width: 3px;
    animation: borderGlow 3s infinite;
}

.level-toggle.has-players::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #28a745, #17a2b8, #FF9800, #fd7e14, #dc3545);
    opacity: 0.8;
}

.level-toggle.active.has-players {
    border-color: #28a745;
    background: linear-gradient(135deg, #f0fff4 0%, #e8f5e8 100%);
}

/* Level-specific colors */
.level-toggle[data-level="beginners"] {
    border-color: #28a745;
    color: #28a745;
}

.level-toggle[data-level="beginners"].active {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.level-toggle[data-level="novice"] {
    border-color: #17a2b8;
    color: #17a2b8;
}

.level-toggle[data-level="novice"].active {
    background: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.level-toggle[data-level="low-intermediate"] {
    border-color: #ffc107;
    color: #ffc107;
}

.level-toggle[data-level="low-intermediate"].active {
    background: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.level-toggle[data-level="high-intermediate"] {
    border-color: #fd7e14;
    color: #fd7e14;
}

.level-toggle[data-level="high-intermediate"].active {
    background: #fd7e14;
    border-color: #fd7e14;
    color: white;
}

.level-toggle[data-level="advanced"] {
    border-color: #dc3545;
    color: #dc3545;
}

.level-toggle[data-level="advanced"].active {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* Level toggle styling */
.level-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    border: 2px solid #e9ecef;
    min-width: 90px;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.level-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.level-toggle.active {
    border-color: #007bff;
    background: linear-gradient(135deg, #e7f3ff 0%, #f0f8ff 100%);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.level-toggle:not(.active) {
    opacity: 0.7;
    filter: grayscale(0.3);
}

.level-toggle:not(.active):hover {
    opacity: 0.9;
    filter: grayscale(0.1);
}

.level-toggle i {
    font-size: 1.4rem;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    position: relative;
    /*z-index: 2;*/
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.level-toggle.active i {
    color: #007bff !important;
    transform: scale(1.1);
}

.level-toggle span {
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    text-align: center;
    position: relative;
    /*z-index: 2;*/
}

.level-toggle:not(.active) .blocked-indicator {
    font-size: 0.7rem;
    color: #dc3545;
    margin-top: 3px;
    display: block;
}

.level-toggle.active .blocked-indicator {
    display: none !important; /* HIDES WHEN ACTIVE */
}

/* Level-specific colors for icons */
.level-toggle[data-level="beginners"] i {
    color: #28a745;
}

.level-toggle[data-level="novice"] i {
    color: #17a2b8;
}

.level-toggle[data-level="low-intermediate"] i {
    color: #FF9800;
}

.level-toggle[data-level="high-intermediate"] i {
    color: #fd7e14;
}

.level-toggle[data-level="advanced"] i {
    color: #dc3545;
}

/* Active state background colors */
.level-toggle.active[data-level="beginners"] {
    background: linear-gradient(135deg, #28a745 0%, #34d399 100%);
    color: white;
}

.level-toggle.active[data-level="novice"] {
    background: linear-gradient(135deg, #17a2b8 0%, #38bdf8 100%);
    color: white;
}

.level-toggle.active[data-level="low-intermediate"] {
    background: linear-gradient(135deg, #FF9800 0%, #fbbf24 100%);
    color: #212529;
}

.level-toggle.active[data-level="high-intermediate"] {
    background: linear-gradient(135deg, #fd7e14 0%, #fb923c 100%);
    color: white;
}

.level-toggle.active[data-level="advanced"] {
    background: linear-gradient(135deg, #dc3545 0%, #ef4444 100%);
    color: white;
}

/* Court level filters specific */
.court-level-filters {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Up Next level filters specific */
#up-next-level-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

/* Enhanced balance indicator for Up Next games */
.up-next-balance-indicator {
    margin: 8px 10px;
    padding: 10px;
    border-radius: 10px;
    font-size: 0.85rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
}

.balance-text {
    display: flex;
    align-items: center;
    gap: 5px;
}

.balance-details {
    font-size: 0.8rem;
    opacity: 0.9;
    padding: 2px 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.level-category-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 8px;
}

.level-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.9);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.level-category-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* Color coding for balance quality */
.up-next-balance-indicator[style*="background: #28a745"] .level-category-badge {
    background: rgba(255,255,255,0.95);
    color: #155724;
}

.up-next-balance-indicator[style*="background: #ffc107"] .level-category-badge {
    background: rgba(255,255,255,0.95);
    color: #856404;
}

.up-next-balance-indicator[style*="background: #dc3545"] .level-category-badge {
    background: rgba(255,255,255,0.95);
    color: #721c24;
}

/* For Up Next boxes that are filled */
.up-next-box.filled .up-next-balance-indicator {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Animation for moving players to Up Next */
@keyframes moveToUpNext {
    0% { transform: translateX(0) scale(1); opacity: 1; }
    50% { transform: translateX(20px) scale(0.95); opacity: 0.7; }
    100% { transform: translateX(100px) scale(0.9); opacity: 0; }
}

.player-moving {
    animation: moveToUpNext 0.5s ease-out forwards;
    pointer-events: none;
}

/* Court transition styles */
.court-transition {
    transition: all 0.3s ease;
}

.court-level-change-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 10px;
    margin: 10px 0;
    font-size: 0.9rem;
    animation: pulseWarning 2s infinite;
}

@keyframes pulseWarning {
    0% { background: #fff3cd; }
    50% { background: #ffeaa7; }
    100% { background: #fff3cd; }
}

/* Animation for shifting Up Next games */
@keyframes shiftRight {
    0% { transform: translateX(0); }
    100% { transform: translateX(20px); }
}

.shift-animation {
    animation: shiftRight 0.5s ease-out;
}

/* Visual feedback for moved players */
.player-moved {
    position: relative;
    overflow: hidden;
}

.player-moved::after {
    content: "→ Next Game 1";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    animation: fadeInOut 1.5s ease-out forwards;
    border-radius: 4px;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Up Next container shift indicator */
.up-next-box.shifted {
    position: relative;
}

.up-next-box.shifted::before {
    content: "→";
    position: absolute;
    left: -25px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1.2rem;
    font-weight: bold;
    animation: arrowPulse 1s ease-in-out;
}

@keyframes arrowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Dynamic Up Next System */
.up-next-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.up-next-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.up-next-header h2 {
    margin: 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
}

.up-next-count-badge {
    background: #007bff;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.up-next-expand-hint {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: normal;
    margin-left: 10px;
}

.up-next-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.up-next-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.up-next-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    min-height: 200px;
}

.up-next-box {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    position: relative;
    transition: all 0.3s ease;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.up-next-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.up-next-box.filled {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #f0f9f0 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.up-next-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.up-next-box-header .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.up-next-box-header .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.up-next-game-number {
    font-weight: 700;
    font-size: 1.3rem;
    color: #2c3e50;
}

.up-next-box .player-count-badge {
    background: #007bff;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.player-count-badge {
    animation: badgePulse 1.5s infinite;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.player-count-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(0,0,0,0.2);
}

@keyframes borderGlow {
    0%, 100% { border-color: #28a745; }
    25% { border-color: #17a2b8; }
    50% { border-color: #FF9800; }
    75% { border-color: #fd7e14; }
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.up-next-box .btn-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.up-next-box .btn-outline-danger {
    border: 1px solid #dc3545;
    color: #dc3545;
    background: transparent;
}

.up-next-box .btn-outline-danger:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.05);
}

.up-next-box .btn-outline-warning:hover {
    background: #ffc107;
    color: #212529;
    transform: scale(1.02);
}

.up-next-box .btn-outline-warning {
    border: 1px solid #ffc107;
    color: #856404;
    background: transparent;
}

.up-next-box .remove-up-next-box {
    padding: 2px 6px;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.up-next-box .remove-up-next-box:hover {
    opacity: 1;
    transform: scale(1.1);
}

.up-next-players {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 120px;
}

/* Player card styling */
.up-next-player {
    background: white;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    margin-bottom: 10px;
    border-left: 4px solid transparent;
}

/* Add More Box styling */
.up-next-add-more-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #adb5bd;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 280px;
}

.up-next-add-more-box:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #28a745;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.add-up-next-container-btn {
    padding: 16px 24px !important;
    font-size: 1.1rem !important;
    border-radius: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
}

.add-up-next-container-btn i {
    font-size: 2rem !important;
}

.add-up-next-container-btn:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3) !important;
}

.add-more-hint {
    margin-top: 15px;
    color: #6c757d;
    font-size: 0.9rem;
    text-align: center;
    font-style: italic;
    max-width: 200px;
    line-height: 1.4;
}

/* Empty state styling */
.up-next-box:empty {
    border: 2px dashed #dee2e6;
    background: #f8f9fa;
}

.up-next-box:empty::after {
    content: 'Empty Game Slot';
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    font-style: italic;
    font-size: 1.1rem;
}

.up-next-stats {
    display: flex;
    justify-content: space-around;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid #e9ecef;
}

.up-next-stat {
    text-align: center;
    flex: 1;
}

.up-next-stat-label {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 600;
}

.up-next-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
}

/* Row indicators */
.up-next-row[data-row="1"] .up-next-box {
    border-left: 4px solid #ffc107;
}

.up-next-row[data-row="2"] .up-next-box {
    border-left: 4px solid #fd7e14;
}

.up-next-row[data-row="3"] .up-next-box {
    border-left: 4px solid #dc3545;
}

/* Responsive design */
@media (max-width: 1200px) {
    .up-next-row {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .up-next-add-more-box {
        grid-column: span 1;
    }
}

@media (max-width: 900px) {
    .up-next-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .up-next-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .up-next-actions {
        justify-content: center;
    }
}

@media (max-width: 900px) {
    .court-card {
        flex: 0 0 calc(100% - 25px) !important; /* 1 per row on small screens */
        max-width: 650px;
        margin: 0 auto;
    }
    
    .court-row {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .court-card {
        padding: 20px;
        min-height: 400px;
    }
    
    .court-title h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .court-card {
        padding: 15px;
        min-height: 380px;
    }
    
    .court-title h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 600px) {
    .up-next-row {
        grid-template-columns: 1fr;
    }
    
    .up-next-actions {
        flex-direction: column;
    }
    
    .up-next-actions button {
        width: 100%;
    }
}

/* Enhanced Player List Styling */
.player-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    background: white;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #007bff;
}

.player-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.player-info {
    flex: 1;
    padding-right: 20px;
}

.player-name {
    font-weight: 700;
    font-size: 1.3rem;
    color: #2c3e50;
}

.player-level {
    display: inline-block;
    padding: 6px 14px;
    background: #17a2b8;
    color: white;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 700;
}

.player-stats {
    margin-top: 15px;
}

.player-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 150px;
}

.status-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.status-present {
    background: #28a745;
    color: white;
}

.status-present:hover {
    background: #218838;
    transform: translateY(-2px);
}

.status-absent {
    background: #6c757d;
    color: white;
}

.status-absent:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Sort info header */
.sort-info-header {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .player-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .player-actions {
        flex-direction: row;
        width: 100%;
        justify-content: flex-end;
    }
    
    .player-stats > div {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Level-specific colors for player cards */
.player-item[data-level-category="beginners"] {
    border-left-color: #28a745;
}

.player-item[data-level-category="novice"] {
    border-left-color: #17a2b8;
}

.player-item[data-level-category="low-intermediate"] {
    border-left-color: #ffc107;
}

.player-item[data-level-category="high-intermediate"] {
    border-left-color: #fd7e14;
}

.player-item[data-level-category="advanced"] {
    border-left-color: #dc3545;
}

/* Add animation for live updates */
@keyframes countUpdate {
    0% { transform: scale(1); background-color: inherit; }
    50% { transform: scale(1.15); background-color: rgba(255, 255, 255, 0.9); }
    100% { transform: scale(1); background-color: inherit; }
}

.level-player-count.updating {
    animation: countUpdate 0.5s ease-in-out;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Add to your existing CSS */
.waitlist-player-details .waiting-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #e7f3ff;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #007bff;
    margin-top: 4px;
}

.waitlist-player-details .waiting-time.long-wait {
    background: #fff3cd;
    color: #856404;
}

.waitlist-player-details .waiting-time.very-long-wait {
    background: #f8d7da;
    color: #721c24;
}

.court-balance-display {
    animation: fadeIn 0.5s ease-out;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.court-balance-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.modal-content {
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    position: relative;
    padding-right: 40px;
}

.modal-header .close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.2s;
}

.modal-header .close:hover {
    color: #dc3545;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.up-next-player-stats .waiting-time {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    color: #6c757d;
}

.team-player-stats .waiting-time {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 2px;
}

/* Enhanced balance indicator colors */
.balance-excellent { color: #28a745; }
.balance-good { color: #ffc107; }
.balance-fair { color: #fd7e14; }
.balance-poor { color: #dc3545; }

/* Add to your existing CSS */
#add-up-next-game-btn:not(:disabled) {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
    animation: pulse-glow 2s infinite;
}

#add-up-next-game-btn:disabled {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: rgba(255, 255, 255, 0.7);
    cursor: not-allowed;
    animation: none;
}

/* Add to your existing CSS */
#add-up-next-game-btn.enabled-state {
    background: linear-gradient(135deg, #4CAF50, #2E7D32) !important;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4) !important;
    animation: pulse-button 2s infinite !important;
}

@keyframes pulse-button {
    0% {
        box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(76, 175, 80, 0.8);
    }
    100% {
        box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
    }
}

#add-up-next-game-btn:disabled {
    background: linear-gradient(135deg, #6c757d, #5a6268) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    animation: none !important;
    cursor: not-allowed !important;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(76, 175, 80, 0.6);
    }
    100% {
        box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    }
}

/* Court player waiting time display - ENHANCED */
.court-player .waiting-time-display {
    padding: 4px 10px;
    background: #e7f3ff;
    border-radius: 12px;
    color: #007bff;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-weight: 600;
    border: 1px solid #b3d7ff;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: center;
}

.court-player .waiting-time-display:hover {
    background: #d0e7ff;
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

/* Color coding based on wait time */
.court-player .waiting-time-display.long-wait {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.court-player .waiting-time-display.long-wait:hover {
    background: #ffeaa7;
    border-color: #ffc107;
}

.court-player .waiting-time-display.very-long-wait {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.court-player .waiting-time-display.very-long-wait:hover {
    background: #f5c6cb;
    border-color: #dc3545;
}

/* Status indicators */
.court-player .waiting-time-display.playing-now {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.court-player .waiting-time-display.playing-now:hover {
    background: #c3e6cb;
    border-color: #28a745;
}

.court-player .waiting-time-display.in-court {
    background: #e2e3e5;
    color: #383d41;
    border-color: #d6d8db;
}

.court-player .waiting-time-display.in-court:hover {
    background: #d6d8db;
    border-color: #6c757d;
}

.court-player .waiting-time-display.in-queue {
    background: #cce5ff;
    color: #004085;
    border-color: #b8daff;
}

.court-player .waiting-time-display.in-queue:hover {
    background: #b8daff;
    border-color: #007bff;
}

.court-player .waiting-time-display i {
    font-size: 0.75rem;
}

/* Add pulse animation for long waits */
@keyframes pulseWarning {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.court-player .waiting-time-display.very-long-wait {
    animation: pulseWarning 2s infinite;
}

#login-screen {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 10000;
    }
    
    .login-container {
        background: white;
        padding: 40px;
        border-radius: 15px;
        box-shadow: 0 20px 60px rgba(0,0,0,0.3);
        text-align: center;
        width: 90%;
        max-width: 400px;
    }
    
    .login-logo {
        font-size: 2.5rem;
        font-weight: bold;
        color: #333;
        margin-bottom: 10px;
    }
    
    .login-subtitle {
        color: #666;
        margin-bottom: 30px;
        font-size: 1.1rem;
    }
    
    .login-form {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    .login-input-group {
        text-align: left;
    }
    
    .login-input-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        color: #495057;
    }
    
    .login-input {
        width: 100%;
        padding: 12px 15px;
        border: 2px solid #dee2e6;
        border-radius: 8px;
        font-size: 1rem;
        transition: all 0.3s ease;
    }
    
    .login-input:focus {
        border-color: #667eea;
        outline: none;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }
    
    .login-btn {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        padding: 14px;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .login-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 7px 14px rgba(0,0,0,0.1);
    }
    
    .login-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }
    
    .login-error {
        color: #dc3545;
        margin-top: 10px;
        font-size: 0.9rem;
        min-height: 20px;
    }
    
    .change-password-btn {
        background: transparent;
        border: none;
        color: #6c757d;
        font-size: 0.9rem;
        cursor: pointer;
        margin-top: 15px;
        padding: 5px;
    }
    
    .change-password-btn:hover {
        color: #495057;
        text-decoration: underline;
    }
    
    .password-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        display: none;
        justify-content: center;
        align-items: center;
        z-index: 10001;
    }
    
    .password-modal-content {
        background: white;
        padding: 30px;
        border-radius: 10px;
        width: 90%;
        max-width: 400px;
    }
    
    .password-modal h3 {
        margin-top: 0;
        margin-bottom: 20px;
        color: #333;
    }
    
    .password-modal-actions {
        display: flex;
        gap: 10px;
        margin-top: 20px;
    }
    
    .password-modal-actions button {
        flex: 1;
        padding: 10px;
        border-radius: 6px;
        border: none;
        cursor: pointer;
        font-weight: 600;
    }
    
    .btn-cancel {
        background: #f8f9fa;
        color: #6c757d;
    }
    
    .btn-cancel:hover {
        background: #e9ecef;
    }
    
    .btn-save {
        background: #28a745;
        color: white;
    }
    
    .btn-save:hover {
        background: #218838;
    }
    
    .login-info {
        font-size: 0.85rem;
        color: #6c757d;
        margin-top: 10px;
        font-style: italic;
    }

    .logout-container {
    position: absolute;
    top: 20px;
    right: 20px;
}

.btn-logout {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease !important;
}

.btn-logout:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-3px) !important;
    box-shadow: 
        0 6px 20px rgba(220, 53, 69, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.btn-logout:active {
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-logout:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn-logout.loading {
    background: linear-gradient(135deg, 
        rgba(220, 53, 69, 0.8) 0%, 
        rgba(200, 35, 51, 0.8) 100%) !important;
}

.btn-logout i {
    font-size: 1.1rem;
}

/* For mobile responsiveness */
@media (max-width: 768px) {
    .logout-container {
        position: static;
        margin-top: 15px;
        text-align: center;
    }
    
    .btn-logout {
        width: 100%;
        justify-content: center;
    }
}

.tv-window-container {
    position: fixed;
    top: 50px;
    left: 50px;
    width: 600px;
    height: 400px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    z-index: 10000;
    overflow: hidden;
    resize: both;
    min-width: 400px;
    min-height: 300px;
    border: 4px solid #007bff;
    cursor: move;
}

.tv-window-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    cursor: move;
    user-select: none;
}

.tv-window-title {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tv-window-title i {
    color: #ffd700;
    font-size: 1.3rem;
}

.tv-window-controls {
    display: flex;
    gap: 10px;
}

.tv-window-controls button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.tv-window-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.tv-window-content {
    padding: 25px;
    height: calc(100% - 70px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tv-court-display {
    text-align: center;
    width: 100%;
    max-width: 1200px;
}

.tv-court-number {
    font-size: 4rem;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 40px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.9;
        transform: scale(1.02);
    }
}

.tv-teams-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-top: 40px;
    width: 100%;
}

.tv-team {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.tv-team:hover {
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.tv-team-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 30px;
    color: #ffd700;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 3px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.tv-player-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.tv-player-item {
    font-size: 2.5rem;
    font-weight: bold;
    padding: 25px;
    background: rgba(0, 123, 255, 0.25);
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.tv-player-item:hover {
    background: rgba(0, 123, 255, 0.35);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

.tv-window-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* FULLSCREEN MODE - BIG AND CENTERED */
.tv-window-container.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    z-index: 20000 !important;
    background: linear-gradient(135deg, #0a0a1a 0%, #121230 100%);
    cursor: default !important;
    resize: none !important;
    min-width: auto !important;
    min-height: auto !important;
}

.tv-window-container.fullscreen .tv-window-content {
    height: calc(100vh - 70px);
    padding: 40px;
    justify-content: center;
    align-items: center;
}

.tv-window-container.fullscreen .tv-court-display {
    max-width: 1600px;
    margin: 0 auto;
}

.tv-window-container.fullscreen .tv-court-number {
    font-size: 8rem !important;
    margin-bottom: 60px;
    text-shadow: 0 0 50px rgba(255, 215, 0, 0.9);
}

.tv-window-container.fullscreen .tv-teams-container {
    gap: 80px;
    margin-top: 60px;
}

.tv-window-container.fullscreen .tv-team {
    padding: 60px;
    border-radius: 30px;
    border-width: 4px;
}

.tv-window-container.fullscreen .tv-team-title {
    font-size: 3.5rem !important;
    margin-bottom: 40px;
    padding-bottom: 30px;
}

.tv-window-container.fullscreen .tv-player-item {
    font-size: 4rem !important;
    padding: 35px;
    border-radius: 20px;
    border-width: 3px;
}

.tv-window-container.fullscreen .tv-player-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 123, 255, 0.4);
}

/* Empty court message in fullscreen */
.tv-window-container.fullscreen .tv-empty-court {
    font-size: 4rem !important;
}

.tv-window-container.fullscreen .tv-empty-court i {
    font-size: 6rem !important;
}

/* Window controls in fullscreen */
.tv-window-container.fullscreen .tv-window-controls button {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
}

/* Multiple windows stacking */
.tv-window-container:nth-child(2) {
    top: 100px;
    left: 100px;
}

.tv-window-container:nth-child(3) {
    top: 150px;
    left: 150px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tv-window-container {
        width: 90vw;
        height: 70vh;
        left: 5vw;
        top: 15vh;
    }
    
    .tv-court-number {
        font-size: 3rem;
    }
    
    .tv-team-title {
        font-size: 1.8rem;
    }
    
    .tv-player-item {
        font-size: 1.8rem;
        padding: 15px;
    }
    
    /* Fullscreen on mobile */
    .tv-window-container.fullscreen .tv-court-number {
        font-size: 5rem !important;
    }
    
    .tv-window-container.fullscreen .tv-team-title {
        font-size: 2.5rem !important;
    }
    
    .tv-window-container.fullscreen .tv-player-item {
        font-size: 2.8rem !important;
        padding: 25px;
    }
}

/* Animation for entering fullscreen */
@keyframes fullscreenEnter {
    from {
        opacity: 0.8;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tv-window-container.fullscreen {
    animation: fullscreenEnter 0.5s ease-out;
}

/* Empty court message */
.tv-empty-court {
    text-align: center;
    padding: 60px 0;
    font-size: 2.5rem;
    opacity: 0.7;
    animation: fadeIn 1s ease-out;
}

.tv-empty-court i {
    font-size: 4rem;
    margin-bottom: 30px;
    display: block;
    color: rgba(255, 255, 255, 0.5);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 0.7; transform: translateY(0); }
}

/* VS separator between teams */
.tv-vs-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 40px 0;
}

.tv-vs-text {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    font-size: 3rem;
    font-weight: bold;
    padding: 15px 40px;
    border-radius: 50px;
    border: 3px solid rgba(255, 215, 0, 0.3);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes windowFlash {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(0,0,0,0.2); 
    }
    50% { 
        box-shadow: 0 0 20px #007bff, 0 0 30px rgba(0,123,255,0.5); 
    }
}

.restriction-toggle-container {
    margin: 10px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.restriction-toggle-container label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: #495057;
}

.restriction-toggle-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #dc3545; /* Red color to indicate it's a special override */
}

.restriction-toggle-container .toggle-status {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 5px;
    text-align: center;
}

/* When toggle is checked, highlight it */
.restriction-toggle-container input[type="checkbox"]:checked + span {
    color: #dc3545;
    font-weight: bold;
}

/* Leaderboard Tab Styles */
.leaderboard-header {
    margin-bottom: 25px;
}

.leaderboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.timeframe-selector {
    display: flex;
    gap: 5px;
    background: #f8f9fa;
    padding: 5px;
    border-radius: 8px;
}

.timeframe-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s ease;
}

.timeframe-btn:hover {
    background: #e9ecef;
}

.timeframe-btn.active {
    background: #007bff;
    color: white;
}

.leaderboard-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.leaderboard-container {
    display: none;
    animation: fadeIn 0.3s ease;
}

.leaderboard-container.active {
    display: block;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
}

.leaderboard-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px 15px;
    text-align: left;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    user-select: none;
    position: relative;
    letter-spacing: 0.5px;
}

.leaderboard-table th.no-sort {
    cursor: default;
}

.leaderboard-table th:hover:not(.no-sort) {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.leaderboard-table th.sort-asc::after {
    content: " ↑";
    opacity: 0.9;
    font-weight: bold;
}

.leaderboard-table th.sort-desc::after {
    content: " ↓";
    opacity: 0.9;
    font-weight: bold;
}

.leaderboard-table td {
    padding: 18px 15px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.leaderboard-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(248, 249, 250, 0.8) 0%, rgba(233, 236, 239, 0.6) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.rank-cell {
    font-weight: 800;
    font-size: 1.4rem;
    text-align: center;
    width: 70px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Improved rank colors for better readability */
.rank-1 { 
    color: #FFD700; /* Pure gold */
    background: linear-gradient(45deg, #FFD700, #FFEC8B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 2px 4px rgba(0,0,0,0.3);
}

.rank-2 { 
    color: #C0C0C0; /* Pure silver */
    background: linear-gradient(45deg, #C0C0C0, #F0F0F0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(192, 192, 192, 0.4), 0 2px 4px rgba(0,0,0,0.2);
}

.rank-3 { 
    color: #CD7F32; /* Pure bronze */
    background: linear-gradient(45deg, #CD7F32, #E6A157);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(205, 127, 50, 0.4), 0 2px 4px rgba(0,0,0,0.2);
}

.player-name-cell {
    font-weight: 700;
    color: #2d3748;
    min-width: 250px;
}

.player-name-main {
    font-weight: 800;
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #1a202c;
    letter-spacing: 0.3px;
}

.player-stats-mini {
    font-size: 0.9rem;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.games-count {
    color: #4a5568;
    font-weight: 600;
    background: #edf2f7;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.win-loss-record {
    color: #718096;
    font-weight: 500;
    font-size: 0.85rem;
}

.performance-cell {
    min-width: 140px;
}

.winrate-cell {
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 100px;
}

.winrate-high { 
    color: #38a169; 
    text-shadow: 0 0 10px rgba(56, 161, 105, 0.1);
}
.winrate-medium { 
    color: #d69e2e; 
    text-shadow: 0 0 10px rgba(214, 158, 46, 0.1);
}
.winrate-low { 
    color: #e53e3e; 
    text-shadow: 0 0 10px rgba(229, 62, 62, 0.1);
}

.plusminus-cell {
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 100px;
}

.plusminus-positive { 
    color: #38a169; 
    text-shadow: 0 0 10px rgba(56, 161, 105, 0.1);
}
.plusminus-negative { 
    color: #e53e3e; 
    text-shadow: 0 0 10px rgba(229, 62, 62, 0.1);
}

.performance-bar {
    height: 10px;
    background-color: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 6px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.performance-fill {
    height: 100%;
    background: linear-gradient(90deg, #4fd1c5, #4299e1);
    border-radius: 5px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(66, 153, 225, 0.3);
}

.performance-percentage {
    color: #4a5568;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Star rating system - Fixed alignment */
.star-rating {
    display: flex;
    gap: 2px;
    align-items: center;
}

.star {
    position: relative;
    color: #ffc107;
    font-size: 1.1rem;
    width: 1.1rem;
    height: 1.1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.star.full::before {
    content: "★";
    position: absolute;
}

.star.half::before {
    content: "★";
    position: absolute;
    width: 50%;
    overflow: hidden;
    color: #ffc107;
}

.star.empty {
    color: #e2e8f0;
}

.star.empty::before {
    content: "★";
    position: absolute;
}

/* Search area */
.leaderboard-search-container {
    margin: 25px 0;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.leaderboard-search-input {
    flex: 1;
    max-width: 350px;
    padding: 12px 18px;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.leaderboard-search-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.25);
    border-color: #5a67d8;
    transform: translateY(-1px);
}

.leaderboard-search-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.leaderboard-search-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.search-result {
    margin-top: 25px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 6px solid #667eea;
    display: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border: 1px solid #dee2e6;
}

.search-result.visible {
    display: block;
    animation: fadeIn 0.5s ease;
}

.search-result h4 {
    margin-top: 0;
    color: #2d3748;
    font-weight: 700;
    font-size: 1.4rem;
}

.player-search-highlight {
    background: linear-gradient(120deg, #ffd700 0%, #ffed4e 100%);
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 800;
    box-shadow: 0 3px 8px rgba(255, 215, 0, 0.2);
    color: #2d3748;
}

.shared-rank {
    font-style: italic;
    color: #718096;
    opacity: 0.9;
    font-size: 0.9rem;
}

.shared-rank:empty::before {
    content: "=";
    color: #a0aec0;
    opacity: 0.7;
    font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .leaderboard-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .leaderboard-actions {
        width: 100%;
        justify-content: center;
    }
    
    .leaderboard-table {
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 12px 8px;
    }
    
    .player-name-main {
        font-size: 1.1rem;
    }
    
    .rank-cell {
        font-size: 1.2rem;
    }
    
    .star {
        font-size: 0.9rem;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Updated colors for better contrast */
.leaderboard-table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.leaderboard-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

/* Updated search result rank colors for better readability */
.search-result .rank-1 {
    background: linear-gradient(135deg, #FFD700, #FFEC8B);
    color: #2d3748;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    border: 2px solid #FFD700;
}

.search-result .rank-2 {
    background: linear-gradient(135deg, #C0C0C0, #F0F0F0);
    color: #2d3748;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    border: 2px solid #C0C0C0;
}

.search-result .rank-3 {
    background: linear-gradient(135deg, #CD7F32, #E6A157);
    color: #2d3748;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    border: 2px solid #CD7F32;
}

/* Tooltip for star ratings */
.star-rating {
    position: relative;
    cursor: help;
}

.star-rating:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
}

.star-rating:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2d3748;
    margin-bottom: -4px;
    z-index: 1001;
    pointer-events: none;
}

/* Ensure proper cursor visibility on all interactive elements */
.tab, .mode-option, .btn, .status-btn, .player-item, .waitlist-item, 
.court-player, .up-next-player, .up-next-player-item, .court-player-modal-item,
.add-to-court-btn, .add-up-next-players, .up-next-clear-btn,
.up-next-remove-player, .level-toggle, .timeframe-btn,
.leaderboard-search-btn, .tv-window-controls button, .login-btn,
.btn-logout, .up-next-box, .waitlist-player-name.clickable-player,
.team-player.court-player, .up-next-player {
    cursor: pointer;
}

/* Specifically ensure cursor is visible on courts tab elements */
#courts .court-card,
#courts .court-player,
#courts .team-player,
#courts .btn,
#courts .form-control,
#courts select,
#courts input,
#courts .court-team,
#courts .up-next-court-actions .btn,
#courts .court-player-select-option,
#courts .court-player-modal-item,
#courts .add-up-next-players,
#courts .up-next-player-item,
#courts .waitlist-item {
    cursor: pointer;
}

/* Ensure text inputs and dropdowns have text cursor */
.form-control, input[type="text"], input[type="number"], input[type="password"],
select, textarea, .court-player-select-container input,
.court-player-modal-search, .court-player-modal-sort,
.leaderboard-search-input, .login-input {
    cursor: text;
}

/* Ensure draggable elements have proper cursor */
.court-player.draggable, .up-next-player.draggable,
.team-player.court-player.draggable {
    cursor: grab;
}

.court-player.draggable:active, .up-next-player.draggable:active,
.team-player.court-player.draggable:active {
    cursor: grabbing;
}

/* Ensure proper cursor on hover states */
.court-player:hover, .up-next-player:hover, .player-item:hover,
.waitlist-item:hover, .court-player-modal-item:hover,
.up-next-player-item:hover, .level-toggle:hover,
.timeframe-btn:hover, .star-rating:hover,
.tv-team:hover, .tv-player-item:hover {
    cursor: pointer;
}

.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

.spinner-border.text-light {
    color: #fff !important;
}

/* style.css - Add these styles */

/* Modal animations */
.modal {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Button loading spinner */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success state for logout */
.btn-logout.success {
    background: linear-gradient(135deg, 
        rgba(40, 167, 69, 0.9) 0%, 
        rgba(33, 136, 56, 0.9) 100%) !important;
    animation: successPulse 1.5s ease-in-out;
}

@keyframes successPulse {
    0%, 100% {
        box-shadow: 
            0 4px 15px rgba(40, 167, 69, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 
            0 4px 20px rgba(40, 167, 69, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Button hover effects */
.btn-primary:hover, .btn-secondary:hover, .btn-danger:hover {
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Form focus states */
.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

/* Loading animation */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error message animations */
.alert {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth tab transitions */
.tab-content {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Enhanced Main Header Styles */
.main-header {
    background: linear-gradient(135deg, 
        rgba(76, 175, 80, 0.95) 0%, 
        rgba(33, 150, 243, 0.95) 50%, 
        rgba(156, 39, 176, 0.95) 100%);
    color: white;
    padding: 15px 30px;
    margin-bottom: 25px;
    border-radius: 20px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.main-header:hover {
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.2),
        0 6px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.logo-icon {
    position: relative;
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.2),
        inset 0 4px 10px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.logo-icon:hover {
    transform: scale(1.05) rotate(10deg);
    box-shadow: 
        0 12px 35px rgba(0, 0, 0, 0.3),
        inset 0 4px 15px rgba(255, 255, 255, 0.2);
}

.logo-icon i {
    font-size: 32px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.logo-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85px;
    height: 85px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    70% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
}

.logo-text {
    text-align: left;
}

.logo-title {
    font-size: 2.8rem;
    font-weight: 900;
    margin: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(255, 255, 255, 0.9) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.logo-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 5px 0 0 0;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 1px;
}

.header-tagline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.header-tagline:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.tagline-icon i {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

.app-description {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

.user-session-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.session-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    position: relative;
    animation: statusPulse 2s infinite;
}

.status-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: rgba(76, 175, 80, 0.3);
    border-radius: 50%;
    animation: statusPulseOuter 2s infinite;
}

@keyframes statusPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(76, 175, 80, 0);
    }
}

@keyframes statusPulseOuter {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.3;
    }
}

.status-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.user-avatar {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.9);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-email {
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-change-password {
    background: linear-gradient(135deg, 
        rgba(255, 193, 7, 0.9) 0%, 
        rgba(255, 152, 0, 0.9) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(255, 152, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-change-password:hover {
    background: linear-gradient(135deg, 
        rgba(255, 193, 7, 1) 0%, 
        rgba(255, 152, 0, 1) 100%);
    transform: translateY(-3px);
    box-shadow: 
        0 6px 20px rgba(255, 152, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-logout {
    background: linear-gradient(135deg, 
        rgba(220, 53, 69, 0.9) 0%, 
        rgba(200, 35, 51, 0.9) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(220, 53, 69, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-logout:hover {
    background: linear-gradient(135deg, 
        rgba(220, 53, 69, 1) 0%, 
        rgba(200, 35, 51, 1) 100%);
    transform: translateY(-3px);
    box-shadow: 
        0 6px 20px rgba(220, 53, 69, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-change-password i,
.btn-logout i {
    font-size: 1rem;
}

.btn-text {
    white-space: nowrap;
}

.header-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    overflow: hidden;
    z-index: 1;
}

.header-wave svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Add a subtle pattern overlay */
.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-tagline {
        align-self: flex-start;
    }
}

@media (max-width: 992px) {
    .main-header {
        padding: 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 25px;
        align-items: stretch;
    }
    
    .header-right {
        align-items: stretch;
    }
    
    .user-session-info {
        justify-content: space-between;
    }
    
    .header-actions {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .logo-title {
        font-size: 2.2rem;
    }
    
    .logo-icon {
        width: 60px;
        height: 60px;
    }
    
    .logo-icon i {
        font-size: 28px;
    }
    
    .app-description {
        font-size: 1rem;
    }
    
    .header-tagline {
        padding: 8px 15px;
    }
    
    .btn-change-password,
    .btn-logout {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
    
    .user-info {
        padding: 6px 12px;
    }
    
    .user-avatar {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .main-header {
        border-radius: 15px;
        margin-bottom: 15px;
    }
    
    .header-left {
        gap: 12px;
    }
    
    .logo-container {
        gap: 12px;
    }
    
    .logo-title {
        font-size: 1.8rem;
    }
    
    .logo-subtitle {
        font-size: 0.9rem;
    }
    
    .app-description {
        font-size: 0.9rem;
        white-space: normal;
        text-align: center;
    }
    
    .header-actions {
        flex-direction: column;
    }
    
    .btn-change-password,
    .btn-logout {
        width: 100%;
        justify-content: center;
    }
}

.game-history-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.btn-edit-game, .btn-delete-game {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-edit-game {
    background: #ffc107;
    color: #212529;
}

.btn-edit-game:hover {
    background: #e0a800;
    transform: translateY(-1px);
}

.btn-delete-game {
    background: #dc3545;
    color: white;
}

.btn-delete-game:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Edit Game Modal */
.edit-game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.edit-game-modal.active {
    display: flex;
}

.edit-game-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 25px;
}

.edit-game-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.edit-game-modal-header h3 {
    margin: 0;
    color: #333;
}

.close-edit-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
}

.edit-game-form-group {
    margin-bottom: 20px;
}

.edit-game-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.edit-game-form-group select,
.edit-game-form-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
}

.team-players-select {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.team-select {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
}

.team-select h4 {
    margin: 0 0 10px 0;
    color: #495057;
}

.player-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin: 5px 0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
}

.player-checkbox:hover {
    background: #e7f3ff;
}

.player-checkbox input {
    width: auto;
    margin: 0;
}

.score-inputs {
    display: flex;
    gap: 15px;
    align-items: center;
}

.score-inputs input {
    flex: 1;
    text-align: center;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.modal-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-save-edit {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-cancel-edit {
    background: #6c757d;
    color: white;
}

.btn-danger-edit {
    background: #dc3545;
    color: white;
}

.edit-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 13px;
    color: #856404;
}