/**
 * GP Paper 2 Question Generator Styles
 * CSS styling for the GP Paper 2 question generation interface
 * Includes GP Worksheet Style integration
 */

/* GP Worksheet Styles - From GP Worksheet Style.html */
.akademi-worksheet-container {
    display: flex;
    gap: 20px;
    overflow: hidden;
}

.akademi-left-panel {
    flex: 1;
    border-right: 1px solid #ddd;
}

.akademi-right-panel {
    flex: 1;
    padding: 20px;
}

.akademi-tab-buttons {
    display: flex;
    list-style: none;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    margin: 0;
    padding: 0;
}

.akademi-tab-button {
    flex: 1;
    padding: 12px 20px;
    cursor: pointer;
    background: #f8f9fa;
    border: none;
    border-bottom: 2px solid transparent;
    text-align: center;
    transition: all 0.2s ease;
    color: #666;
}

.akademi-tab-button:hover {
    background: #e9ecef;
    color: #333;
}

.akademi-tab-button.akademi-active {
    background: white;
    color: #333;
    border-bottom-color: #007bff;
    font-weight: 500;
}

.akademi-tab-content-container {
    position: relative;
    min-height: 500px;
}

.akademi-tab-content {
    display: none;
    padding: 20px;
    height: 100%;
}

.akademi-tab-content.akademi-active {
    display: block;
}

.akademi-content-area {
    line-height: 1.6;
}

.akademi-content-area h3 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.akademi-content-area p {
    margin-bottom: 15px;
    color: #555;
    text-align: justify;
}

.akademi-insert-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
}

.akademi-insert-box ul {
    margin-top: 10px;
    padding-left: 20px;
}

.akademi-insert-box li {
    margin-bottom: 5px;
}

.akademi-questions-container h3 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.akademi-question-item {
    margin-bottom: 20px;
}

.akademi-question-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.akademi-answer-box {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.akademi-answer-box:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.akademi-answer-box.akademi-large-box {
    min-height: 120px;
}

.feedback, .resoning, .marks {
    font-family: "Geist", sans-serif !important;
}

.passage-1 p, .passage-2 p, .passage-3 p {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.75;
}

.passage-1 .textsynopsis, .passage-2 .textsynopsis, .passage-3 .textsynopsis {
    margin-bottom: 24px;
    display: block;
}

.mwai-form-output {
    border: 1px solid #ccc;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
}

.mwai-form-output .feedback-header {
    font-size: 1.5em;
    color: #2a4d8f;
    margin-bottom: 15px;
    font-weight: bold;
    letter-spacing: 1px;
}

.marking-report-header {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 18px; 
}

.GP-Paper-2-suggested-answer ul {
    list-style-type: disc !important;
    margin-left: 2em;
    padding-left: 0;
}

.GP-Paper-2-suggested-answer li {
    display: list-item !important;
}

/* Ensure Mark Scheme displays as bullet list */
.GP-Paper-2-mark-scheme ul {
    list-style-type: disc !important;
    margin-left: 2em;
    padding-left: 0;
}

.GP-Paper-2-mark-scheme li {
    display: list-item !important;
}

/* Ensure the top instructions list uses bullets */
.GP-Paper-2-output-question-1-to-9 > ul {
    list-style-type: disc !important;
    margin-left: 2em;
    padding-left: 0;
}

.GP-Paper-2-output-question-1-to-9 > ul > li {
    display: list-item !important;
}

/* Edit notice banner */
.gp-edit-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Question Cards */
.gp-q-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 14px;
    margin: 18px 0;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.gp-q-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.gp-q-card-header {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.17em; /* h3-equivalent */
}

/* Apply same card styling to passages */
.GP-Paper-2-output .passage-1,
.GP-Paper-2-output .passage-2,
.GP-Paper-2-output .passage-3 {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 16px;
    margin: 18px 0;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    border-left: 4px solid #0ABAB5;
}
.GP-Paper-2-output .passage-2 { border-left-color: #007bff; }
.GP-Paper-2-output .passage-3 { border-left-color: #28a745; }
.GP-Paper-2-output .passage-1:hover,
.GP-Paper-2-output .passage-2:hover,
.GP-Paper-2-output .passage-3:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.GP-Paper-2-output .passage-1 h4,
.GP-Paper-2-output .passage-2 h4,
.GP-Paper-2-output .passage-3 h4 {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* Hide the visible word count display but keep it in DOM for counting integrity */
.word-count-display { display: none !important; }



.gp-q-section {
    padding: 14px;
    border-left: 4px solid #0ABAB5;
    border-radius: 8px;
    margin: 12px 0;
    position: relative;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.gp-q-prompt { border-left-color: #0ABAB5; }
.gp-q-mark-scheme { border-left-color: #007bff; }
.gp-q-suggested { border-left-color: #28a745; }
.gp-q-marks { border-left-color: #6c757d; }

/* Hide edit icon in the Marks section (non-editable) */
.gp-q-marks .edit-icon { display: none !important; }

.gp-q-section[data-editable="true"]:hover {
    background: rgba(10,186,181,0.06);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.gp-q-section strong { display:block; margin-bottom:6px; color:#2c3e50; font-size: 1.05rem; }

.gp-q-section-header { display:flex; align-items:center; justify-content: space-between; gap:8px; margin-bottom:6px; }

/* Edit icons */
.edit-icon {
    width: 20px; height: 20px;
    display: inline-block;
    background: linear-gradient(135deg,#666,#999);
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23000"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1.003 1.003 0 000-1.42l-2.34-2.34a1.003 1.003 0 00-1.42 0l-1.83 1.83 3.75 3.75 1.84-1.82z"/></svg>') center / contain no-repeat;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23000"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1.003 1.003 0 000-1.42l-2.34-2.34a1.003 1.003 0 00-1.42 0l-1.83 1.83 3.75 3.75 1.84-1.82z"/></svg>') center / contain no-repeat;
    vertical-align: middle;
    margin-left: 6px;
}
.edit-icon.disabled {
    background: transparent !important;
    -webkit-mask: none !important;
    mask: none !important;
    border: 2px solid #b91c1c;
    border-radius: 50%;
    position: relative;
    cursor: not-allowed;
}
.edit-icon.disabled::after {
    content: '';
    position: absolute;
    left: 3px; right: 3px; top: 9px; height: 2px;
    background: #b91c1c;
    transform: rotate(-45deg);
}

/* Larger content fonts inside sections */
.gp-q-prompt-text,
.GP-Paper-2-mark-scheme,
.GP-Paper-2-suggested-answer,
.gp-q-marks-value {
    font-size: 1.05rem;
    line-height: 1.7;
}

.GP-Paper-2-mark-scheme ul,
.GP-Paper-2-suggested-answer ul {
    margin-top: 6px;
}

.swal2-cancel.swal2-styled,
.swal2-cancel.swal2-styled:focus,
.swal2-cancel.swal2-styled:hover,
.swal2-cancel.swal2-styled:active {
    box-shadow: none !important;
}

#GP-Paper-1-GenerateWorksheet,
#GP-Paper-1-SaveWorksheet {
    background-color: #0ABAB5 !important;
    color: white !important;
}

/* Main Container Styles */
.gp-paper2-question-generator {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    border-radius: 10px;
}

.gp-paper2-question-generator h1,
.gp-paper2-question-generator h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-weight: 600;
}

.gp-paper2-question-generator h1 {
    font-size: 2.5em;
    border-bottom: 3px solid #0ABAB5;
    padding-bottom: 15px;
}

/* Input Section Styles */
.input-section {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.input-section h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.4em;
    border-left: 4px solid #0ABAB5;
    padding-left: 15px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 1.1em;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-family: Georgia, serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.input-group textarea {
    min-height: 200px;
    line-height: 1.6;
    resize: vertical;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #0ABAB5;
    box-shadow: 0 0 0 3px rgba(10, 186, 181, 0.1);
}

/* Button Styles */
.button-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #0ABAB5, #08a29e);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #08a29e, #067a77);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 186, 181, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20a037);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #20a037, #1e7e34);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268, #495057);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Question Types Display */
.question-types-info {
    background: #ffffff;
    padding: 25px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.question-types-info h3 {
    color: #495057;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.4em;
}

.question-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.question-type-card {
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-left: 4px solid #0ABAB5;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.question-type-card:hover {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.question-type-card strong {
    color: #2c3e50;
    font-size: 1.1em;
    display: block;
    margin-bottom: 5px;
}

.question-type-card small {
    color: #6c757d;
    font-style: italic;
}

/* Output Section Styles */
.output-section {
    margin-top: 30px;
}

.gp-paper2-question-generator-output {
    background: #ffffff;
    padding: 30px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    min-height: 200px;
}

.gp-paper2-question-generator-output .worksheet-title {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0ABAB5;
    font-size: 1.8em;
}

.gp-paper2-question-generator-output .instructions {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #007bff;
    margin-bottom: 30px;
    font-style: italic;
    color: #495057;
}

/* Question Section Styles */
.question-section {
    margin-bottom: 35px;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #fafbfc;
    transition: all 0.3s ease;
}

.question-section:hover {
    background: #f1f3f4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.question-text {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 15px;
    color: #2c3e50;
}

.question-text strong {
    color: #0ABAB5;
    font-size: 1.2em;
}

.marks {
    font-weight: bold;
    border-radius: 4px;
    font-size: 0.9em;
}

.question-type-info {
    background: #e8f5e8;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.question-type-info em {
    color: #28a745;
    font-weight: 600;
}

/* Marking Scheme and Answer Styles */
.marking-scheme,
.suggested-answer {
    margin-top: 15px;
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid #0ABAB5;
}

.marking-scheme {
    background: #f8f9ff;
    border-left-color: #007bff;
}

.suggested-answer {
    background: #f0f8f0;
    border-left-color: #28a745;
}

.marking-scheme strong,
.suggested-answer strong {
    color: #495057;
    display: block;
    margin-bottom: 10px;
    font-size: 1.05em;
}

.marking-content,
.answer-content {
    color: #495057;
    line-height: 1.5;
}

.marking-content p,
.answer-content p {
    margin-bottom: 8px;
}

.marking-content p strong {
    color: #007bff;
    display: inline;
}

.answer-content p strong {
    color: #28a745;
    display: inline;
}

/* Editable Content Styles */
[contenteditable="true"] {
    border: 1px dashed transparent;
    padding: 5px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

[contenteditable="true"]:hover {
    border-color: #0ABAB5;
    background-color: rgba(10, 186, 181, 0.05);
}

[contenteditable="true"]:focus {
    outline: none;
    border-color: #0ABAB5;
    background-color: rgba(10, 186, 181, 0.1);
    box-shadow: 0 0 0 2px rgba(10, 186, 181, 0.2);
}

/* Total Marks Summary */
.total-marks-summary {
    text-align: center;
    margin-top: 30px;
    padding: 15px;
    background: linear-gradient(135deg, #0ABAB5, #08a29e);
    color: white;
    border-radius: 8px;
    font-size: 1.2em;
    box-shadow: 0 2px 10px rgba(10, 186, 181, 0.3);
}

/* Loading and Status Styles */
.loading-indicator {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.loading-indicator .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0ABAB5;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.status-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.status-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.status-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gp-paper2-question-generator {
        padding: 15px;
        margin: 10px;
    }
    
    .gp-paper2-question-generator h1 {
        font-size: 2em;
    }
    
    .button-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .question-types-grid {
        grid-template-columns: 1fr;
    }
    
    .input-section,
    .question-types-info,
    .gp-paper2-question-generator-output {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .gp-paper2-question-generator {
        padding: 10px;
        margin: 5px;
    }
    
    .gp-paper2-question-generator h1 {
        font-size: 1.8em;
    }
    
    .input-section,
    .question-types-info,
    .gp-paper2-question-generator-output {
        padding: 15px;
    }
    
    .question-section {
        padding: 15px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Print Styles */
@media print {
    .input-section,
    .question-types-info,
    .button-group {
        display: none;
    }
    
    .gp-paper2-question-generator-output {
        box-shadow: none;
        border: 1px solid #000;
        padding: 20px;
    }
    
    .question-section {
        break-inside: avoid;
        background: white;
        border: 1px solid #ccc;
    }
    
    .marking-scheme,
    .suggested-answer {
        background: white;
        border-left: 2px solid #000;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }

.hidden { display: none; }
.visible { display: block; }

/* Custom Scrollbar */
.gp-paper2-question-generator-output::-webkit-scrollbar {
    width: 8px;
}

.gp-paper2-question-generator-output::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.gp-paper2-question-generator-output::-webkit-scrollbar-thumb {
    background: #0ABAB5;
    border-radius: 4px;
}

.gp-paper2-question-generator-output::-webkit-scrollbar-thumb:hover {
    background: #08a29e;
}
