/* ================================================
   Quizzes List Page Styles
   Optimized for SEO and mobile responsiveness
   ================================================ */

/* ================================================
   DESCRIPTION SECTION (NEW)
   ================================================ */

.quizzes-description-section {
    margin-bottom: 2rem;
    margin-top: 1rem;
}

.description-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border: 1.5px solid rgba(102, 126, 234, 0.15);
    border-radius: 0.3rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.description-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.description-title i {
    color: #667eea;
}

.description-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666;
    margin: 0 0 1rem 0;
}

.description-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
}

.description-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

.description-features i {
    color: #667eea;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* ================================================
   PAGE HEADER
   ================================================ */

.page-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 60%, #7c3aed 100%);
    color: white;
    padding: 0.7rem 0 0.8rem;
    margin-bottom: 1.25rem;
    border-radius: 0.2rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
}

.page-header-title {
    font-size: clamp(1.7rem, 4vw, 2.35rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
}

.page-header-sub {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0.3rem 0 0;
}

/* ================================================
   ACTION BAR (Search + Count)
   ================================================ */

.quizzes-action-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.quizzes-counter {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.quizzes-count {
    color: #333;
}

.quizzes-search {
    flex: 1;
    min-width: 160px;
}

.quizzes-search .form-control {
    border-radius: 0.2rem;
    border: 1.5px solid #e0e0e0;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    padding: 0.5rem 0.75rem;
}

.quizzes-search .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.quizzes-search .form-control::placeholder {
    color: #999;
}

/* ================================================
   FORM SECTIONS (Section wrappers)
   ================================================ */

.form-section {
    margin-bottom: 2.5rem;
    background: #fafbfc;
    border-radius: 0.2rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #667eea;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: #667eea;
    font-size: 1.2rem;
}

/* ================================================
   QUIZZES CONTAINER
   ================================================ */

.quizzes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

/* Responsive grid for smaller screens */
@media (max-width: 768px) {
    .quizzes-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .quizzes-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================================================
   QUIZ CARD
   ================================================ */

.quiz-card {
    background: white;
    border-radius: 0.3rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
}

.quiz-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #e0e7ff;
}

.quiz-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.quiz-card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.quiz-card-body {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.quiz-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    flex-grow: 1;
}

.quiz-description.text-muted {
    color: #999;
    font-style: italic;
}

/* Info badges */
.quiz-info-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.quiz-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(102, 126, 234, 0.08);
    color: #667eea;
    border-radius: 0.2rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
    white-space: nowrap;
}

.quiz-badge i {
    font-size: 0.85rem;
}

/* Footer with buttons */
.quiz-footer {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.btn-quiz {
    flex: 1;
    padding: 0.65rem 0.75rem;
    border: none;
    border-radius: 0.3rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.btn-take {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.btn-take:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    color: white;
}

/* ================================================
   EMPTY STATE
   ================================================ */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #999;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    color: #667eea;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #333;
}

.empty-state p {
    font-size: 0.9rem;
    margin: 0;
    color: #999;
}

/* ================================================
   DARK MODE SUPPORT
   ================================================ */

[data-bs-theme="dark"] .page-header {
    background: linear-gradient(135deg, #1a2d6e 0%, #1e1248 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .description-card {
    background: linear-gradient(135deg, rgba(126, 180, 255, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-color: rgba(126, 180, 255, 0.15);
}

[data-bs-theme="dark"] .description-title {
    color: #dce8f8;
}

[data-bs-theme="dark"] .description-text {
    color: #9aacbf;
}

[data-bs-theme="dark"] .description-features li {
    color: #9aacbf;
}

[data-bs-theme="dark"] .description-features i {
    color: #7eb4ff;
}

[data-bs-theme="dark"] .form-section {
    background: #121a2a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .section-title {
    color: #dce8f8;
    border-bottom-color: #7eb4ff;
}

[data-bs-theme="dark"] .section-title i {
    color: #7eb4ff;
}

[data-bs-theme="dark"] .quiz-card {
    background: #121a2a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-color: #243042;
}

[data-bs-theme="dark"] .quiz-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border-color: #7eb4ff;
}

[data-bs-theme="dark"] .quiz-card-header {
    background: linear-gradient(135deg, #1a2d6e 0%, #1e1248 100%);
}

[data-bs-theme="dark"] .quiz-description {
    color: #9aacbf;
}

[data-bs-theme="dark"] .quiz-info-badges {
    border-top-color: #243042;
}

[data-bs-theme="dark"] .quiz-badge {
    background: rgba(126, 180, 255, 0.07);
    color: #9aacbf;
    border-color: rgba(126, 180, 255, 0.15);
}

[data-bs-theme="dark"] .quizzes-counter {
    color: #9aacbf;
}

[data-bs-theme="dark"] .quizzes-count {
    color: #dce8f8;
}

[data-bs-theme="dark"] .quizzes-search .form-control {
    background-color: #0f1727;
    border-color: #243042;
    color: #edf3ff;
}

[data-bs-theme="dark"] .quizzes-search .form-control:focus {
    border-color: #7eb4ff;
    box-shadow: 0 0 0 3px rgba(126, 180, 255, 0.1);
}

[data-bs-theme="dark"] .quizzes-search .form-control::placeholder {
    color: #5a6e84;
}

[data-bs-theme="dark"] .empty-state {
    color: #9aacbf;
}

[data-bs-theme="dark"] .empty-state i {
    color: #7eb4ff;
}

[data-bs-theme="dark"] .empty-state h3 {
    color: #dce8f8;
}

[data-bs-theme="dark"] .empty-state p {
    color: #6a7d92;
}

/* ================================================
   MOBILE OPTIMIZATION
   ================================================ */

@media (max-width: 576px) {
    .page-header {
        padding: 0.5rem 0 0.7rem;
        margin-bottom: 1rem;
    }

    .page-header-title {
        font-size: 1.5rem;
    }

    .page-header-sub {
        font-size: 0.9rem;
    }

    .quizzes-description-section {
        margin-bottom: 1.5rem;
        margin-top: 0.5rem;
    }

    .description-card {
        padding: 1rem;
    }

    .description-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .description-text {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    .description-features {
        gap: 0.5rem;
        grid-template-columns: 1fr;
    }

    .description-features li {
        font-size: 0.85rem;
    }

    .quizzes-action-bar {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .quizzes-counter {
        font-size: 0.8rem;
    }

    .quizzes-search {
        min-width: 100px;
    }

    .quizzes-search .form-control {
        font-size: 0.8rem;
        padding: 0.4rem 0.5rem;
    }

    .form-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .section-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }

    .quiz-card-header {
        padding: 1rem;
    }

    .quiz-card-title {
        font-size: 0.95rem;
    }

    .quiz-card-body {
        padding: 1rem;
    }

    .quiz-description {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .quiz-info-badges {
        gap: 0.3rem;
        margin-bottom: 0.75rem;
        padding-top: 0.5rem;
    }

    .quiz-badge {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }

    .quiz-footer {
        gap: 0.4rem;
    }

    .btn-quiz {
        padding: 0.5rem 0.5rem;
        font-size: 0.8rem;
    }

    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state i {
        font-size: 3rem;
        margin-bottom: 0.75rem;
    }

    .empty-state h3 {
        font-size: 1.1rem;
    }

    .empty-state p {
        font-size: 0.85rem;
    }
}

/* Tablet optimization */
@media (min-width: 577px) and (max-width: 768px) {
    .page-header {
        margin-bottom: 1.15rem;
    }

    .page-header-title {
        font-size: 1.8rem;
    }

    .description-card {
        padding: 1.25rem;
    }

    .description-title {
        font-size: 1.2rem;
    }

    .description-features {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .quiz-card-header {
        padding: 1.1rem;
    }

    .quiz-card-body {
        padding: 1.1rem;
    }
}

/* Large screens - optimize grid further */
@media (min-width: 1400px) {
    .quizzes-container {
        grid-template-columns: repeat(4, 1fr);
    }

    .description-features {
        grid-template-columns: repeat(4, 1fr);
    }
}
