/**
 * Frontend Styles
 */

.pdf-mcq-upload-container {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    margin: 20px 0;
    background-color: #fafafa;
    max-width: 1200px;
}

.pdf-mcq-upload-box {
    border: 2px dashed #ccc;
    border-radius: 5px;
    padding: 40px;
    text-align: center;
    margin-bottom: 20px;
}

.pdf-mcq-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.pdf-mcq-btn:hover {
    background: #005a87;
}

.pdf-mcq-btn-primary {
    background: #0073aa;
}

.pdf-mcq-btn-success {
    background: #46b450;
}

.pdf-mcq-btn-success:hover {
    background: #3a9b3e;
}

.pdf-mcq-btn-small {
    padding: 5px 10px;
    font-size: 14px;
}

#pdf-mcq-file-info {
    margin: 10px 0;
    padding: 10px;
    background: #f1f1f1;
    border-radius: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#pdf-mcq-processing {
    text-align: center;
    padding: 50px;
}

.pdf-mcq-loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0073aa;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Questions Display */
#pdf-mcq-questions {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
}

.pdf-mcq-questions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.pdf-mcq-exam-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pdf-mcq-exam-actions .pdf-mcq-btn {
    font-size: 14px;
    padding: 8px 16px;
}

/* Create Exam Form */
.pdf-mcq-create-exam-form {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.pdf-mcq-create-exam-form h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.pdf-mcq-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
}

.pdf-mcq-textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.pdf-mcq-question {
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.question-header h4 {
    margin: 0;
    color: #333;
}

.delete-question {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.delete-question:hover {
    background: #c82333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}

.form-group textarea,
.form-group input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.options-group {
    margin: 15px 0;
}

.option {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f8f8;
    border-radius: 3px;
}

.option input[type="radio"] {
    margin-right: 10px;
}

.option label {
    margin-right: 10px;
    font-weight: bold;
    min-width: 25px;
}

.option-text {
    flex: 1;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.pdf-mcq-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #ddd;
    text-align: center;
}

.pdf-mcq-actions button {
    margin: 0 10px;
}

/* Messages */
.pdf-mcq-error,
.pdf-mcq-success {
    padding: 15px;
    margin: 20px 0;
    border-radius: 3px;
    text-align: center;
    font-weight: bold;
}

.pdf-mcq-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.pdf-mcq-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Beautiful Settings Display Sections */
.pdf-mcq-settings-display {
    background: linear-gradient(135deg, #f0f6fc 0%, #e8f4f8 100%);
    border: 2px solid #c3d9ff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
    position: relative;
    overflow: hidden;
}

.pdf-mcq-settings-display::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, rgba(0, 115, 170, 0.1), transparent);
    border-radius: 0 12px 0 60px;
}

.pdf-mcq-settings-display h4 {
    margin: 0 0 15px 0;
    color: #1d2327;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-mcq-settings-display h4::before {
    content: '✏️';
    font-size: 18px;
}

/* Prompt Textarea Styling */
#pdf-mcq-system-prompt {
    width: 100%;
    background: #ffffff;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    font-size: 14px;
    color: #2c3338;
    line-height: 1.5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#pdf-mcq-system-prompt:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.pdf-mcq-prompt-display {
    background: #ffffff;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    font-size: 13px;
    color: #2c3338;
    max-height: 80px;
    overflow-y: auto;
    line-height: 1.5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

#pdf-mcq-toggle-prompt {
    margin-top: 12px;
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
}

#pdf-mcq-toggle-prompt:hover {
    background: linear-gradient(135deg, #005a87, #004466);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 115, 170, 0.3);
}

/* Prompt Editor Styling */
#pdf-mcq-prompt-editor {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #c3d9ff;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15);
}

#pdf-mcq-prompt-editor h4 {
    margin: 0 0 15px 0;
    color: #1d2327;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

#pdf-mcq-prompt-editor h4::before {
    content: '✏️';
    font-size: 18px;
}

#pdf-mcq-custom-prompt {
    width: 100%;
    border: 2px solid #8c8f94;
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    resize: vertical;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#pdf-mcq-custom-prompt:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

#pdf-mcq-prompt-editor .button {
    margin-right: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

#pdf-mcq-save-prompt {
    background: linear-gradient(135deg, #46b450, #3a9b3e);
    color: white;
    border: none;
    box-shadow: 0 2px 4px rgba(70, 180, 80, 0.2);
}

#pdf-mcq-save-prompt:hover {
    background: linear-gradient(135deg, #3a9b3e, #2e7d32);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(70, 180, 80, 0.3);
}

#pdf-mcq-cancel-prompt {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    border: none;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
}

#pdf-mcq-cancel-prompt:hover {
    background: linear-gradient(135deg, #5a6268, #495057);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(108, 117, 125, 0.3);
}

/* Difficulty Selection Styling */
.pdf-mcq-difficulty-wrapper {
    background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f0 100%);
    border: 2px solid #d1d5db;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.pdf-mcq-difficulty-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, rgba(75, 85, 99, 0.1), transparent);
    border-radius: 0 12px 0 60px;
}

.pdf-mcq-difficulty-wrapper label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #1d2327;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-mcq-difficulty-wrapper label::before {
    content: '⚡';
    font-size: 16px;
}

#pdf-mcq-difficulty {
    width: 100%;
    max-width: 308px;
    /* padding: 10px 15px; */
    border: 2px solid #8c8f94;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    color: #2c3338;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    /* align-items: center; */
    /* gap: 8px; */
}

#pdf-mcq-difficulty:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

#pdf-mcq-difficulty:hover {
    border-color: #646970;
    background: #fafafa;
}

.pdf-mcq-difficulty-wrapper .description {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #646970;
    font-style: italic;
    display: flex;
}

/* Custom Questions Section */
.pdf-mcq-custom-questions-wrapper {
    margin: 30px 0;
    border-top: 2px solid #e0e0e0;
    padding-top: 20px;
}

.pdf-mcq-btn-secondary {
    background: #6c757d;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.pdf-mcq-btn-secondary:hover {
    background: #5a6268;
}

.pdf-mcq-btn-outline {
    background: transparent;
    color: #0073aa;
    border: 2px solid #0073aa;
    transition: all 0.3s ease;
}

.pdf-mcq-btn-outline:hover {
    background: #0073aa;
    color: white;
}

.pdf-mcq-expand-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.pdf-mcq-expand-icon.expanded {
    transform: rotate(180deg);
}

.pdf-mcq-custom-questions-container {
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
}

.pdf-mcq-custom-questions-container.expanded {
    max-height: 2000px;
    opacity: 1;
    padding-top: 20px;
}

.pdf-mcq-custom-questions-header {
    margin-bottom: 20px;
}

.pdf-mcq-custom-questions-header h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.pdf-mcq-custom-questions-header .description {
    margin: 0;
    color: #666;
    font-style: italic;
}

.pdf-mcq-custom-question {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.3s ease;
}

.pdf-mcq-custom-question:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.pdf-mcq-custom-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.pdf-mcq-custom-question-header h5 {
    margin: 0;
    color: #495057;
    font-size: 16px;
}

.pdf-mcq-remove-custom {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.pdf-mcq-remove-custom:hover {
    background: #c82333;
}

.pdf-mcq-custom-actions {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

/* Animation for adding new custom questions */
.pdf-mcq-custom-question.fade-in {
    animation: fadeInSlide 0.5s ease forwards;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .pdf-mcq-upload-container {
        padding: 0 15px;
    }
    
    .question-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .delete-question {
        margin-top: 10px;
    }
    
    .option {
        flex-wrap: wrap;
    }
    
    .option input[type="radio"],
    .option label {
        margin-bottom: 5px;
    }
    
    .option-text {
        width: 100%;
    }
    
    .pdf-mcq-actions button {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
    
    .pdf-mcq-custom-question-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pdf-mcq-custom-question-header h5 {
        margin-bottom: 10px;
    }
}