/* ========================================
   QUIZZES — Listing + Quiz Taking Styles
   ======================================== */

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: "Inter";
}

/* ===== SHARED TOKENS ===== */
.quizzes-page,
.quiz-play-page {
    --primary: #0F1115;
    --secondary: #D4AF37;
    --accent: #D4AF37;
    --bg: #0F1115;
    --card: #1C1F26;
    --text: #FFFFFF;
    --muted: #94A3B8;
    font-family: "Poppins", "Inter", sans-serif;
}

/* =========================================================
   PART 1 — QUIZZES LISTING PAGE (.quizzes-page)
   ========================================================= */

.quizzes-page {
    padding: 100px 20px 60px;
    min-height: 80vh;
    max-width: 1240px;
    margin: 0 auto;
}

/* ===== HERO ===== */
.quiz-hero {
    max-width: 1200px;
    margin: 0 auto 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.quiz-hero-text h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
    line-height: 1.25;
}

.quiz-hero-text h1 span {
    color: var(--secondary);
}

.quiz-hero-text p {
    color: var(--muted);
    max-width: 480px;
    line-height: 1.65;
    font-size: 14px;
}

.quiz-hero-icon {
    font-size: 100px;
    color: rgba(212, 175, 55, 0.15);
}

/* ===== FILTERS & CONTROLS ===== */
.quiz-controls {
    max-width: 1200px;
    margin: 0 auto 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.quiz-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.quiz-filter-btn {
    padding: 8px 18px;
    border-radius: 999px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    white-space: nowrap;
}

.quiz-filter-btn.active,
.quiz-filter-btn:hover {
    background: #D4AF37;
    color: #0F1115;
}

.quiz-search-wrapper {
    position: relative;
    min-width: 260px;
    flex: 1;
    max-width: 360px;
}

.quiz-search-wrapper .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 14px;
    pointer-events: none;
    transition: color 0.3s ease;
}

.quiz-search-wrapper input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #252830;
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-search-wrapper input::placeholder {
    color: var(--muted);
}

.quiz-search-wrapper input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

.quiz-search-wrapper input:focus ~ .search-icon {
    color: var(--secondary);
}

/* ===== QUIZ GRID ===== */
.quiz-listing-grid {
    max-width: 1200px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ===== QUIZ CARD ===== */
.quiz-listing-card {
    background: linear-gradient(180deg, #1C1F26, #0F1115);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: 0.35s ease;
    border: 1px solid #252830;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    color: var(--text);
    height: 320px;
}

.quiz-listing-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right,
            rgba(212, 175, 55, 0.25),
            transparent 60%);
    opacity: 0;
    transition: 0.35s;
}

.quiz-listing-card:hover::before {
    opacity: 1;
}

.quiz-listing-card:hover {
    border-color: rgba(212, 175, 55, 0.45);
    color: var(--text);
    text-decoration: none;
}

.quiz-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.quiz-card-icon {
    font-size: 28px;
    color: var(--secondary);
    position: relative;
    z-index: 1;
}

.quiz-card-xp {
    background: rgba(212, 175, 55, 0.12);
    color: var(--secondary);
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 1;
}

.quiz-card-status {
    font-size: 11.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    z-index: 1;
}

.quiz-listing-card.completed .quiz-card-status {
    color: #22c55e;
}

.quiz-listing-card h3 {
    font-size: 17px;
    font-weight: 650;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 48px;
    line-height: 1.4;
}

.quiz-listing-card .quiz-card-desc {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 60px;
}

.quiz-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #CBD5E1;
    position: relative;
    z-index: 1;
    margin-top: auto;
}

.quiz-card-meta span i {
    margin-right: 5px;
    color: var(--accent);
}

/* ===== Listing Responsive ===== */
@media (max-width: 1024px) {
    .quiz-listing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .quizzes-page {
        padding: 85px 16px 40px;
    }

    .quiz-hero {
        flex-direction: column;
        text-align: center;
        margin-bottom: 30px;
        gap: 12px;
    }

    .quiz-hero-icon {
        display: none;
    }

    .quiz-hero-text h1 {
        font-size: 28px;
    }

    .quiz-hero-text p {
        margin: 0 auto;
        font-size: 13.5px;
    }

    .quiz-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 28px;
    }

    .quiz-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        margin-bottom: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        width: 100%;
    }

    .quiz-filters::-webkit-scrollbar {
        display: none;
    }

    .quiz-search-wrapper {
        max-width: 100%;
        min-width: 100%;
    }
}

@media (max-width: 640px) {
    .quiz-listing-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .quiz-listing-card {
        padding: 20px;
        height: auto;
        min-height: 240px;
        border-radius: 18px;
    }

    .quiz-listing-card h3 {
        font-size: 15.5px;
        height: auto;
        max-height: 48px;
        margin-bottom: 6px;
    }

    .quiz-listing-card .quiz-card-desc {
        font-size: 12.5px;
        height: auto;
        max-height: 56px;
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .quizzes-page {
        padding: 80px 12px 30px;
    }

    .quiz-hero-text h1 {
        font-size: 23px;
    }
}

/* =========================================================
   PART 2 — QUIZ TAKING PAGE (.quiz-play-page)
   ========================================================= */

.quiz-play-page {
    padding: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
}

.quiz-shell {
    width: 100%;
    max-width: 100%;
    background: var(--card);
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 100vh;
}

/* ===== LEFT PANEL ===== */
.quiz-info {
    background: linear-gradient(180deg, #1C1F26, #0F1115);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.quiz-info h2 {
    font-size: 26px;
    margin-bottom: 10px;
    color: #fff;
}

.quiz-info>div>p {
    font-size: 14px;
    color: #CBD5E1;
    line-height: 1.6;
}

.quiz-info-meta {
    margin-top: 25px;
    display: grid;
    gap: 12px;
}

.quiz-meta-item {
    background: rgba(255, 255, 255, 0.08);
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #CBD5E1;
}

.quiz-progress-ring {
    margin-top: 40px;
    text-align: center;
    color: #CBD5E1;
}

.quiz-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--secondary) 0deg,
            rgba(255, 255, 255, 0.1) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    transition: background 0.5s ease;
}

.quiz-ring span {
    font-size: 22px;
    font-weight: 600;
    color: #0F1115;
    background: var(--secondary);
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== RIGHT PANEL ===== */
.quiz-body {
    padding: 40px;
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 30px;
}

.quiz-question-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.quiz-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-question-header h3 {
    font-size: 22px;
    color: var(--text);
}

.quiz-timer {
    background: rgba(255, 255, 255, 0.08);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.quiz-question-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
}

.quiz-question-card h4 {
    font-size: 20px;
    margin-bottom: 25px;
    line-height: 1.5;
    color: var(--text);
}

.quiz-question-img {
    max-width: 80%;
    max-height: 250px;
    display: block;
    margin: 0 auto 25px auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    object-fit: contain;
    background: rgba(0, 0, 0, 0.2);
}

.quiz-answers {
    display: grid;
    gap: 15px;
}

.quiz-answer {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 16px 18px;
    cursor: pointer;
    transition: 0.3s;
    border: 2px solid transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
}

.quiz-answer:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(212, 175, 55, 0.6);
}

.quiz-answer.selected {
    background: rgba(212, 175, 55, 0.12);
    border-color: #D4AF37;
}

.quiz-answer.correct-choice {
    background: rgba(212, 175, 55, 0.2) !important;
    border-color: var(--accent) !important;
    color: #F5D77F !important;
}

.quiz-answer.wrong-choice {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}

/* ===== ACTIONS ===== */
.quiz-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    font-family: inherit;
}

.quiz-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #FFFFFF;
    border: 1px solid #252830;
    border-radius: 10px;
}

.quiz-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(212, 175, 55, 0.45);
}

.quiz-btn-primary {
    background: #D4AF37;
    color: #0F1115;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.quiz-btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transition: left 0.5s ease;
}

.quiz-btn-primary:hover::after {
    left: 120%;
}

.quiz-btn-primary:active {
    transform: scale(0.98);
}

.quiz-btn:disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ===== HINT ===== */
.quiz-hint-container {
    margin-top: 15px;
}

.quiz-hint-container .quiz-btn {
    font-size: 14px;
    padding: 10px 18px;
}

.quiz-hint-text {
    font-size: 14px;
    line-height: 1.5;
    color: #F5D77F;
    padding: 10px;
    border-left: 3px solid #D4AF37;
    background: rgba(212, 175, 55, 0.08);
    border-radius: 8px;
    animation: quizFadeIn 0.4s ease forwards;
    margin-top: 12px;
}

@keyframes quizFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== FEEDBACK PANEL ===== */
.quiz-answer-panel {
    align-self: start;
}

.quiz-answer-panel h4 {
    font-size: 15px;
    color: var(--muted);
    margin-bottom: 12px;
}

.quiz-feedback {
    cursor: default;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    padding: 16px 18px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 80px;
    transition: 0.3s;
}

.quiz-feedback.correct {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--accent);
}

.quiz-feedback.locked {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.28);
}

.quiz-feedback.wrong {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

/* =========================================================
   RESPONSIVE — QUIZ TAKING PAGE
   ========================================================= */

/* Tablets */
@media (max-width: 1100px) {
    .quiz-shell {
        grid-template-columns: 250px 1fr;
    }

    .quiz-info {
        padding: 25px;
    }

    .quiz-body {
        padding: 30px;
        grid-template-columns: 1fr 220px;
        gap: 20px;
    }

    .quiz-question-card h4 {
        font-size: 18px;
    }

    .quiz-answer {
        padding: 14px 16px;
        font-size: 14px;
    }

    .quiz-btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .quiz-ring {
        width: 100px;
        height: 100px;
    }

    .quiz-ring span {
        width: 76px;
        height: 76px;
        font-size: 18px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .quiz-shell {
        grid-template-columns: 1fr;
    }

    .quiz-info {
        display: none;
    }

    .quiz-body {
        padding: 20px;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .quiz-question-card {
        padding: 20px;
    }

    .quiz-question-card h4 {
        font-size: 16px;
        margin-bottom: 20px;
    }

    .quiz-answer {
        padding: 12px 14px;
        font-size: 14px;
    }

    .quiz-actions {
        flex-direction: column;
        gap: 12px;
    }

    .quiz-btn {
        width: 100%;
        padding: 12px 0;
    }

    .quiz-hint-container {
        margin-top: 12px;
    }

    .quiz-hint-text {
        font-size: 13px;
        padding: 8px;
    }

    .quiz-timer {
        font-size: 12px;
        padding: 6px 10px;
    }

    .quiz-question-header h3 {
        font-size: 18px;
    }

    .quiz-play-page {
        padding: 0;
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .quiz-play-page {
        padding: 0;
    }

    .quiz-body {
        padding: 15px;
    }

    .quiz-question-card h4 {
        font-size: 15px;
    }

    .quiz-answer {
        font-size: 13px;
        padding: 10px 12px;
    }

    .quiz-hint-text {
        font-size: 12px;
        padding: 6px;
    }

    .quiz-btn {
        font-size: 13px;
        padding: 10px 0;
    }
}

/* =========================================================
   ANSWER STATES — Correct / Wrong
   ========================================================= */

.quiz-answer.correct-answer {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--accent);
    color: #fff;
}

.quiz-answer.wrong-answer {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #fca5a5;
}

/* =========================================================
   RESULTS SCREEN
   ========================================================= */

.quiz-results {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    animation: quizFadeIn 0.6s ease forwards;
}

.quiz-results-card {
    background: linear-gradient(180deg, #1C1F26, #0F1115);
    border: 1px solid #252830;
    border-radius: 28px;
    padding: 20px 40px;
    max-width: 560px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.quiz-results-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: quizBounce 0.6s ease;
}

@keyframes quizBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.quiz-results-card h2 {
    font-size: 32px;
    color: var(--text);
    margin-bottom: 8px;
}

.results-subtitle {
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 35px;
    line-height: 1.5;
}

/* Score ring */
.results-score-ring {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(var(--secondary) 0deg,
            rgba(255, 255, 255, 0.1) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 35px;
    transition: background 0.8s ease;
}

.results-score-ring span {
    font-size: 26px;
    font-weight: 700;
    color: #0F1115;
    background: var(--secondary);
    width: 106px;
    height: 106px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Stats grid */
.results-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 35px;
}

.results-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.results-stat i {
    font-size: 22px;
}

.results-stat i.fa-check-circle {
    color: var(--accent);
}

.results-stat i.fa-times-circle {
    color: #ef4444;
}

.results-stat i.fa-forward {
    color: var(--muted);
}

.results-stat i.fa-bolt {
    color: var(--secondary);
}

.results-stat span {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.results-stat small {
    font-size: 12px;
    color: var(--muted);
}

/* Results actions */
.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.results-actions .quiz-btn {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Results Responsive ===== */
@media (max-width: 768px) {
    .quiz-results-card {
        padding: 35px 25px;
    }

    .quiz-results-card h2 {
        font-size: 26px;
    }

    .results-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .results-score-ring {
        width: 120px;
        height: 120px;
    }

    .results-score-ring span {
        width: 90px;
        height: 90px;
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .quiz-results-card {
        padding: 25px 15px;
    }

    .results-actions {
        flex-direction: column;
    }

    .results-actions .quiz-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== NO RESULTS STATE ===== */
.no-results-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    max-width: 500px;
    margin: 30px auto;
}

.no-results-icon {
    font-size: 48px;
    color: var(--muted);
    margin-bottom: 20px;
}

.no-results-state h3 {
    font-size: 20px;
    color: #ffffff;
    margin-bottom: 10px;
}

.no-results-state p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.no-results-state .quiz-filter-btn {
    display: inline-block;
    padding: 10px 24px;
}