/* ==========================================
   SCREEN CONTROL
========================================== */

.em-screen {
    display: none;
}

.em-active-screen {
    display: block;
}

/* ==========================================
   DASHBOARD.em-question-box{
========================================== */

.teacher-dashboard{

    max-width:1200px;
    margin:40px auto;
    padding:0 20px;

}

.teacher-welcome{

    margin-bottom:35px;

}

.teacher-top-box{

    display:flex;
    align-items:center;
    gap:20px;

}

.teacher-avatar{

    width:80px;
    height:80px;

    border-radius:50%;

    display:flex;
    align-items:center;
    justify-content:center;

    font-size:36px;

    background:#0d47a1;
    color:#fff;

}

.teacher-details h1{

    margin:0;
    font-size:34px;

}

.teacher-coaching{

    margin-top:8px;
    color:#666;
    font-size:15px;

}

.teacher-subtitle{

    margin-top:18px;
    color:#555;
    font-size:16px;

}

.teacher-grid{

    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
    gap:25px;

}

.teacher-card{

    background:#fff;

    border-radius:12px;

    padding:25px;

    box-shadow:0 2px 12px rgba(0,0,0,.08);

    transition:.3s;

}

.teacher-card:hover{

    transform:translateY(-4px);

}

.teacher-icon{

    font-size:42px;
    margin-bottom:15px;

}

.teacher-card h3{

    margin-bottom:10px;

}

.teacher-card p{

    color:#666;
    min-height:45px;

}

.teacher-btn{

    background:#0d47a1;

    color:#fff;

    border:none;

    padding:12px 20px;

    border-radius:8px;

    cursor:pointer;

    font-size:15px;

    transition:.3s;

}

.teacher-btn:hover{

    background:#1565c0;

}

/* =====================================================
   CREATE EXAM WIZARD
===================================================== */

.em-create-wrapper{

    display:flex;
    gap:30px;
    margin-top:20px;
    align-items:flex-start;

}

/* ==========================
   LEFT SIDEBAR
========================== */

.em-step-sidebar{

    width:280px;
    background:#ffffff;
    border-radius:16px;
    padding:25px;
    box-shadow:0 5px 20px rgba(0,0,0,.08);

}

.em-step-sidebar h3{

    margin:0 0 25px;
    font-size:22px;
    color:#1e3a8a;

}

.em-step-list{

    list-style:none;
    padding:0;
    margin:0;

}

.em-step-item{

    display:flex;
    align-items:center;
    gap:15px;
    padding:15px;
    border-radius:12px;
    margin-bottom:12px;
    transition:.3s;
    cursor:default;

}

.em-step-item span{

    width:40px;
    height:40px;
    border-radius:50%;
    background:#e5e7eb;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:bold;

}

.em-step-item p{

    margin:0;
    font-weight:600;

}

/* ==========================
   ACTIVE STEP
========================== */

.em-step-active{

    background:#2563eb;
    color:#ffffff;

}

.em-step-active span{

    background:#ffffff;
    color:#2563eb;

}

/* ==========================
   RIGHT CONTENT
========================== */

.em-step-content{

    flex:1;
    background:#ffffff;
    border-radius:16px;
    padding:35px;
    box-shadow:0 5px 20px rgba(0,0,0,.08);

}

.em-step-panel{

    display:none;

}

.em-step-panel-active{

    display:block;

}

/* =====================================================
   STEP HEADER
===================================================== */

.em-step-header{

    margin-bottom:35px;

}

.em-step-number{

    display:inline-block;
    background:#dbeafe;
    color:#2563eb;
    font-size:13px;
    font-weight:600;
    padding:6px 14px;
    border-radius:30px;
    margin-bottom:15px;

}

.em-step-header h2{

    margin:0;
    font-size:34px;
    color:#111827;

}

.em-step-header p{

    margin-top:10px;
    color:#6b7280;
    font-size:15px;

}

/* =====================================================
   FORM
===================================================== */

.em-form-group{

    margin-bottom:28px;

}

.em-form-group label{

    display:block;
    font-weight:600;
    margin-bottom:10px;
    color:#1f2937;

}

.em-input,
.em-textarea{

    width:100%;
    border:1px solid #d1d5db;
    border-radius:12px;
    padding:15px 18px;
    font-size:15px;
    transition:.3s;
    background:#fff;
    box-sizing:border-box;

}

.em-input:focus,
.em-textarea:focus{

    outline:none;
    border-color:#2563eb;
    box-shadow:0 0 0 4px rgba(37,99,235,.12);

}

.em-textarea{

    resize:vertical;
    min-height:160px;

}

/* =====================================================
   FOOTER
===================================================== */

.em-step-footer{

    display:flex;
    justify-content:flex-end;
    align-items:center;
    gap:15px;
    margin-top:40px;

}

/* =====================================================
   TABLET RESPONSIVE
===================================================== */

@media (max-width:992px){

    .em-create-wrapper{

        flex-direction:column;

    }

    .em-step-sidebar{

        width:100%;

    }

    .em-step-content{

        width:100%;

    }

}

/* =====================================================
   MOBILE PROGRESS
===================================================== */

.em-mobile-progress{

    display:none;

}

/* =====================================================
   MOBILE WIZARD
===================================================== */

@media (max-width:768px){

    /* Hide Desktop Sidebar */

    .em-step-sidebar{

        display:none;

    }

    /* Show Mobile Progress */

    .em-mobile-progress{

        display:block;
        background:#ffffff;
        border-radius:16px;
        padding:20px;
        margin-bottom:20px;
        box-shadow:0 5px 20px rgba(0,0,0,.08);

    }

    .em-mobile-step{

        font-size:18px;
        font-weight:700;
        color:#1e3a8a;
        margin-bottom:15px;

    }

    .em-mobile-progress-bar{

        width:100%;
        height:10px;
        background:#e5e7eb;
        border-radius:20px;
        overflow:hidden;

    }

    .em-mobile-progress-fill{

        width:16.66%;
        height:100%;
        background:#2563eb;
        transition:.3s;

    }

    .em-step-content{

    width:100%;
    padding:20px;
    padding-bottom:90px;

}

/* ==========================================
   MOBILE STICKY FOOTER
========================================== */

.em-step-footer{

    position:sticky;
    bottom:0;

    background:#ffffff;

    padding:15px 0 10px;

    margin-top:35px;

    border-top:1px solid #e5e7eb;

    z-index:20;

}
.teacher-btn{

    flex:1;

}
}

.em-mobile-step-title{

    font-size:20px;
    font-weight:700;
    margin:18px 0 15px;
    color:#111827;

}

/* =====================================================
   CATEGORY CARDS
===================================================== */

.em-category-grid{

    display:grid;

    grid-template-columns:repeat(auto-fill,minmax(180px,1fr));

    gap:15px;

    margin-top:20px;

}

.em-category-card{

    background:#ffffff;

    border:1px solid #dbe4f0;

    border-radius:12px;

    padding:16px;

    min-height:110px;

    text-align:left;

    cursor:pointer;

    transition:all .25s ease;

    display:flex;

    flex-direction:column;

    justify-content:center;

}

.em-category-card:hover{

    border-color:#2563eb;

    transform:translateY(-2px);

    box-shadow:0 8px 20px rgba(37,99,235,.10);

}

/* ==========================================
   SELECTED CATEGORY
========================================== */

.em-category-selected{

    border:2px solid #2563eb !important;

    background:#eff6ff;

    box-shadow:0 0 0 3px rgba(37,99,235,.15);

}

.em-category-card h4{

    margin:0;

    font-size:16px;

    font-weight:700;

    color:#111827;

    white-space:nowrap;

    overflow:hidden;

    text-overflow:ellipsis;

}
.em-category-card p{

    margin-top:6px;

    font-size:13px;

    color:#6b7280;

    line-height:1.4;

    display:-webkit-box;

    -webkit-line-clamp:2;

    -webkit-box-orient:vertical;

    overflow:hidden;

}

.em-add-category-card{

    border:2px dashed #2563eb;

    background:#f8fbff;

    justify-content:center;

    align-items:center;

    text-align:center;

}

.em-category-icon{

    width:42px;

    height:42px;

    margin:0 auto 10px;

    border-radius:50%;

    background:#2563eb;

    color:#ffffff;

    display:flex;

    align-items:center;

    justify-content:center;

    font-size:24px;

    font-weight:700;

}

/* =====================================================
   CATEGORY MODAL
===================================================== */

.em-modal{

    position:fixed;

    top:0;

    left:0;

    width:100%;

    height:100%;

    background:rgba(15,23,42,.55);

    display:none;

    align-items:center;

    justify-content:center;

    z-index:99999;

    padding:20px;

}

.em-modal-content{

    width:100%;

    max-width:520px;

    background:#ffffff;

    border-radius:18px;

    overflow:hidden;

    box-shadow:0 25px 70px rgba(0,0,0,.25);

    animation:emModalIn .25s ease;

}

@keyframes emModalIn{

    from{

        transform:translateY(-20px);

        opacity:0;

    }

    to{

        transform:translateY(0);

        opacity:1;

    }

}

.em-modal-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:20px 25px;

    border-bottom:1px solid #e5e7eb;

}

.em-modal-header h3{

    margin:0;

    font-size:22px;

    font-weight:600;

}

.em-modal-close{

    background:none;

    border:none;

    font-size:28px;

    cursor:pointer;

    color:#6b7280;

}

.em-modal-body{

    padding:25px;

}

.em-modal-body label{

    display:block;

    margin-bottom:8px;

    font-weight:600;

}

.em-modal-body label span{

    color:#ef4444;

}

.em-modal-body input,

.em-modal-body textarea{

    width:100%;

    padding:12px 15px;

    border:1px solid #d1d5db;

    border-radius:10px;

    font-size:15px;

    margin-bottom:20px;

    outline:none;

    transition:.2s;

    box-sizing:border-box;

}

.em-modal-body input:focus,

.em-modal-body textarea:focus{

    border-color:#2563eb;

}

.em-modal-footer{

    display:flex;

    justify-content:flex-end;

    gap:12px;

    padding:20px 25px;

    border-top:1px solid #e5e7eb;

}

/* =====================================================
   STEP 5 - QUESTION BUILDER
===================================================== */

.em-question-methods{

    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:24px;
    margin-top:30px;

}

.em-question-method-card{

    background:#ffffff;
    border:1px solid #e5e7eb;
    border-radius:16px;
    padding:30px;
    text-align:center;
    box-shadow:0 4px 15px rgba(0,0,0,.05);
    transition:all .3s ease;

}

.em-question-method-card:hover{

    transform:translateY(-6px);
    box-shadow:0 12px 30px rgba(0,0,0,.12);

}

.em-question-method-icon{

    width:70px;
    height:70px;
    margin:0 auto 20px;
    border-radius:50%;
    background:#eef5ff;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:32px;

}

.em-question-method-card h3{

    margin-bottom:12px;
    font-size:20px;
    font-weight:600;
    color:#1f2937;

}

.em-question-method-card p{

    color:#6b7280;
    line-height:1.6;
    min-height:70px;
    margin-bottom:25px;

}

.em-question-method-card button{

    width:100%;

}

/* ==========================================
   QUESTION BUILDER
========================================== */

.em-question-builder-header{

    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:20px;
    margin-bottom:25px;

}

.em-question-progress{

    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:20px;
    margin-bottom:30px;

}

.em-progress-card{

    background:#f8fafc;
    border:1px solid #e5e7eb;
    border-radius:14px;
    padding:18px 22px;

}

.em-progress-card span{

    display:block;
    color:#6b7280;
    font-size:14px;

}

.em-progress-card strong{

    display:block;
    margin-top:6px;
    font-size:26px;
    color:#111827;

}

.em-builder-card{

    background:#ffffff;
    border:1px solid #e5e7eb;
    border-radius:16px;
    padding:28px;
    margin-bottom:30px;

}

.em-builder-card-header{

    margin-bottom:25px;

}

.em-builder-card-header h3{

    margin:0;
    font-size:24px;

}

.em-builder-card-header p{

    margin-top:8px;
    color:#6b7280;

}

.em-question-type-active .em-type-status{

    background:#2563eb;
    color:#ffffff;

}

/* ==========================================
   QUESTION FORMAT
========================================== */

.em-question-format-row{

    display:flex;
    gap:15px;
    flex-wrap:wrap;

}

.em-format-card{

    flex:1;
    min-width:170px;

    display:flex;
    align-items:center;
    gap:14px;

    padding:14px 18px;

    border:1px solid #e5e7eb;

    border-radius:12px;

    background:#ffffff;

    transition:.25s;

}

.em-format-active{

    border:2px solid #2563eb;

    background:#eff6ff;

}

.em-format-icon{

    font-size:28px;

}

.em-format-content h4{

    margin:0;

    font-size:16px;

}

.em-format-content small{

    display:block;

    margin-top:4px;

    color:#6b7280;

    font-size:12px;

}

/* ==========================================
   QUESTION SECTION
========================================== */

.em-required{

    color:#dc2626;

}

.em-image-preview{

    margin-top:12px;

    border:2px dashed #d1d5db;

    border-radius:12px;

    min-height:120px;

    display:flex;

    align-items:center;

    justify-content:center;

    color:#6b7280;

    background:#fafafa;

    overflow:hidden;

}

.em-image-preview img{

    max-width:100%;

    max-height:300px;

    border-radius:8px;

}

/* ==========================================
   OPTION BUILDER
========================================== */

.em-option-row{

    display:grid;

    grid-template-columns:140px 1fr auto;

    gap:18px;

    align-items:start;

    margin-bottom:24px;

}

.em-option-label{

    font-weight:600;

    font-size:16px;

    color:#111827;

    padding-top:14px;

}

.em-option-image-section{

    display:flex;

    flex-direction:column;

    align-items:flex-start;

    gap:10px;

}

.em-option-image-btn{

    padding:12px 18px;

    border:none;

    border-radius:10px;

    background:#2563eb;

    color:#ffffff;

    font-size:14px;

    font-weight:600;

    cursor:pointer;

    transition:all .25s ease;

}

.em-option-image-btn:hover{

    background:#1d4ed8;

}

[id^="em-option-image-wrapper-"]{

    display:flex;

    flex-direction:column;

    gap:12px;

    width:220px;

}

[id^="em-option-preview-"]{

    border:2px dashed #d1d5db;

    border-radius:12px;

    min-height:120px;

    display:flex;

    justify-content:center;

    align-items:center;

    overflow:hidden;

    background:#fafafa;

}

[id^="em-option-preview-"] img{

    max-width:100%;

    max-height:150px;

    border-radius:8px;

}

.em-remove-option-image{

    width:100%;

}

/* ==========================================
   CORRECT ANSWER
========================================== */

.em-answer-buttons{

    display:grid;

    grid-template-columns:repeat(4,1fr);

    gap:15px;

}

.em-answer-btn{

    padding:16px;

    border:2px solid #d1d5db;

    border-radius:12px;

    background:#ffffff;

    color:#111827 !important;

    font-size:16px;

    font-weight:600;

    cursor:pointer;

    transition:all .25s ease;

}

.em-answer-btn:hover{

    border-color:#2563eb;

    background:#eff6ff;

    color:#2563eb !important;

}

.em-answer-active{

    background:#2563eb !important;

    color:#ffffff !important;

    border-color:#2563eb;

}

@media(max-width:768px){

    .em-answer-buttons{

        grid-template-columns:repeat(2,1fr);

    }

}

@media(max-width:480px){

    .em-answer-buttons{

        grid-template-columns:1fr;

    }

}

/* ==========================================
   RESPONSIVE - OPTION BUILDER
========================================== */

@media(max-width:992px){

    .em-option-row{

        grid-template-columns:1fr;

        gap:12px;

    }

    .em-option-label{

        padding-top:0;

    }

    .em-option-image-section{

        width:100%;

    }

    [id^="em-option-image-wrapper-"]{

        width:100%;

    }

}

@media(max-width:576px){

    .em-option-image-btn{

        width:100%;

    }

}

/* ==========================================
   EXPLANATION
========================================== */

#em-enable-explanation{

    margin-right:8px;

    transform:scale(1.1);

    cursor:pointer;

}

#em-explanation-section{

    margin-top:20px;

}

#em-explanation{

    min-height:140px;

    resize:vertical;

}

#em-add-explanation-image{

    margin-top:10px;

}

#em-explanation-image-wrapper{

    display:flex;

    flex-direction:column;

    gap:12px;

    margin-top:15px;

    max-width:350px;

}

#em-explanation-image-preview img{

    max-width:100%;

    max-height:250px;

    border-radius:8px;

}

#em-remove-explanation-image{

    width:fit-content;

}

/* ==========================================
   QUESTION FOOTER
========================================== */

.em-question-footer{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-top:40px;

    padding-top:30px;

    border-top:1px solid #e5e7eb;

}

.em-footer-right{

    display:flex;

    gap:15px;

    flex-wrap:wrap;

}

/* ==========================================
   Footer Button Sizes
========================================== */

#em-new-question{

    min-width:220px;
    font-size:18px;
    font-weight:700;
    padding:15px 30px;

}

#em-save-draft{

    min-width:180px;
    font-weight:600;

}

@media(max-width:768px){

    .em-question-footer{

        flex-direction:column;

        gap:15px;

        align-items:stretch;

    }

    .em-footer-right{

        flex-direction:column;

    }

    .em-footer-right button,

    #em-prev-question{

        width:100%;

    }

}

/* ==========================================
   QUESTION NAVIGATION
========================================== */

.em-question-navigation{

    margin-bottom:25px;

}

.em-question-navigation-title{

    margin:0 0 12px;

    font-size:18px;

    font-weight:600;

}

.em-question-list{

    display:flex;

    gap:10px;

    flex-wrap:wrap;

}

.em-question-box{

    width:42px;

    height:42px;

    border-radius:8px;

    background:#28a745;

    color:#fff;

    display:flex;

    align-items:center;

    justify-content:center;

    cursor:pointer;

    font-weight:600;

    transition:.25s;

}

.em-question-box:hover{

    transform:translateY(-2px);

    background:#218838;

}

.em-question-box-active{

    background:#0d6efd !important;

    transform:scale(1.08);

    box-shadow:0 0 0 3px rgba(13,110,253,.25);

}

/* =====================================================
   EXAM PREVIEW MODAL
===================================================== */

.em-preview-modal-content{

    width:95%;

    max-width:1200px;

    height:90vh;

    background:#ffffff;

    border-radius:18px;

    overflow:hidden;

    display:flex;

    flex-direction:column;

    box-shadow:0 25px 70px rgba(0,0,0,.25);

    animation:emModalIn .25s ease;

}

.em-preview-body{

    flex:1;

    overflow-y:auto;

    padding:30px;

    background:#f8fafc;

}

/* =====================================================
   EXAM PREVIEW - PROFESSIONAL QUESTION LAYOUT
===================================================== */

/* Each question */
.em-preview-question{
    background:#ffffff;
    border:1px solid #e2e8f0;
    border-radius:12px;
    padding:22px 24px;
    margin-top:20px;
}

/* Question heading row */
.em-preview-question-heading{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding-bottom:14px;
    margin-bottom:16px;
    border-bottom:1px solid #e2e8f0;
}

.em-preview-question-heading h3{
    margin:0;
    font-size:17px;
    font-weight:700;
    color:#0f172a;
}

/* Subjective marks */
.em-preview-marks{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:6px 11px;
    border-radius:20px;
    background:#eff6ff;
    border:1px solid #bfdbfe;
    color:#1d4ed8;
    font-size:12px;
    font-weight:700;
    white-space:nowrap;
}

/* Main question text */
.em-preview-question-text{
    color:#1e293b;
    font-size:15px;
    line-height:1.7;
    font-weight:500;
    white-space:pre-wrap;
}

/* Question image */
.em-preview-question-image{
    margin-top:16px;
}

.em-preview-question-image img{
    display:block;
    max-width:100%;
    max-height:420px;
    width:auto;
    height:auto;
    border-radius:10px;
    border:1px solid #e2e8f0;
}

/* =====================================================
   SUBJECTIVE MODEL / REFERENCE ANSWER
===================================================== */

.em-preview-model-answer{
    margin-top:20px;
    padding:18px 20px;
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:10px;
}

.em-preview-model-answer h4{
    margin:0 0 10px;
    color:#334155;
    font-size:13px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.em-preview-model-answer-text{
    color:#334155;
    font-size:14px;
    line-height:1.7;
    white-space:pre-wrap;
}

/* Subjective reference answer image */
.em-preview-reference-image{
    margin-top:14px;
}

.em-preview-reference-image img{
    display:block;
    max-width:100%;
    max-height:420px;
    width:auto;
    height:auto;
    border-radius:10px;
    border:1px solid #e2e8f0;
}

/* =====================================================
   EXAM PREVIEW - EXAM INFORMATION HEADER
===================================================== */

/* Exam title */
.em-preview-body > h2{
    margin:0 0 18px;
    font-size:24px;
    line-height:1.3;
    font-weight:700;
    color:#0f172a;
}

/* Category / Subject / Topic information */
.em-preview-body > p{
    display:grid;
    grid-template-columns:120px minmax(0, 1fr);
    align-items:center;
    gap:8px 14px;

    margin:0;
    padding:9px 14px;

    background:#ffffff;
    border-left:1px solid #e2e8f0;
    border-right:1px solid #e2e8f0;

    color:#475569;
    font-size:14px;
    line-height:1.45;
}

/* First information row */
.em-preview-body > p:nth-of-type(1){
    padding-top:15px;
    border-top:1px solid #e2e8f0;
    border-radius:10px 10px 0 0;
}

/* Last information row */
.em-preview-body > p:nth-of-type(3){
    padding-bottom:15px;
    border-bottom:1px solid #e2e8f0;
    border-radius:0 0 10px 10px;
    margin-bottom:24px;
}

/* Category / Subject / Topic labels */
.em-preview-body > p strong{
    color:#334155;
    font-weight:700;
}

/* Mobile */
@media (max-width:600px){

    .em-preview-body > h2{
        font-size:20px;
        margin-bottom:14px;
    }

    .em-preview-body > p{
        grid-template-columns:90px minmax(0, 1fr);
        padding-left:12px;
        padding-right:12px;
        font-size:13px;
    }

}

/* ==========================================
   BUTTON COLORS
========================================== */

/* Preview */

.teacher-btn-outline{

    background:#6f42c1 !important;
    border:1px solid #6f42c1;
    color:#ffffff;

}

.teacher-btn-outline:hover{

    background:#5b35a8 !important;

}

/* Save Draft */

.teacher-btn-warning{

    background:#28a745 !important;
    border:1px solid #28a745;
    color:#ffffff;

}

.teacher-btn-warning:hover{

    background:#218838 !important;

}

/* Delete */

.teacher-btn-danger{

    background:#dc3545 !important;
    border:1px solid #dc3545;
    color:#ffffff;

}

.teacher-btn-danger:hover{

    background:#c82333 !important;

}

/* New Question */

.teacher-btn-primary{

    background:#0d6efd !important;
    border:1px solid #0d6efd;
    color:#ffffff;

}

.teacher-btn-primary:hover{

    background:#0b5ed7 !important;

}

/* =========================================================
   SUBJECTIVE ANSWER CROP CANVAS
========================================================= */

#em-subjective-crop-canvas {
    max-width: 100%;
    height: auto;
    display: block;
    touch-action: none;
}