/* Quiz Generator Styles */
.inhouse-quiz-generator {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Tabs */
.quiz-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
    overflow-x: auto;
}

.quiz-tab {
    background: transparent;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.quiz-tab:hover {
    color: #374151;
    background: #f9fafb;
}

.quiz-tab.active {
    color: var(--quiz-primary, #8b5cf6);
    border-bottom-color: var(--quiz-primary, #8b5cf6);
}

.quiz-tab .tab-icon {
    font-size: 18px;
}

/* Tab Content */
.quiz-tab-content {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 24px;
    min-height: 200px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Text Input */
.quiz-textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.quiz-textarea::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.quiz-textarea:focus {
    outline: none;
    border-color: var(--quiz-primary, #8b5cf6);
}

/* File Upload */
.quiz-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.quiz-upload-area:hover {
    border-color: var(--quiz-primary, #8b5cf6);
    background: #f3f4f6;
}

.quiz-upload-area.drag-over {
    border-color: var(--quiz-primary, #8b5cf6);
    background: #ede9fe;
}

.upload-placeholder .upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-placeholder .upload-text {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.upload-placeholder .upload-formats {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

.upload-placeholder .upload-size {
    font-size: 12px;
    color: #9ca3af;
}

.upload-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f3f4f6;
    border-radius: 8px;
    gap: 12px;
}

.upload-preview .file-name {
    font-weight: 500;
    color: #374151;
    flex: 1;
}

.upload-preview .file-size {
    font-size: 13px;
    color: #6b7280;
}

.upload-preview .remove-file {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: transform 0.2s ease;
}

.upload-preview .remove-file:hover {
    transform: scale(1.2);
}

/* URL/YouTube Input */
.quiz-label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

.quiz-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.quiz-input::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.quiz-input:focus {
    outline: none;
    border-color: var(--quiz-primary, #8b5cf6);
}

.quiz-help-text {
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

/* Quick Settings Row */
.quiz-settings-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .quiz-settings-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .quiz-settings-row {
        grid-template-columns: 1fr;
    }
}

.quiz-setting {
    display: flex;
    flex-direction: column;
}

.quiz-select {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.quiz-select:focus {
    outline: none;
    border-color: var(--quiz-primary, #8b5cf6);
}

/* Advanced Settings */
.quiz-advanced-settings {
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.quiz-advanced-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    transition: background 0.3s ease;
}

.quiz-advanced-toggle:hover {
    background: #f3f4f6;
}

.quiz-advanced-toggle .toggle-icon {
    font-size: 18px;
}

.quiz-advanced-toggle .toggle-text {
    flex: 1;
    text-align: left;
}

.quiz-advanced-toggle .toggle-arrow {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.quiz-advanced-toggle.active .toggle-arrow {
    transform: rotate(180deg);
}

.quiz-advanced-content {
    padding: 24px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
}

.advanced-section {
    margin-bottom: 24px;
}

.advanced-section:last-child {
    margin-bottom: 0;
}

.advanced-heading {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.radio-label:hover {
    background: #f9fafb;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--quiz-primary, #8b5cf6);
}

.radio-label span {
    font-size: 14px;
    color: #374151;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.checkbox-label:hover {
    background: #f9fafb;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--quiz-primary, #8b5cf6);
}

.checkbox-label span {
    font-size: 14px;
    color: #374151;
}

/* Action Buttons */
.quiz-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 30px;
}

@media (max-width: 480px) {
    .quiz-actions {
        flex-direction: column;
    }
}

.quiz-btn-generate,
.quiz-btn-reset {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-btn-generate {
    background: var(--quiz-button, #7c3aed);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.quiz-btn-generate:hover {
    background: var(--quiz-button-hover, #6d28d9);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

.quiz-btn-generate:active {
    transform: translateY(0);
}

.quiz-btn-generate:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.quiz-btn-generate .btn-icon {
    font-size: 18px;
}

.quiz-btn-reset {
    background: #ffffff;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.quiz-btn-reset:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Loading State */
.quiz-loading {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 30px;
}

.quiz-loading .loading-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

.quiz-loading .loading-text {
    font-size: 18px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 20px;
}

.quiz-loading .loading-progress {
    max-width: 300px;
    margin: 0 auto 12px;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.quiz-loading .loading-bar {
    height: 100%;
    background: var(--quiz-primary, #8b5cf6);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.quiz-loading .loading-status {
    font-size: 14px;
    color: #6b7280;
}

/* Interactive Quiz Results */
.quiz-results {
    animation: fadeIn 0.5s ease;
}

.quiz-results-header {
    background: linear-gradient(135deg, var(--quiz-primary, #8b5cf6) 0%, var(--quiz-button, #7c3aed) 100%);
    color: #ffffff;
    padding: 24px 30px;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.quiz-results-header .success-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.quiz-results-header h3 {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 600;
}

.quiz-results-header .results-meta {
    font-size: 14px;
    opacity: 0.9;
}

.quiz-results-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-top: none;
    flex-wrap: wrap;
}

.quiz-results-actions button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-results-actions button:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Download Dropdown */
.download-dropdown {
    position: relative;
    display: inline-block;
}

.download-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 1000;
}

.download-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    transition: background 0.2s ease;
}

.download-menu a:first-child {
    border-radius: 6px 6px 0 0;
}

.download-menu a:last-child {
    border-radius: 0 0 6px 6px;
}

.download-menu a:hover {
    background: #f3f4f6;
}

.quiz-questions-container {
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 12px 12px;
}

/* Interactive Question Card */
.quiz-question-card {
    padding: 30px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.quiz-question-card:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.quiz-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.question-number {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-difficulty {
    font-size: 13px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 12px;
}

.question-difficulty.easy {
    background: #d1fae5;
    color: #065f46;
}

.question-difficulty.medium {
    background: #fef3c7;
    color: #92400e;
}

.question-difficulty.hard {
    background: #fee2e2;
    color: #991b1b;
}

.quiz-question-text {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Interactive Options */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.quiz-option {
    padding: 14px 18px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.quiz-option:hover:not(.disabled) {
    background: #f3f4f6;
    border-color: var(--quiz-primary, #8b5cf6);
}

.quiz-option.selected {
    background: #ede9fe;
    border-color: var(--quiz-primary, #8b5cf6);
    color: var(--quiz-primary, #8b5cf6);
    font-weight: 500;
}

.quiz-option.correct {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
    font-weight: 500;
}

.quiz-option.incorrect {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
    font-weight: 500;
}

.quiz-option.disabled {
    cursor: not-allowed;
}

.quiz-option.correct::before {
    content: '✓ ';
    font-weight: bold;
}

.quiz-option.incorrect::before {
    content: '✗ ';
    font-weight: bold;
}

/* Short Answer Input */
.quiz-answer-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    margin-bottom: 20px;
}

.quiz-answer-input::placeholder {
    color: #9ca3af;
}

.quiz-answer-input:focus {
    outline: none;
    border-color: var(--quiz-primary, #8b5cf6);
}

.quiz-answer-input.disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

/* Correct Answer Display */
.quiz-answer {
    padding: 14px 18px;
    background: #d1fae5;
    border: 2px solid #10b981;
    border-radius: 8px;
    font-size: 15px;
    color: #065f46;
    font-weight: 500;
    margin-bottom: 20px;
}

.quiz-answer strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Explanation */
.quiz-explanation {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 16px 18px;
    border-radius: 6px;
}

.quiz-explanation strong {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #1e40af;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quiz-explanation p {
    margin: 0;
    font-size: 14px;
    color: #1e40af;
    line-height: 1.6;
}

/* Submit Quiz Button */
.quiz-submit-container {
    text-align: center;
    padding: 30px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0 0 12px 12px;
}

.quiz-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: var(--quiz-button, #7c3aed);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.quiz-submit-btn:hover {
    background: var(--quiz-button-hover, #6d28d9);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

.quiz-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Score Display */
.quiz-score {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border-radius: 12px 12px 0 0;
}

.quiz-score .score-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.quiz-score h3 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
}

.quiz-score .score-text {
    font-size: 16px;
    opacity: 0.95;
}

/* Error Messages */
.quiz-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    color: #991b1b;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quiz-error::before {
    content: '⚠️';
    font-size: 20px;
}

/* Utilities */
.quiz-hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .quiz-tab-content {
        padding: 20px;
    }
    
    .quiz-question-card {
        padding: 20px;
    }
    
    .quiz-question-text {
        font-size: 16px;
    }
}
