/* File: assets/css/soal-style.css */

:root {
    --primary-color: #4f46e5;
    --primary-light: #eef2ff;
    --success-color: #10b981;
    --error-color: #ef4444;
    --bg-body: #f8fafc;
    --border-color: #cbd5e1;
    --text-main: #1e293b;
    --text-muted: #64748b;
}

/* Container Utama (Generic Class) */
.soal-wrapper {
    margin-bottom: 40px;
    color: var(--text-main);
    position: relative;
    width: 100%;
}

.question-card {
    background: white;
    border-radius: 24px;
    border: 2px solid var(--border-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
}

.tag-badge {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    text-transform: uppercase;
    border: 1px solid #e0e7ff;
    transition: all 0.2s;
    text-decoration: none;
}
.tag-badge:hover {
    background-color: var(--primary-color);
    color: white;
}

.question-text {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 24px 0;
}

/* Statistik Box */
.stats-container {
    display: none;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    animation: fadeIn 0.3s ease;
}
.stat-item { text-align: center; }
.stat-icon { color: var(--primary-color); margin-bottom: 8px; }
.stat-value { display: block; font-size: 1.1rem; font-weight: 700; }
.stat-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }

/* Pilihan Jawaban */
.option-item {
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    background: white;
}

.option-label {
    flex: 1;
    line-height: 1.4;
    margin: 0;
    align-self: center;
}

.option-label p {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    padding: 0;
}

.option-label .MathJax_Display {
    margin: 0 !important;
    display: inline-block !important;
    width: auto !important;
}
.option-item:hover:not(.disabled) {
    border-color: var(--primary-color);
    background-color: #f5f3ff;
}
.option-item.is-correct {
    border-color: var(--success-color) !important;
    background-color: #ecfdf5 !important;
    color: #065f46;
}
.option-item.is-wrong {
    border-color: var(--error-color) !important;
    background-color: #fef2f2 !important;
    color: #991b1b;
}
.option-prefix {
    width: 34px;
    height: 34px;
    background: #f1f5f9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
    color: var(--text-muted);
}

/* Action Buttons */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #f1f5f9;
    padding-top: 20px;
    margin-top: 25px;
    gap: 10px;
}
.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 12px 8px;
    border-radius: 14px;
    flex: 1;
    transition: all 0.2s;
}
.btn-action:hover {
    background: #f1f5f9;
    color: var(--text-main);
}
.btn-action.active-blue {
    color: var(--primary-color);
    border-color: var(--primary-light);
    background: var(--primary-light);
}
.btn-action.active-blue i,
.active-blue i {
    color: #ef4444 !important;
}
.active-blue i svg {
    fill: #ef4444 !important;
}

.explanation-box {
    display: none;
    background-color: #f0fdf4;
    border-left: 6px solid var(--success-color);
    padding: 20px;
    border-radius: 16px;
    margin-top: 20px;
}

/* Discussion & Nested Comments */
.discussion-section {
    display: none;
    margin-top: 25px;
    border-top: 2px solid #f1f5f9;
    padding-top: 25px;
}
.comment-group { margin-bottom: 25px; }
.comment-item { margin-bottom: 12px; animation: fadeIn 0.4s ease; }
.comment-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #64748b;
    flex-shrink: 0;
}
.comment-content {
    background: #f8fafc;
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    flex-grow: 1;
}
.comment-meta {
    display: flex;
    gap: 15px;
    margin-top: 6px;
    padding-left: 50px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}
.comment-meta span { cursor: pointer; display: flex; align-items: center; gap: 4px; }
.comment-meta span:hover { color: var(--primary-color); }
.comment-replies { margin-left: 45px; margin-top: 15px; border-left: 2px solid #e2e8f0; padding-left: 15px; }

/* Modals & Bookmarks */
.bookmark-striped-list { background-color: #fff; max-height: 250px; overflow-y: auto; }
.bookmark-row:nth-child(odd) { background-color: #f8fafc; }
.bookmark-row:nth-child(even) { background-color: #ffffff; }
.bookmark-row:hover { background-color: var(--primary-light); }
.bookmark-row label:hover span { color: var(--primary-color); }
.bookmark-row .btn-link:hover { color: var(--primary-color) !important; background: #fff; border-radius: 4px; }

.msg-box {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    display: none;
    z-index: 2000;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* Drawing Toolbar Styling */
.drawing-overlay { pointer-events: none; }
.drawing-overlay canvas, .drawing-toolbar { pointer-events: auto; }
.drawing-toolbar {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.3s ease;
}

/* Dark Mode State untuk Kartu Soal */
.question-card.drawing-dark-mode {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
    color: #e2e8f0 !important;
}
.drawing-dark-mode .question-text,
.drawing-dark-mode .option-label,
.drawing-dark-mode .option-prefix {
    color: #ffffff !important;
}
.drawing-dark-mode .drawing-toolbar {
    background-color: #2d2d2d !important;
    border-color: #444 !important;
}
.drawing-dark-mode .drawing-toolbar input,
.drawing-dark-mode .drawing-toolbar select,
.drawing-dark-mode .drawing-toolbar .btn-light {
    background-color: #3d3d3d !important;
    color: white !important;
    border-color: #555 !important;
}
.drawing-active .option-item {
    border-color: transparent !important;
    background-color: transparent !important;
}

/* Isian & Esai Styles */
.input-isian-style {
    color: #94a3b8 !important;
    border: 2px solid #cbd5e1 !important;
    background-color: #ffffff !important;
    transition: all 0.2s ease;
}
.input-isian-style:focus {
    color: var(--text-main) !important;
    border-color: var(--primary-color) !important;
}
.isian-correct {
    border-color: var(--success-color) !important;
    background-color: #ecfdf5 !important;
    color: #059669 !important;
    font-weight: 700;
}
.isian-wrong {
    border-color: var(--error-color) !important;
    background-color: #fef2f2 !important;
    color: #dc2626 !important;
    font-weight: 700;
}
.ai-response-text b, .ai-response-text strong {
    color: var(--primary-color);
    font-size: 1.1rem;
}
.soal-penjelasan { white-space: pre-line; }

@media (max-width: 576px) { .btn-action .btn-label { display: none; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Responsif Mobile untuk Shortcode */
@media (max-width: 768px) {
    .soal-wrapper {
        margin-left: -15px;
        margin-right: -15px;
        margin-bottom: 20px;
    }
    .soal-wrapper .question-card {
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 20px 15px !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    .soal-wrapper .drawing-toolbar {
        width: 90%;
        top: 10px;
    }
}

.MathJax_Display { text-align: left !important; }

.alert-success {
    background-color: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
}

.alert-danger {
    background-color: #fef2f2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

/* Pastikan style single select ujian ada */
.option-item.is-selected {
    border-color: #3b82f6 !important;
    background-color: #eff6ff !important;
    color: #1e3a8a;
    font-weight: 600;
}

/* Helper mode */
.mode-ujian .option-item { cursor: pointer; }
.mode-result .option-item { cursor: default; }
.mode-ujian .stats-container, .mode-ujian .action-bar { display: none !important; }

#g-bm-list::-webkit-scrollbar {
    width: 6px;
}
#g-bm-list::-webkit-scrollbar-track {
    background: #f1f1f1; 
    border-radius: 4px;
}
#g-bm-list::-webkit-scrollbar-thumb {
    background: #c1c1c1; 
    border-radius: 4px;
}
#g-bm-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8; 
}