@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

.mcq-quiz {
    background: linear-gradient(135deg, #f5f7fa, #e0e7ff);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 20px auto;
    font-family: 'Poppins', sans-serif;
    color: #2d3748;
}

.mcq-quiz-title {
    font-size: 40px;
    font-weight: 600;
    text-align: center;
    margin: 0 0 20px 0;
    color: #333;
}

.mcq-question {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mcq-question:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.mcq-question label {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    background: #f7fafc;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.mcq-question label:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.mcq-question input[type="radio"] {
    margin-right: 10px;
    accent-color: #4c51bf;
}

.mcq-question label[style*="background-color: #d4edda"] {
    background: #c6f6d5 !important;
    border-left: 4px solid #48bb78;
    animation: fadeIn 0.5s ease;
}

.mcq-question label[style*="background-color: #f8d7da"] {
    background: #fed7d7 !important;
    border-left: 4px solid #f56565;
    animation: fadeIn 0.5s ease;
}

.mcq-explanation {
    background: #d4ffff !important;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    border-left: 4px solid #4c51bf;
    font-size: 2rem;
    color: #0c12c0;
}

.mcq-quiz-container {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.correct-answer {
    background-color: #c6f6d5 !important;
    border-left: 4px solid #48bb78 !important;
    animation: fadeIn 0.5s ease;
}

.incorrect-answer {
    background-color: #fed7d7 !important;
    border-left: 4px solid #f56565 !important;
    animation: fadeIn 0.5s ease;
}

/* OPTIONS CONTAINER - GRID LAYOUT FOR ALL SCREENS */
.mcq-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.mcq-options label {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #f9f9f9;
    font-size: 16px;
    cursor: pointer;
    word-wrap: break-word;
    word-break: break-word;
    box-sizing: border-box;
    min-height: 60px;
    transition: all 0.3s ease;
}

/* Long options (text > 20 chars) - full width on all screens */
.mcq-options label.long-option {
    grid-column: 1 / -1; /* Span all columns */
}

/* For checked options */
.mcq-options label input:checked + span {
    font-weight: 600;
}

.mcq-options input[type="checkbox"],
.mcq-options input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.2);
}


#mcq-top-result {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 10px;
    color: #2aaae6;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    padding: 15px;
    animation: slideIn 0.5s ease;
}

#mcq-top-result h3 {
    margin: 0;
    display: inline;
    margin-right: 10px;
    color: white;
    background: linear-gradient(90deg, #4c51bf, #6b46c1);
    font-size: 3rem;
}

#mcq-top-result button {
    background: linear-gradient(90deg, #ec35d0, #c40dce);
    border: none;
    color: white;
    padding: 8px 15px;
    font-size: 3rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#mcq-top-result button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#mcq-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

#mcq-question-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    flex: 1;
}

#mcq-timer {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: red !important;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    transition: none !important;
    animation: none !important;
}

.mcq-timer-text {
    text-align: center;
    font-weight: bold;
    font-size: 1.5rem;
}

.mcq-timer-label {
    font-size: 2.5rem;
    font-weight: 600;
    margin-top: 5px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: none !important;
    animation: none !important;
    display: none !important;
}

#mcq-top-menu {
    gap: 10px;
    margin-bottom: 8px;
    font-size: 14px;
    align-items: center;
}

.blue-link {
    color: #4c51bf;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.blue-link:hover {
    color: #6b46c1;
    text-decoration: underline;
}

#mcq-start-screen {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 10px;
    margin-bottom: 20px;
}

#mcq-start-screen button {
    background: linear-gradient(90deg, #f08d36, #ff8e53);
    border: none;
    color: white;
    padding: 12px 30px;
    font-size: 2rem;
    font-weight: 600;
    border-radius: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#mcq-start-screen button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.mcq-quiz button {
    background: linear-gradient(90deg, rgb(238, 115, 7), rgb(228, 96, 14));
    border: none;
    color: white;
    padding: 10px 20px;
    font-size: 2.5rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    margin: 5px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mcq-quiz button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 1);
}

.mcq-quiz button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.mcq-nav-btn {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.mcq-nav-btn.active {
    background-color: #0c189b !important;
    border: 2px solid #0c189b !important;
    color: #fff !important;
    font-weight: bold;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.6);
}

.mcq-nav-btn:disabled {
    background: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
}

#mcq-nav-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

#mcq-nav-buttons button {
    flex: 1 1 100px;
    min-width: 100px;
    max-width: 100%;
    font-size: 1.2rem;
    padding: 10px 20px;
}

#mcq-result, #mcq-top-result {
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    padding: 15px;
    animation: slideIn 0.5s ease;
}

#mcq-result h3 {
    color: hsl(223, 89%, 29%);
    font-weight: 400;
    font-size: 3.0rem;
}

#mcq-result button {
    background: linear-gradient(90deg, #c0f050, #43e715) !important;
    border: none;
    color: white;
    padding: 8px 15px;
    font-size: 3rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#mcq-result button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.mcq-admin-attempt .mcq-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.mcq-admin-attempt .admin-option-label {
    flex: 1 1 calc(50% - 15px);
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    font-size: 16px;
    transition: all 0.3s ease;
}

.mcq-admin-attempt .correct-answer {
    background: #d4edda !important;
    border-left: 6px solid #28a745 !important;
}

.mcq-admin-attempt .incorrect-answer {
    background: #f8d7da !important;
    border-left: 6px solid #dc3545 !important;
}

.mcq-admin-attempt input[type="radio"] {
    accent-color: #4c51bf;
    transform: scale(1.2);
}

.mcq-admin-attempt input[type="radio"]:checked {
    accent-color: #4c51bf;
}

.mcq-admin-attempt .admin-option-card.correct-answer {
    background: #c6f6d5 !important;
    border-left: 6px solid #48bb78 !important;
}

.mcq-admin-attempt .admin-option-card.incorrect-answer {
    background: #fed7d7 !important;
    border-left: 6px solid #f56565 !important;
}

.mcq-admin-attempt label {
    transition: transform 0.2s ease;
}

.mcq-admin-attempt label:hover {
    transform: translateY(-2px);
}

.attempt-header {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.attempt-header h2 {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 25px 0;
    color: white;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
}

.attempt-header h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: white;
    margin: 10px auto 0;
    border-radius: 2px;
}

.attempt-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    position: relative;
    z-index: 1;
}

.info-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-label {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-value {
    font-size: 16px;
    font-weight: 600;
}

.info-item.score {
    grid-column: span 2;
    background: rgba(255, 255, 255, 0.25);
    text-align: center;
    padding: 20px;
}

.info-item.score .info-value {
    font-size: 28px;
    font-weight: 800;
    color: #FFD700;
}

.mcq-admin-attempt {
    font-size: 16px !important;
    line-height: 1.4;
}

.mcq-admin-attempt p {
    font-size: 16px !important;
    margin-bottom: 12px !important;
    line-height: 1.4 !important;
}

.mcq-admin-attempt p strong:first-child {
    font-size: 17px !important;
    color: #2d3748;
}

.mcq-admin-attempt .mcq-admin-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.mcq-admin-attempt .mcq-admin-options > div {
    flex: 1 1 calc(50% - 8px);
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    font-size: 16px !important;
    font-weight: 400;
    min-height: 40px;
    line-height: 1.3;
}

.mcq-admin-attempt .mcq-admin-options > div[style*="background:#c6f6d5"] {
    background: #c6f6d5 !important;
    border-left: 6px solid #48bb78 !important;
}

.mcq-admin-attempt .mcq-admin-options > div[style*="background:#fed7d7"] {
    background: #fed7d7 !important;
    border-left: 6px solid #e53e3e !important;
}

.mcq-admin-attempt div[style*="background:#e3f2fd"],
.mcq-admin-attempt div[style*="background:#fff3cd"] {
    padding: 8px 10px !important;
    margin-top: 12px !important;
    border-left: 4px solid !important;
    border-radius: 6px;
    font-size: 16px !important;
    font-weight: 500 !important;
}

.mcq-admin-attempt div[style*="background:#eef4ff"] {
    padding: 10px 12px !important;
    border-left: 4px solid #4c51bf !important;
    margin-top: 12px !important;
    border-radius: 6px;
    font-size: 16px !important;
    line-height: 1.4;
}

.mcq-admin-attempt div[style*="background:#eef4ff"] strong {
    font-size: 16px !important;
    font-weight: 600;
}

.mcq-admin-attempt a {
    font-size: 16px !important;
}

.mcq-admin-attempt span[style*="width:20px"] {
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 12px !important;
    font-size: 18px !important;
    font-weight: bold;
}

.mcq-admin-attempt strong[style*="font-size:0.9em"] {
    font-size: 15px !important;
    font-weight: 500 !important;
    margin-left: 8px !important;
}

.mcq-admin-attempt > p {
    font-size: 16px !important;
    margin-bottom: 8px !important;
}

.mcq-admin-attempt > p strong {
    font-size: 16px !important;
    font-weight: 600;
}

.mcq-admin-attempt div,
.mcq-admin-attempt span,
.mcq-admin-attempt strong,
.mcq-admin-attempt em {
    font-size: 16px !important;
}


/* ================================
   Center Images in Live Quiz Test
   ================================ */

.mcq-question img,
.mcq-question-image img,
.mcq-explanation img {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    max-width: 100% !important;
    height: auto !important;
}


/* ================================
   Center Images ONLY in Attempt Review
   ================================ */

/* Remove or comment out this line:
.mcq-admin-attempt p {
    text-align: center !important;
}
*/

/* Instead, specifically target images */
.mcq-admin-attempt img {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 100% !important;
    height: auto !important;
}

/* If you need to center image containers */
.mcq-admin-attempt .mcq-question-image,
.mcq-admin-attempt p:has(img) {
    text-align: center !important;
}

/* Keep questions and other text left-aligned */
.mcq-admin-attempt p,
.mcq-admin-attempt .mcq-question-text,
.mcq-admin-attempt .mcq-question {
    text-align: left !important;
}



@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* RESPONSIVE DESIGN - MOBILE */
@media (max-width: 600px) {
    .mcq-quiz {
        padding: 15px;
    }

    #mcq-top-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .mcq-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }

    .mcq-quiz button {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    #mcq-start-screen {
        padding: 25px;
    }

    #mcq-timer {
        width: 50px;
        height: 50px;
        padding: 4px;
    }

    .mcq-timer-text {
        font-size: 1.2rem;
    }
    
    .mcq-quiz-container {
        padding: 15px;
    }

    #mcq-result h3,
    #mcq-top-result h3 {
        white-space: nowrap;
        font-size: 2rem !important;
    }

    #mcq-nav-buttons {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    #mcq-nav-buttons button {
        width: 100% !important;
        font-size: 1rem;
        padding: 12px 0;
        margin: 5px 0;
    }

    /* MOBILE OPTIONS - KEEP GRID FOR SHORT OPTIONS, FULL WIDTH FOR LONG OPTIONS */
    .mcq-options {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* Keep 2 columns on mobile */
        gap: 10px; /* Smaller gap on mobile */
    }

    .mcq-options label {
        padding: 8px;
        font-size: 14px;
        min-height: 50px;
    }

    /* Long options (text > 20 chars) - full width (single column) on mobile */
    .mcq-options label.long-option {
        grid-column: 1 / -1; /* This will make it span both columns = full width */
    }

    /* Adjust grid for very small screens */
    @media (max-width: 380px) {
        .mcq-options {
            grid-template-columns: 1fr; /* Single column on very small screens */
        }
        
        .mcq-options label.long-option {
            grid-column: 1; /* Reset for single column */
        }
    }

    .mcq-options label.correct-answer {
        background: #c6f6d5;
        border-left: 5px solid #38a169;
    }
    
    .mcq-options label.incorrect-answer {
        background: #fed7d7;
        border-left: 5px solid #e53e3e;
    }
    
    .mcq-admin-attempt ul {
        margin: 15px 0;
    }
    
    .mcq-admin-attempt li {
        font-size: 16px;
        line-height: 1.5;
    }
}



