/*
 * Quiz System Styles
 * Complete styling for HyperReads Standalone Quiz System
 */

/* ============================================================================
   Quiz List Page
   ============================================================================ */

.quiz-hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    margin-bottom: 30px;
}

.quiz-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.quiz-hero .lead {
    font-size: 1.2rem;
    opacity: 0.9;
}

.quiz-stats .badge {
    font-size: 1rem;
    padding: 8px 15px;
    margin: 0 5px;
}

.filter-section {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 600;
    color: #333;
    margin: 0;
    min-width: 80px;
}

.category-filter,
.access-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn,
.access-filter-btn {
    border-radius: 20px;
    padding: 8px 20px;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.access-filter-btn.active {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.category-section {
    margin-bottom: 50px;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.category-title i {
    font-size: 2rem;
    color: #667eea;
}

.quiz-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.quiz-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.quiz-card.completed {
    border-color: #10b981;
    border-width: 2px;
}

.quiz-card-header {
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.quiz-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.quiz-badges {
    display: flex !important;
    gap: 5px;
    flex-wrap: wrap;
}

.quiz-badges .badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4em 0.8em;
    white-space: nowrap;
}

.quiz-badges .badge-success {
    background-color: #28a745 !important;
    color: white !important;
}

.quiz-badges .badge-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.quiz-card-body {
    padding: 20px;
    flex-grow: 1;
}

.quiz-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

.quiz-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #888;
}

.quiz-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.difficulty-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.difficulty-beginner {
    background-color: #d1fae5;
    color: #065f46;
}

.difficulty-intermediate {
    background-color: #fef3c7;
    color: #92400e;
}

.difficulty-advanced {
    background-color: #fee2e2;
    color: #991b1b;
}

.quiz-card-footer {
    padding: 15px 20px;
    background-color: #f8f9fa;
}

/* ============================================================================
   Quiz Detail Page
   ============================================================================ */

.quiz-header {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.quiz-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #333;
}

.badge-lg {
    font-size: 1rem;
    padding: 8px 15px;
}

.quiz-info-bar {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.info-item i {
    font-size: 1.2rem;
    color: #667eea;
}

.question-card {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.question-card:hover {
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.question-number {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.question-status i {
    font-size: 1.2rem;
}

.question-status .answered {
    color: #10b981;
}

.question-text {
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
    margin-bottom: 20px;
    line-height: 1.6;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-item:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.option-item input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.option-item input[type="radio"]:checked + .option-text {
    font-weight: 600;
    color: #667eea;
}

.option-item input[type="radio"]:checked ~ .option-check {
    display: block;
}

.option-text {
    flex-grow: 1;
    font-size: 1rem;
    color: #333;
}

.option-check {
    display: none;
    color: #10b981;
    font-size: 1.3rem;
}

/* Fixed Progress Bar */
.quiz-progress-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    border-top: 2px solid #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 15px 0;
}

.progress-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-info {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
}

.progress {
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

/* ============================================================================
   Results Page
   ============================================================================ */

.results-header {
    margin-bottom: 30px;
}

.score-section {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.score-circle {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(135deg, currentColor, transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.score-excellent {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.score-good {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.score-keep_learning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.score-keep_trying {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.score-content {
    text-align: center;
}

.score-percentage {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
}

.score-detail {
    font-size: 1.2rem;
    margin-top: 5px;
    opacity: 0.9;
}

.score-label {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 10px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-card {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.stat-label {
    font-size: 0.95rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-section {
    margin-top: 50px;
}

.review-section h3 {
    margin-bottom: 10px;
}

.review-item {
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
}

.review-item.correct {
    border-color: #10b981;
    background-color: #f0fdf4;
}

.review-item.incorrect {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.review-number {
    font-weight: 600;
    color: #667eea;
}

.review-status {
    font-weight: 600;
}

.review-question {
    font-size: 1.05rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 15px;
}

.review-answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.answer-row {
    padding: 10px 15px;
    background-color: white;
    border-radius: 5px;
}

.explanation-box {
    background-color: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 15px;
    border-radius: 5px;
}

.explanation-box strong {
    color: #92400e;
}

.explanation-box p {
    margin: 10px 0 0 0;
    color: #333;
}

.action-buttons {
    margin-bottom: 80px;
}

/* ============================================================================
   Paywall Page
   ============================================================================ */

.paywall-icon {
    font-size: 5rem;
    color: #f59e0b;
}

.quiz-preview-locked {
    position: relative;
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.preview-description {
    color: #666;
    margin-bottom: 15px;
}

.preview-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    color: #888;
}

.preview-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.3), rgba(255,255,255,0.95));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: rgba(0,0,0,0.1);
}

.pricing-card {
    background-color: white;
    border: 2px solid #10b981;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}

.pricing-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.pricing-header h4 {
    margin-bottom: 15px;
}

.price {
    font-size: 3rem;
    font-weight: 700;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
}

.price .currency {
    font-size: 2rem;
}

.price .period {
    font-size: 1.2rem;
    font-weight: 400;
}

.pricing-body {
    padding: 30px;
}

.benefits-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
}

.benefits-list li {
    padding: 12px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
}

.benefits-list i {
    font-size: 1.3rem;
}

.pricing-footer {
    padding: 20px 30px 30px 30px;
}

/* ============================================================================
   History Page
   ============================================================================ */

.history-header {
    text-align: center;
    margin-bottom: 30px;
}

.stats-overview {
    margin-bottom: 40px;
}

.stat-box {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-box:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.stat-box .stat-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.stat-box .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-box .stat-label {
    font-size: 0.95rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-quiz-group {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 25px;
    overflow: hidden;
}

.quiz-group-header {
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-group-header h4 {
    margin: 0;
    font-size: 1.2rem;
}

.attempts-list {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.attempt-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    gap: 20px;
}

.attempt-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.9rem;
    color: #666;
}

.attempt-score {
    display: flex;
    align-items: center;
    gap: 15px;
}

.score-badge {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 8px;
    color: white;
}

.score-detail {
    font-size: 0.9rem;
    color: #666;
}

.quiz-group-footer {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
    .quiz-hero h1 {
        font-size: 2rem;
    }

    .category-filter {
        flex-direction: column;
    }

    .filter-btn {
        width: 100%;
    }

    .score-circle {
        width: 200px;
        height: 200px;
    }

    .score-percentage {
        font-size: 2.5rem;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .attempt-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .attempt-score {
        width: 100%;
        justify-content: space-between;
    }

    .quiz-progress-fixed {
        padding: 10px 0;
    }

    .progress-info {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .quiz-info-bar {
        flex-direction: column;
        gap: 15px;
    }

    .question-card {
        padding: 15px;
    }

    .option-item {
        padding: 12px 15px;
    }
}
