/* Games Page Styles */

/* Games Header */
.games-header {
    background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
    color: white;
    padding: 120px 0 80px;
    margin-top: 56px; /* Account for fixed navbar */
    position: relative;
    overflow: hidden;
}

.games-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="game-pattern" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="2" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23game-pattern)"/></svg>');
    opacity: 0.3;
}

.games-header .container {
    position: relative;
    z-index: 2;
}

.games-header h1 {
    color: white;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

.games-header .lead {
    opacity: 0.9;
    font-size: 1.25rem;
}

/* Games Stats */
.games-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #ffc107;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* Games Illustration */
.games-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
}

.games-illustration i {
    font-size: 12rem;
    color: rgba(255, 255, 255, 0.2);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Game Cards */
.game-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.game-card:hover::before {
    left: 100%;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.game-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    transition: all 0.3s ease;
}

.game-card:hover .game-icon {
    transform: scale(1.1) rotate(5deg);
}

.game-card h5 {
    color: #333;
    font-weight: bold;
    margin-bottom: 1rem;
}

.game-card p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.game-stats span {
    font-size: 0.8rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    white-space: nowrap;
}

.game-action {
    margin-top: auto;
}

.game-action .btn {
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
}

/* Special button colors */
.btn-purple {
    background: linear-gradient(135deg, #6f42c1 0%, #9c27b0 100%);
    color: white;
}

.btn-purple:hover {
    background: linear-gradient(135deg, #5a359a 0%, #7b1fa2 100%);
    color: white;
    transform: translateY(-2px);
}

/* Card hover effects for different game types */
.game-card:nth-child(1):hover .game-icon {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.game-card:nth-child(2):hover .game-icon {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.game-card:nth-child(3):hover .game-icon {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

.game-card:nth-child(4):hover .game-icon {
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
}

.game-card:nth-child(5):hover .game-icon {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.game-card:nth-child(6):hover .game-icon {
    background: linear-gradient(135deg, #6f42c1 0%, #9c27b0 100%);
}

/* Leaderboard and Achievements Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: 15px 15px 0 0;
    padding: 1.25rem 1.5rem;
}

.card-header h5 {
    margin-bottom: 0;
    color: #495057;
    font-weight: bold;
}

/* Quiz Modal Styles */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
    color: white;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.quiz-progress .progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.quiz-progress .progress-bar {
    background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Question Styles */
#questionText {
    color: #333;
    font-weight: 600;
    margin-bottom: 2rem;
    line-height: 1.4;
}

.answer-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.answer-option:hover {
    background: #e9ecef;
    border-color: #6f42c1;
    transform: translateX(5px);
}

.answer-option.selected {
    background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
    border-color: #6f42c1;
    color: white;
    transform: translateX(5px);
}

.answer-option.correct {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-color: #28a745;
    color: white;
}

.answer-option.incorrect {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    border-color: #dc3545;
    color: white;
}

.answer-option .option-letter {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-weight: bold;
    font-size: 0.9rem;
}

.answer-option:not(.selected) .option-letter {
    background: #6c757d;
    color: white;
}

/* Quiz Results */
.quiz-result-icon {
    font-size: 4rem;
    color: #ffc107;
    margin-bottom: 1rem;
    animation: bounce 1s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 60%, 100% { transform: translateY(0); }
    40% { transform: translateY(-30px); }
    80% { transform: translateY(-15px); }
}

.points-earned {
    background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    margin-top: 1rem;
}

.points-earned i {
    font-size: 1.2rem;
}

/* Leaderboard Styles */
.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.leaderboard-item:hover {
    background-color: #f8f9fa;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 1rem;
    font-size: 1.1rem;
}

.leaderboard-rank.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
}

.leaderboard-rank.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e5e5e5 100%);
    color: #333;
}

.leaderboard-rank.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #deb887 100%);
    color: white;
}

.leaderboard-rank.rank-other {
    background: #6c757d;
    color: white;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.leaderboard-score {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Achievement Styles */
.achievement-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.achievement-item:hover {
    background-color: #f8f9fa;
}

.achievement-item:last-child {
    border-bottom: none;
}

.achievement-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
    color: white;
}

.achievement-info h6 {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.achievement-info p {
    margin-bottom: 0;
    font-size: 0.8rem;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .games-header {
        padding: 100px 0 50px;
    }
    
    .games-header h1 {
        font-size: 2.5rem;
    }
    
    .games-stats {
        justify-content: center;
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .games-illustration {
        height: 200px;
        margin-top: 2rem;
    }
    
    .games-illustration i {
        font-size: 8rem;
    }
    
    .game-card {
        margin-bottom: 1.5rem;
        padding: 1.5rem;
    }
    
    .game-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .game-stats {
        gap: 0.5rem;
    }
    
    .game-stats span {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
    
    .modal-dialog {
        margin: 1rem;
    }
    
    #questionText {
        font-size: 1.1rem;
    }
    
    .answer-option {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .games-header h1 {
        font-size: 2rem;
    }
    
    .games-header .lead {
        font-size: 1rem;
    }
    
    .games-stats {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .stat-item {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .game-card {
        padding: 1rem;
    }
    
    .game-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .quiz-progress {
        margin-bottom: 2rem;
    }
    
    .answer-option {
        padding: 0.5rem 0.75rem;
    }
    
    .answer-option .option-letter {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
        margin-right: 0.75rem;
    }
}

/* Loading States */
.loading-games {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.loading-games .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Empty States */
.empty-games {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-games i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Success Animations */
.success-animation {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Game Mode Indicators */
.game-mode-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa726 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.game-mode-badge.daily {
    background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
}

.game-mode-badge.challenge {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

/* Timer Display */
.quiz-timer {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(111, 66, 193, 0.1);
    color: #6f42c1;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-timer.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.quiz-timer.danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}
