﻿/* ========================================
   ASeekers Quiz System Styles
   Oasis Theme - Warm, Welcoming, Accessible
   ======================================== */

/* ==================== GENERAL QUIZ LAYOUT ==================== */

.quiz-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.quiz-header {
    margin-bottom: 2rem;
}

    .quiz-header h1 {
        color: #2c3e50;
        font-weight: 700;
    }

    .quiz-header .lead {
        color: #6c757d;
        font-size: 1.1rem;
    }

/* ==================== USER STATS BAR ==================== */

.user-stats-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.3s ease;
}

    .stat-card:hover {
        transform: translateY(-3px);
    }

    .stat-card i {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-stats-compact {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-badge {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* ==================== CATEGORY CARDS ==================== */

.category-card-link {
    text-decoration: none;
    display: block;
}

.category-card {
    position: relative;
    border-radius: 15px;
    padding: 2rem;
    color: white;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

    .category-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 100%);
        z-index: 1;
    }

    .category-card > * {
        position: relative;
        z-index: 2;
    }

    .category-card.bg-primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .category-card.bg-success {
        background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    }

    .category-card.bg-info {
        background: linear-gradient(135deg, #00b4db 0%, #0083b0 100%);
    }

    .category-card.bg-warning {
        background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    }

    .category-card.bg-danger {
        background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    }

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.category-description {
    font-size: 0.95rem;
    opacity: 0.95;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.category-stats .badge {
    font-weight: 600;
    padding: 0.4rem 0.8rem;
}

.category-progress {
    margin-top: 1rem;
}

.category-arrow {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.category-card:hover .category-arrow {
    opacity: 1;
    right: 1rem;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* ==================== QUIZ CARDS ==================== */

.quiz-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

    .quiz-card.featured {
        border: 2px solid #ffc107;
        box-shadow: 0 4px 20px rgba(255, 193, 7, 0.3);
    }

.featured-badge {
    position: absolute;
    top: -10px;
    right: 1rem;
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    color: #000;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}

.quiz-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.quiz-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    flex: 1;
}

.difficulty-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.difficulty-easy {
    background: #d4edda;
    color: #155724;
}

.difficulty-medium {
    background: #fff3cd;
    color: #856404;
}

.difficulty-hard {
    background: #f8d7da;
    color: #721c24;
}

.quiz-card-body {
    flex-grow: 1;
}

.quiz-description {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.quiz-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #495057;
    font-size: 0.9rem;
}

    .stat-item i {
        font-size: 1.1rem;
    }

.quiz-progress {
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.quiz-card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* ==================== TAKE QUIZ PAGE ==================== */

.quiz-take-container {
    min-height: 100vh;
    background: #f8f9fa;
}

.quiz-take-header {
    background: white;
    z-index: 1000;
    border-bottom: 2px solid #e9ecef;
}

.question-progress {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
}

.timer-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #28a745;
    background: #d4edda;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
}

    .timer-display.timer-warning {
        color: #ffc107;
        background: #fff3cd;
    }

    .timer-display.timer-critical {
        color: #dc3545;
        background: #f8d7da;
        animation: pulse 1s infinite;
    }

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.question-container {
    margin-bottom: 2rem;
}

.question-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.question-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: #667eea;
}

.question-points {
    font-size: 1rem;
    font-weight: 600;
    color: #ffc107;
}

.question-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.question-image {
    text-align: center;
}

    .question-image img {
        max-height: 400px;
        object-fit: contain;
    }

.answers-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.answer-option {
    width: 100%;
}

.answer-label {
    width: 100%;
    text-align: left;
    padding: 1.25rem;
    font-size: 1.05rem;
    border-width: 2px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.answer-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: #e9ecef;
    border-radius: 50%;
    font-weight: 700;
    color: #495057;
    flex-shrink: 0;
}

.answer-text {
    flex: 1;
}

.answer-label:hover {
    transform: translateX(5px);
    border-color: #667eea !important;
    background: #f8f9ff;
}

.btn-check:checked + .answer-label {
    background: #667eea;
    color: white;
    border-color: #667eea !important;
}

    .btn-check:checked + .answer-label .answer-letter {
        background: white;
        color: #667eea;
    }

.question-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.btn-prev,
.btn-next,
.btn-submit {
    padding: 0.75rem 2rem;
    font-weight: 600;
}

.question-indicators {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.question-indicator {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .question-indicator:hover {
        background: #dee2e6;
        transform: scale(1.1);
    }

    .question-indicator.answered {
        background: #28a745;
        color: white;
    }

    .question-indicator.current {
        background: #667eea;
        color: white;
        transform: scale(1.2);
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
    }

/* ==================== RESULTS PAGE ==================== */

.results-header {
    padding: 2rem 0;
}

.result-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 4rem;
}

    .result-icon.success {
        background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
        color: #28a745;
    }

    .result-icon.fail {
        background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
        color: #dc3545;
    }

.stat-card-large {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

    .stat-card-large:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    }

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.stat-card-large .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0.5rem 0;
}

.stat-card-large .stat-label {
    font-size: 1rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.achievements-section {
    background: linear-gradient(135deg, #fff9e6 0%, #ffedd5 100%);
    border-radius: 15px;
    padding: 2rem;
}

.achievement-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

    .achievement-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    }

.achievement-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.achievement-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.achievement-description {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.achievement-bonus {
    background: #fff3cd;
    color: #856404;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
}

.progress-section .card,
.tips-section .card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.progress-stat h3 {
    margin-bottom: 0.25rem;
}

.review-section {
    margin-top: 3rem;
}

.question-review-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-left: 5px solid #e9ecef;
}

    .question-review-card.correct {
        border-left-color: #28a745;
    }

    .question-review-card.incorrect {
        border-left-color: #dc3545;
    }

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.review-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: #495057;
}

.review-body h5 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.answer-comparison {
    margin: 1.5rem 0;
}

.answer-box {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

    .answer-box.correct-answer {
        background: #d4edda;
        border: 2px solid #28a745;
    }

    .answer-box.wrong-answer {
        background: #f8d7da;
        border: 2px solid #dc3545;
    }

    .answer-box strong {
        display: block;
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

.explanation-box {
    background: #e7f3ff;
    border-left: 4px solid #0066cc;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

    .explanation-box strong {
        display: block;
        color: #0066cc;
        margin-bottom: 0.5rem;
    }

/* ==================== LEADERBOARD ==================== */

.leaderboard-header {
    margin-bottom: 2rem;
}

.leaderboard-table-container {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.leaderboard-table {
    margin-bottom: 0;
}

    .leaderboard-table thead {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    }

        .leaderboard-table thead th {
            border: none;
            padding: 1rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            font-size: 0.9rem;
        }

    .leaderboard-table tbody tr {
        transition: all 0.2s ease;
    }

        .leaderboard-table tbody tr:hover {
            background: #f8f9fa;
            transform: scale(1.01);
        }

        .leaderboard-table tbody tr.top-three {
            background: #fffbf0;
        }

        .leaderboard-table tbody tr.current-user-row {
            background: #e7f3ff;
            font-weight: 600;
        }

    .leaderboard-table td {
        padding: 1.25rem 1rem;
        vertical-align: middle;
    }

.rank-column {
    width: 80px;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
}

    .rank-badge.gold {
        background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
        color: #000;
    }

    .rank-badge.silver {
        background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
        color: #000;
    }

    .rank-badge.bronze {
        background: linear-gradient(135deg, #cd7f32 0%, #e4a86c 100%);
        color: #fff;
    }

.rank-number {
    font-weight: 600;
    color: #6c757d;
    font-size: 1.1rem;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.player-name {
    font-weight: 600;
    color: #2c3e50;
}

.points-badge {
    background: #fff3cd;
    color: #856404;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
}

.avg-score {
    font-weight: 600;
    color: #495057;
}

/* ==================== INFO CARDS ==================== */

.info-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

    .info-card:hover {
        box-shadow: 0 4px 20px rgba(0,0,0,0.12);
        transform: translateY(-3px);
    }

    .info-card h4,
    .info-card h5 {
        color: #2c3e50;
        font-weight: 700;
        margin-bottom: 1rem;
    }

    .info-card ul {
        margin-bottom: 0;
        padding-left: 1.5rem;
    }

    .info-card li {
        margin-bottom: 0.5rem;
        color: #6c757d;
    }

/* ==================== LOADING OVERLAY ==================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

    .loading-overlay .spinner-border {
        width: 4rem;
        height: 4rem;
    }

/* ==================== CONFETTI ANIMATION ==================== */

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 9999;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* ==================== ACTION BUTTONS ==================== */

.action-buttons {
    margin-top: 2rem;
}

    .action-buttons .btn {
        padding: 0.75rem 2rem;
        font-weight: 600;
    }

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 768px) {
    .quiz-container {
        padding: 1rem 0.5rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .category-card {
        min-height: 240px;
        padding: 1.5rem;
    }

    .category-title {
        font-size: 1.25rem;
    }

    .quiz-card {
        padding: 1.25rem;
    }

    .question-card {
        padding: 1.5rem;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .answer-label {
        padding: 1rem;
        font-size: 0.95rem;
    }

    .answer-letter {
        width: 2rem;
        height: 2rem;
        font-size: 0.9rem;
    }

    .stat-card-large {
        padding: 1.5rem;
    }

        .stat-card-large .stat-value {
            font-size: 2rem;
        }

    .leaderboard-table td {
        padding: 1rem 0.5rem;
        font-size: 0.9rem;
    }

    .player-avatar {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .question-navigation {
        flex-direction: column;
    }

    .btn-prev,
    .btn-next,
    .btn-submit {
        width: 100%;
    }
}

/* ==================== ANIMATIONS ==================== */

@keyframes bounceIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply fade-in animation to cards */
.category-card,
.quiz-card,
.question-card,
.question-review-card {
    animation: fadeInUp 0.5s ease-out;
}

/* ==================== PRINT STYLES ==================== */

@media print {
    .quiz-take-header,
    .question-navigation,
    .question-indicators,
    .action-buttons,
    .user-stats-bar,
    .btn {
        display: none !important;
    }

    .quiz-container {
        max-width: 100%;
    }

    .question-review-card {
        page-break-inside: avoid;
    }
}
