/* Additional styles for the professional results table */

/* Professional Results Table Styles */
.scoreboard-table {
    width: 100%;
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: transparent;
    overflow: hidden;
    border-radius: 15px;
}

.results-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.results-table thead th {
    padding: 18px 15px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.results-table thead th:first-child {
    border-top-left-radius: 15px;
}

.results-table thead th:last-child {
    border-top-right-radius: 15px;
}

.results-table thead th i {
    display: block;
    font-size: 18px;
    margin-bottom: 5px;
    opacity: 0.9;
}

.results-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.results-table tbody tr:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.results-table tbody tr.winner-row {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 193, 7, 0.1));
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.results-table tbody tr.second-place {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(169, 169, 169, 0.1));
}

.results-table tbody tr.third-place {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15), rgba(184, 115, 51, 0.1));
}

.results-table td {
    padding: 15px 12px;
    text-align: center;
    vertical-align: middle;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.results-table td:last-child {
    border-right: none;
}

/* Rank Cell Styles */
.rank-cell {
    font-weight: bold;
    font-size: 18px;
    width: 80px;
}

.rank-number {
    display: inline-block;
    width: 35px;
    height: 35px;
    line-height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.fa-crown.gold {
    color: #ffd700;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: crownGlow 2s ease-in-out infinite alternate;
}

.fa-medal.silver {
    color: #c0c0c0;
    font-size: 20px;
    text-shadow: 0 0 8px rgba(192, 192, 192, 0.5);
}

.fa-medal.bronze {
    color: #cd7f32;
    font-size: 20px;
    text-shadow: 0 0 8px rgba(205, 127, 50, 0.5);
}

@keyframes crownGlow {
    from { text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
    to { text-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

/* Player Info Styles */
.player-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.player-info i {
    color: #667eea;
    font-size: 16px;
}

.player-name {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

/* Score Display Styles */
.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.score-number {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.score-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Questions Display Styles */
.questions-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.questions-number {
    font-size: 18px;
    font-weight: 600;
    color: #764ba2;
}

.questions-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Category Display Styles */
.category-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.category-display i {
    color: #ff7b89;
    font-size: 16px;
}

.category-name {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

/* Success Rate Styles */
.success-rate {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.rate-bar {
    width: 60px;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.rate-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff7b89, #667eea);
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
}

.rate-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.rate-text {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
}

/* Responsive Design for Table */
@media (max-width: 768px) {
    .scoreboard-table {
        margin: 15px 0;
        border-radius: 10px;
    }
    
    .results-table {
        font-size: 12px;
        border-radius: 10px;
    }
    
    .results-table thead th {
        padding: 12px 8px;
        font-size: 11px;
    }
    
    .results-table thead th i {
        font-size: 14px;
        margin-bottom: 3px;
    }
    
    .results-table td {
        padding: 10px 6px;
    }
    
    .score-number {
        font-size: 16px;
    }
    
    .questions-number {
        font-size: 14px;
    }
    
    .player-name {
        font-size: 13px;
    }
    
    .category-name {
        font-size: 11px;
    }
    
    .rate-bar {
        width: 40px;
        height: 6px;
    }
    
    .rate-text {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .scoreboard-table {
        margin: 10px 0;
        border-radius: 8px;
    }
    
    .results-table {
        font-size: 10px;
        border-radius: 8px;
    }
    
    .results-table thead th {
        padding: 8px 4px;
        font-size: 9px;
    }
    
    .results-table td {
        padding: 8px 4px;
    }
    
    .player-info {
        flex-direction: column;
        gap: 2px;
    }
    
    .category-display {
        flex-direction: column;
        gap: 2px;
    }
    
    .score-display,
    .questions-display {
        gap: 1px;
    }
    
    .rate-bar {
        width: 30px;
        height: 4px;
    }
}

/* Table Animation on Load */
.results-table tbody tr {
    opacity: 0;
    transform: translateY(20px);
    animation: tableRowAppear 0.5s ease forwards;
}

.results-table tbody tr:nth-child(1) { animation-delay: 0.1s; }
.results-table tbody tr:nth-child(2) { animation-delay: 0.2s; }
.results-table tbody tr:nth-child(3) { animation-delay: 0.3s; }
.results-table tbody tr:nth-child(4) { animation-delay: 0.4s; }
.results-table tbody tr:nth-child(5) { animation-delay: 0.5s; }
.results-table tbody tr:nth-child(n+6) { animation-delay: 0.6s; }

@keyframes tableRowAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Final Results Table Enhancements */
.final-results {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 3px solid rgba(102, 126, 234, 0.3);
}

.final-results thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #ff7b89 100%);
}

.final-results .winner-row {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(255, 193, 7, 0.2));
    border: 3px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    animation: winnerGlow 2s ease-in-out infinite alternate;
}

@keyframes winnerGlow {
    from { box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); }
    to { box-shadow: 0 0 30px rgba(255, 215, 0, 0.5); }
}

.performance-cell {
    font-weight: bold;
    text-align: center;
    padding: 15px 10px;
}

.performance-display {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Game Over Container Styles */
.game-over-container {
    animation: gameOverAppear 1s ease-out;
}

@keyframes gameOverAppear {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.game-over-header h1 {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 0 4px 8px rgba(102, 126, 234, 0.3); }
    to { text-shadow: 0 6px 12px rgba(102, 126, 234, 0.5); }
}

/* Stats Modal Styles */
.stats-modal {
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Enhanced Button Hover Effects */
button:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
}

button:active {
    transform: translateY(-1px) !important;
}

/* Mobile Responsiveness for Final Results */
@media (max-width: 768px) {
    .game-over-container {
        padding: 20px;
        margin: 10px;
    }
    
    .game-over-header h1 {
        font-size: 1.8rem;
    }
    
    .game-over-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .game-over-actions button {
        width: 100%;
        max-width: 300px;
        margin: 5px 0;
    }
    
    .final-results-section h2 {
        font-size: 1.4rem;
    }
    
    .performance-display {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .game-over-container {
        padding: 15px;
        margin: 5px;
    }
    
    .game-over-header h1 {
        font-size: 1.5rem;
    }
    
    .final-results-section h2 {
        font-size: 1.2rem;
    }
    
    .performance-display {
        font-size: 9px;
    }
    
    .game-over-actions button {
        font-size: 0.9rem;
        padding: 12px 20px;
    }
}

/* Player Info and Lifelines Styles */
.player-info-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin: 15px 0;
    border: 2px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.current-player-highlight {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    margin: 10px 0;
    text-align: center;
    font-size: 1.1rem;
    animation: currentPlayerGlow 2s ease-in-out infinite alternate;
}

@keyframes currentPlayerGlow {
    from { box-shadow: 0 0 10px rgba(102, 126, 234, 0.3); }
    to { box-shadow: 0 0 20px rgba(102, 126, 234, 0.6); }
}

.players-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
}

.player-status {
    padding: 8px 15px;
    border-radius: 20px;
    background: rgba(108, 117, 125, 0.1);
    border: 1px solid rgba(108, 117, 125, 0.3);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.player-status.active {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-color: #28a745;
    font-weight: 600;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.current-player-lifelines {
    margin-top: 20px;
    padding: 15px;
    background: rgba(246, 248, 250, 0.8);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.current-player-lifelines h4 {
    color: #495057;
    margin-bottom: 15px;
    text-align: center;
}

.lifelines-status {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
}

.lifeline-status {
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    flex: 1;
    min-width: 150px;
    transition: all 0.3s ease;
}

.lifeline-status.available {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: 2px solid #28a745;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.lifeline-status.used {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 2px solid #6c757d;
    opacity: 0.7;
}

.lifeline-status i {
    margin-right: 8px;
    font-size: 1.1rem;
}

/* Responsive design for player info */
@media (max-width: 768px) {
    .player-info-container {
        padding: 15px;
        margin: 10px 0;
    }
    
    .current-player-highlight {
        padding: 10px 15px;
        font-size: 1rem;
    }
    
    .players-list {
        flex-direction: column;
        align-items: center;
    }
    
    .player-status {
        width: 100%;
        max-width: 200px;
        text-align: center;
    }
    
    .lifelines-status {
        flex-direction: column;
        align-items: center;
    }
    
    .lifeline-status {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .current-player-highlight {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    
    .lifeline-status {
        font-size: 0.8rem;
        padding: 8px 12px;
        min-width: 120px;
    }
    
    .lifeline-status i {
        font-size: 1rem;
        margin-right: 6px;
    }
}
