/* Sports Trivia Styles */

.trivia-home {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.challenge-header {
    text-align: center;
    margin-bottom: 2rem;
}

.challenge-header h1 {
    color: #16A34A;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.challenge-description {
    font-size: 1.2rem;
    color: #6B7280;
    margin-bottom: 0.5rem;
}

.challenge-date {
    font-size: 1rem;
    color: #9CA3AF;
    font-weight: 500;
}

.challenge-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #16A34A;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6B7280;
    font-weight: 500;
}

.user-session-status {
    margin-bottom: 2rem;
}

.play-section {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.play-section h2 {
    color: #111827;
    margin-bottom: 1rem;
}

.game-rules {
    text-align: left;
    margin: 1.5rem 0;
    background: #F9FAFB;
    border-radius: 8px;
    padding: 1.5rem;
}

.game-rules h3 {
    color: #374151;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.game-rules ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.game-rules li {
    padding: 0.5rem 0;
    color: #4B5563;
    font-size: 0.95rem;
}

.play-buttons {
    margin-top: 1.5rem;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.login-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #6B7280;
}

.login-note a {
    color: #16A34A;
    text-decoration: none;
    font-weight: 500;
}

.login-note a:hover {
    text-decoration: underline;
}

.leaderboard-preview {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 2rem;
}

.leaderboard-preview h2 {
    color: #111827;
    margin-bottom: 1.5rem;
    text-align: center;
}

.leaderboard-table {
    margin-bottom: 1.5rem;
}

.leaderboard-table table {
    width: 100%;
    margin-bottom: 0;
}

.leaderboard-table th {
    background: #F9FAFB;
    color: #374151;
    font-weight: 600;
    padding: 0.75rem;
    border-bottom: 2px solid #E5E7EB;
}

.leaderboard-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #F3F4F6;
}

.leaderboard-table tr:hover {
    background: #F9FAFB;
}

/* Responsive Design */
@media (max-width: 768px) {
    .trivia-home {
        padding: 1rem 0.5rem;
    }
    
    .challenge-header h1 {
        font-size: 2rem;
    }
    
    .challenge-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .play-section {
        padding: 1.5rem;
    }
    
    .leaderboard-preview {
        padding: 1.5rem;
    }
}

/* Alert Styles */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #065F46;
}

.alert-warning {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #92400E;
}

.alert-danger {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.alert-info {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1E40AF;
}

.alert h4 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.alert p {
    margin-bottom: 0.5rem;
}

.alert p:last-child {
    margin-bottom: 0;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #16A34A;
    color: white;
    border-color: #16A34A;
}

.btn-primary:hover {
    background: #15803D;
    border-color: #15803D;
    color: white;
    text-decoration: none;
}

.btn-outline-primary {
    background: transparent;
    color: #16A34A;
    border-color: #16A34A;
}

.btn-outline-primary:hover {
    background: #16A34A;
    color: white;
    text-decoration: none;
}

/* Game Play Styles */
.trivia-play {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.game-header {
    text-align: center;
    margin-bottom: 2rem;
}

.game-header h1 {
    color: #16A34A;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.game-progress {
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: #16A34A;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-weight: 500;
    color: #6B7280;
}

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

.question-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

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

.difficulty-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

.difficulty-1 { background: #10B981; }
.difficulty-2 { background: #F59E0B; }
.difficulty-3 { background: #EF4444; }
.difficulty-4 { background: #8B5CF6; }
.difficulty-5 { background: #1F2937; }

.question-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.answer-options {
    display: grid;
    gap: 1rem;
}

.answer-option {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.answer-option:hover {
    border-color: #16A34A;
    background: #F0FDF4;
}

.answer-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #F3F4F6;
    border-radius: 50%;
    font-weight: 700;
    color: #374151;
    margin-right: 1rem;
    flex-shrink: 0;
}

.option-text {
    font-size: 1rem;
    color: #374151;
    line-height: 1.5;
}

.auth-required {
    text-align: center;
    padding: 2rem;
    background: #FEF3C7;
    border-radius: 8px;
    margin-top: 2rem;
}

.start-game {
    text-align: center;
    padding: 3rem 2rem;
}

.start-game h3 {
    margin-bottom: 1rem;
    color: #111827;
}

.game-completed,
.game-failed {
    text-align: center;
    padding: 2rem;
}

/* Leaderboard Styles */
.trivia-leaderboard {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.leaderboard-header h1 {
    color: #16A34A;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.leaderboard-header h2 {
    color: #374151;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.leaderboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.leaderboard-table-container {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    background: #F9FAFB;
    color: #374151;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid #E5E7EB;
}

.leaderboard-table td {
    padding: 1rem;
    border-bottom: 1px solid #F3F4F6;
}

.leaderboard-table tr:hover {
    background: #F9FAFB;
}

.rank-cell {
    width: 80px;
    text-align: center;
}

.rank-medal {
    font-size: 1.5rem;
}

.rank-number {
    font-weight: 600;
    color: #6B7280;
}

.player-cell {
    font-weight: 600;
    color: #111827;
}

.time-cell {
    font-weight: 600;
    color: #16A34A;
}

.completed-cell {
    color: #6B7280;
    font-size: 0.875rem;
}

.no-scores {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.no-scores h3 {
    color: #374151;
    margin-bottom: 1rem;
}

.leaderboard-actions {
    text-align: center;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Answer feedback styles */
.answer-feedback {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
    border: 2px solid #e9ecef;
}

.answer-feedback.correct {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.answer-feedback.incorrect {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.answer-feedback h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.answer-feedback p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

/* Final results styles */
.game-results {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
    border: 2px solid #e9ecef;
}

.game-results h3 {
    margin: 0 0 1.5rem 0;
    font-size: 2rem;
}

.final-score {
    margin: 1.5rem 0;
}

.final-score p {
    margin: 0.5rem 0;
    font-size: 1.2rem;
}

.failure-message {
    color: #6c757d;
    font-style: italic;
    margin-top: 1rem;
}

.game-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.game-actions .btn {
    min-width: 150px;
}

/* Racing Interface Styles */
.race-dashboard {
    display: none; /* Hidden initially */
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #F0FDF4 0%, #ECFDF5 100%);
    border: 2px solid #16A34A;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.1);
}

.race-timer {
    text-align: center;
}

.timer-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timer-display {
    font-size: 2.5rem;
    font-weight: 800;
    color: #16A34A;
    font-family: 'Courier New', monospace;
    text-shadow: 0 2px 4px rgba(22, 163, 74, 0.2);
}

.race-progress {
    text-align: center;
}

.race-progress .progress-bar {
    height: 12px;
    background: #E5E7EB;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    border: 1px solid #D1D5DB;
}

.race-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #16A34A 0%, #22C55E 100%);
    transition: width 0.5s ease;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.race-progress .progress-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
}

.race-position {
    text-align: center;
}

.position-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.position-display {
    font-size: 1.2rem;
    font-weight: 700;
    color: #F59E0B;
    padding: 0.5rem 1rem;
    background: #FEF3C7;
    border-radius: 8px;
    border: 1px solid #F59E0B;
}

/* Live Leaderboard */
.live-leaderboard {
    display: none; /* Hidden initially */
    position: fixed;
    top: 120px;
    right: 20px;
    width: 280px;
    background: white;
    border: 2px solid #16A34A;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.live-leaderboard h4 {
    margin: 0 0 1rem 0;
    color: #16A34A;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    border-bottom: 2px solid #E5E7EB;
    padding-bottom: 0.5rem;
}

.leaderboard-content {
    font-size: 0.875rem;
}

.loading-leaders {
    text-align: center;
    color: #6B7280;
    font-style: italic;
    padding: 1rem 0;
}

.leader-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #F3F4F6;
}

.leader-rank {
    font-weight: 700;
    color: #F59E0B;
    width: 30px;
}

.leader-name {
    flex: 1;
    font-weight: 600;
    color: #374151;
    margin-left: 0.5rem;
}

.leader-time {
    font-weight: 600;
    color: #16A34A;
    font-family: 'Courier New', monospace;
}

/* Racing Question Card */
.question-card.racing {
    background: white;
    border: 3px solid #16A34A;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(22, 163, 74, 0.1);
    position: relative;
    overflow: hidden;
}

.question-card.racing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #16A34A 0%, #22C55E 50%, #16A34A 100%);
    animation: racing-pulse 2s ease-in-out infinite;
}

@keyframes racing-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.question-card.racing .question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.question-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: #16A34A;
    background: #F0FDF4;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 2px solid #16A34A;
}

.racing-option {
    transition: all 0.15s ease !important;
    border: 2px solid #E5E7EB !important;
}

.racing-option:hover {
    border-color: #16A34A !important;
    background: #F0FDF4 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}

.racing-option:active {
    transform: translateY(0);
}

.racing-option:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Race Complete Styles */
.race-complete {
    background: white;
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    margin: 2rem 0;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1);
}

.race-complete.perfect {
    border: 3px solid #16A34A;
    background: linear-gradient(135deg, #F0FDF4 0%, #ECFDF5 100%);
}

.race-complete.failed {
    border: 3px solid #F59E0B;
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
}

.race-finish-header h2 {
    margin: 0 0 1rem 0;
    font-size: 2.5rem;
    font-weight: 800;
}

.race-complete.perfect h2 {
    color: #16A34A;
}

.race-complete.failed h2 {
    color: #F59E0B;
}

.final-time {
    font-size: 3rem;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    margin-bottom: 2rem;
}

.race-complete.perfect .final-time {
    color: #16A34A;
    text-shadow: 0 2px 4px rgba(22, 163, 74, 0.3);
}

.race-complete.failed .final-time {
    color: #F59E0B;
    text-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.race-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-item {
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    padding: 1.5rem;
}

.race-complete.perfect .stat-item {
    border-color: #16A34A;
}

.race-complete.failed .stat-item {
    border-color: #F59E0B;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6B7280;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
}

.perfect-score {
    color: #16A34A !important;
    text-shadow: 0 1px 2px rgba(22, 163, 74, 0.2);
}

.race-message {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border: 2px solid #E5E7EB;
}

.race-message p {
    margin: 0.5rem 0;
    color: #6B7280;
    font-size: 1rem;
}

.race-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.race-actions .btn {
    min-width: 180px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
}

/* Mobile Responsiveness for Racing */
@media (max-width: 768px) {
    .race-dashboard {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .timer-display {
        font-size: 2rem;
    }
    
    .live-leaderboard {
        position: static;
        width: 100%;
        margin-bottom: 2rem;
    }
    
    .question-card.racing {
        padding: 1.5rem;
    }
    
    .question-number {
        font-size: 1.2rem;
        padding: 0.4rem 0.8rem;
    }
    
    .final-time {
        font-size: 2rem;
    }
    
    .race-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .race-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .race-actions .btn {
        width: 100%;
        max-width: 300px;
    }
}
