/* === Quiz Generator (Turbo.ai Style) === */

.quiz-header {
    display: none;
}

/* Quiz Hero Section */
.quiz-hero {
    max-width: 700px;
    margin: 0 auto 3rem;
    text-align: center;
    padding: 0 1rem;
}

.quiz-hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.quiz-hero-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-placeholder);
    margin-bottom: 2.5rem;
    line-height: 1.5;
}

/* Upload Area */
.upload-area {
    background: var(--color-bg-secondary);
    border: 2px dashed var(--color-border-hr);
    border-radius: 1.2rem;
    padding: 3rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.upload-content {
    pointer-events: none;
}

.upload-area:hover {
    border-color: var(--color-hover-primary);
    background: var(--color-hover-secondary);
    box-shadow: 0 8px 24px var(--color-shadow);
}

.upload-area.dragover {
    border-color: var(--color-hover-primary);
    background: var(--color-hover-secondary);
}

.upload-area:hover {
    border-color: var(--color-hover-primary);
    background: var(--color-hover-secondary);
    box-shadow: 0 8px 24px var(--color-shadow);
}

.upload-area.dragover {
    border-color: var(--color-hover-primary);
    background: var(--color-hover-secondary);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    font-size: 3rem;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.upload-subtext {
    font-size: 0.95rem;
    color: var(--color-text-placeholder);
    margin: 0;
}

/* Text Input Section */
.text-input-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.or-divider {
    color: var(--color-text-placeholder);
    font-size: 0.95rem;
    margin: 0;
}

.text-input-box {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 2px solid var(--color-border-hr);
    border-radius: 0.8rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    color: var(--color-text-primary);
    background: var(--color-bg-secondary);
    transition: all 0.3s ease;
    resize: vertical;
}

.text-input-box:focus {
    outline: none;
    border-color: var(--color-hover-primary);
    box-shadow: 0 0 0 3px rgba(105, 92, 254, 0.1);
}

.text-input-box::placeholder {
    color: var(--color-text-placeholder);
}

/* Primary Button */
.btn-primary {
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--color-hover-primary), #7d6ff7);
    color: white;
    border: none;
    border-radius: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(105, 92, 254, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(105, 92, 254, 0.4);
}

/* Premium Gate - Hidden */
.premium-gate {
    display: none;
}

/* Old upload-section styles removed - using quiz-hero instead */
.upload-section {
    display: none;
}

/* Uploaded Files List */
.uploaded-files {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.uploaded-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-bg-secondary);
    padding: 1rem;
    border-radius: 0.8rem;
    border-left: 4px solid var(--color-hover-primary);
    animation: slideIn 0.3s ease-out;
}

.uploaded-file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.uploaded-file-name {
    font-weight: 600;
    color: var(--text-primary);
}

.uploaded-file-size {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.remove-file {
    background: rgba(255, 107, 107, 0.2);
    border: none;
    color: #ff6b6b;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.remove-file:hover {
    background: rgba(255, 107, 107, 0.3);
}

/* Quiz Settings */
.quiz-settings {
    background: rgba(105, 92, 254, 0.05);
    border: 1px solid var(--color-hover-primary);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2.5rem;
}

.quiz-settings h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
}

.setting-group label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.setting-group select {
    padding: 0.75rem;
    border: 1px solid var(--color-hover-primary);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-group select:hover {
    border-color: var(--color-primary);
}

.setting-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(105, 92, 254, 0.1);
}

.actions-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Documents Bar */
.documents-bar {
    background: var(--bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.doc-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.doc-btn {
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.doc-btn:hover {
    border-color: var(--color-hover-primary);
    background: rgba(105, 92, 254, 0.08);
}

.doc-btn.active {
    background: var(--color-hover-primary);
    color: #fff;
    border-color: var(--color-hover-primary);
    box-shadow: 0 0 0 2px rgba(105, 92, 254, 0.2) inset;
}

.doc-delete {
    padding: 0.35rem 0.5rem;
    background: rgba(255, 107, 107, 0.18);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.25);
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 700;
    line-height: 1;
    transition: all 0.2s ease;
}

.doc-delete:hover {
    background: rgba(255, 107, 107, 0.28);
}

.btn-secondary {
    padding: 0.85rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    border-color: var(--color-hover-primary);
    background: rgba(105, 92, 254, 0.08);
    transform: translateY(-1px);
}

.btn-generate {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #695cfe 0%, #6b5cf0 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(105, 92, 254, 0.3);
}

.btn-generate:active {
    transform: translateY(0);
}

.btn-generate.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Quiz Display - Quizlet Style */
.quiz-display {
    animation: popIn 0.4s ease-out;
}

.quiz-display h2 {
    font-size: 1.5rem;
    color: var(--color-text-primary);
    margin-bottom: 2rem;
}

.quiz-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Question Card - Quizlet Style */
.question-card {
    background: white;
    border-radius: 1.2rem;
    padding: 2.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    animation: slideUp 0.4s ease-out;
}

body.dark-theme .question-card {
    background: var(--color-bg-secondary);
}

.question-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--color-hover-primary);
}

.question-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--color-text-placeholder);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--color-bg-secondary);
    border-radius: 3px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-hover-primary), #7d6ff7);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.question-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 2rem;
    line-height: 1.3;
}

.question-type-badge {
    display: inline-block;
    background: rgba(105, 92, 254, 0.15);
    color: var(--color-hover-primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
}

/* Multiple Choice Options - Quizlet Style */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.option-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.option-input {
    width: 28px;
    height: 28px;
    margin-right: 1.5rem;
    cursor: pointer;
    accent-color: var(--color-hover-primary);
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    padding: 1.5rem;
    background: var(--color-bg-secondary);
    border: 2px solid var(--color-border-hr);
    border-radius: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-text-primary);
    transition: all 0.3s ease;
    user-select: none;
    line-height: 1.4;
}

.option-label:hover .option-text {
    border-color: var(--color-hover-primary);
    background: var(--color-hover-secondary);
    transform: translateX(4px);
}

.option-input:checked + .option-text {
    background: linear-gradient(135deg, rgba(105, 92, 254, 0.2), rgba(125, 111, 247, 0.15));
    border-color: var(--color-hover-primary);
    font-weight: 700;
    color: var(--color-hover-primary);
}

/* Short Answer Input */
.short-answer-input {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.1rem;
    border: 2px solid var(--color-border-hr);
    border-radius: 1rem;
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.short-answer-input:focus {
    outline: none;
    border-color: var(--color-hover-primary);
    box-shadow: 0 0 0 3px rgba(105, 92, 254, 0.1);
}

.short-answer-input::placeholder {
    color: var(--color-text-placeholder);
}

/* Quiz Buttons */
.quiz-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn-submit {
    flex: 1;
    min-width: 200px;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--color-hover-primary), #7d6ff7);
    color: white;
    border: none;
    border-radius: 0.8rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(105, 92, 254, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(105, 92, 254, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-new {
    flex: 1;
    min-width: 200px;
    padding: 1.2rem;
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    border: 2px solid var(--color-border-hr);
    border-radius: 0.8rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-new:hover {
    border-color: var(--color-hover-primary);
    background: var(--color-hover-secondary);
    color: var(--color-hover-primary);
}

/* Results - Quizlet Style */
.quiz-results {
    animation: popIn 0.4s ease-out;
    text-align: center;
}

.quiz-results h2 {
    font-size: 1.8rem;
    color: var(--color-text-primary);
    margin-bottom: 2.5rem;
}

.results-card {
    background: white;
    border-radius: 1.2rem;
    padding: 3rem 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

body.dark-theme .results-card {
    background: var(--color-bg-secondary);
}

.score-display {
    margin-bottom: 2.5rem;
}

.score-number {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-hover-primary), #7d6ff7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.score-label {
    font-size: 1.1rem;
    color: var(--color-text-placeholder);
    font-weight: 500;
}

.results-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.result-stat {
    padding: 1.5rem;
    background: var(--color-bg-secondary);
    border-radius: 0.8rem;
    border: 2px solid var(--color-border-hr);
}

.result-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-hover-primary);
}

.result-stat-label {
    font-size: 0.9rem;
    color: var(--color-text-placeholder);
    margin-top: 0.5rem;
}

/* Study Guide */
.study-guide {
    background: var(--bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 1.75rem;
    margin-top: 1.5rem;
    animation: popIn 0.3s ease-out;
}

.panel-header .badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: rgba(105, 92, 254, 0.12);
    color: var(--color-hover-primary);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.8rem;
}

.panel-header h2 {
    margin: 0.35rem 0;
    color: var(--text-primary);
}

.panel-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.guide-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.guide-content h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.guide-content ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.keyword-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    padding: 0.35rem 0.65rem;
    background: rgba(105, 92, 254, 0.12);
    color: var(--text-primary);
    border-radius: 999px;
    border: 1px solid rgba(105, 92, 254, 0.25);
    font-size: 0.85rem;
}

/* Flashcards */
.flashcards {
    background: var(--bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 1.75rem;
    margin-top: 1.5rem;
    display: grid;
    gap: 1rem;
    animation: popIn 0.3s ease-out;
}

.flashcards-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.flashcard {
    background: rgba(105, 92, 254, 0.05);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 1rem;
    display: grid;
    gap: 0.5rem;
}

.flashcard-term {
    font-weight: 700;
    color: var(--text-primary);
}

.flashcard-definition {
    color: var(--text-secondary);
}

.quiz-results h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.results-card {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 2rem;
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

.score-display {
    text-align: center;
    flex: 0 0 200px;
}

.score-number {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #695cfe 0%, #6b5cf0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.score-label {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.results-details {
    flex: 1;
}

.result-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
}

.result-icon {
    font-size: 1.5rem;
    flex: 0 0 30px;
}

.result-text {
    flex: 1;
}

.result-question {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.result-answer {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.result-correct {
    color: #51cf66;
}

.result-incorrect {
    color: #ff6b6b;
}

/* Animations */
@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading State */
.loading-dots {
    display: inline-block;
}

.loading-dots span {
    animation: blink 1.4s infinite;
    margin: 0 2px;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0%, 60%, 100% {
        opacity: 0.5;
    }
    30% {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .quiz-header .page-title {
        font-size: 1.75rem;
    }

    .gate-card {
        padding: 2rem;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .results-card {
        flex-direction: column;
        text-align: center;
    }

    .score-display {
        flex: 1;
    }

    .results-details {
        width: 100%;
    }

    .quiz-buttons {
        flex-direction: column;
    }

    .btn-submit,
    .btn-new {
        width: 100%;
    }
}
