/* mod_depthcontent styles — inline quiz, depth selector, practice section */

/* ── Depth Selector Bar ── */
.dc-depth-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.dc-depth-bar-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.dc-depth-label {
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    font-size: 0.9rem;
}

.dc-depth-selector {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.dc-depth-btn {
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    color: #495057;
    background: #fff;
    border: 1px solid #ced4da;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    user-select: none;
    outline: none;
}

.dc-depth-btn:hover {
    background: #e9ecef;
    text-decoration: none;
    color: #212529;
    border-color: #adb5bd;
}

.dc-depth-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.3);
}

.dc-depth-btn.active {
    background: #1a365d;
    color: #fff;
    border-color: #1a365d;
    font-weight: 600;
}

.dc-depth-btn.active:hover {
    background: #264a7a;
    border-color: #264a7a;
}

.dc-depth-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
}

/* Remember preference row */
.dc-remember-row {
    padding-top: 0.25rem;
    border-top: 1px solid #e9ecef;
}

.dc-remember-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #6c757d;
    cursor: pointer;
    font-weight: normal;
}

.dc-remember-checkbox {
    margin: 0;
    cursor: pointer;
}

/* ── Depth Content Sections — Transitions ── */
.dc-depth-section {
    transition: opacity 0.3s ease, max-height 0.3s ease;
    opacity: 1;
    max-height: 5000px;
    overflow: hidden;
}

.dc-depth-hidden {
    opacity: 0;
    max-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    pointer-events: none;
}

.dc-depth-entering {
    opacity: 0;
    max-height: 0;
}

.dc-depth-exiting {
    opacity: 0;
    max-height: 0;
    transition: opacity 0.25s ease, max-height 0.25s ease;
}

/* ── Content Sections ── */
.dc-summary {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-left: 4px solid #c9a84c;
    background: #fdf8ee;
}

.dc-content {
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.dc-content p {
    margin-bottom: 1rem;
}

/* ── Inline Quiz Section ── */
.dc-quiz-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f0f4f8;
    border-radius: 8px;
    border: 1px solid #d0d8e0;
}

.dc-quiz-heading {
    margin: 0 0 1rem;
    color: #1a365d;
    font-size: 1.1rem;
}

.dc-quiz-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #d0d8e0;
}

.dc-quiz-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.dc-quiz-question {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #2d3748;
}

.dc-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dc-quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #d0d8e0;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: normal;
}

.dc-quiz-option:hover {
    background: #e8edf2;
}

.dc-quiz-option input[type="radio"] {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

/* Answered states */
.dc-answered .dc-quiz-option {
    cursor: default;
}

.dc-quiz-option.dc-correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.dc-quiz-option.dc-incorrect {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Feedback */
.dc-quiz-feedback {
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.dc-feedback-correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.dc-feedback-incorrect {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Fill-in-blank */
.dc-fillin-input {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    width: 120px;
    font-size: 0.95rem;
}

.dc-fillin-input.dc-correct {
    border-color: #28a745;
    background: #d4edda;
}

.dc-fillin-input.dc-incorrect {
    border-color: #dc3545;
    background: #f8d7da;
}

.dc-fillin-check {
    margin-top: 0.5rem;
}

/* ── Matching Type ── */
.dc-matching-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.dc-matching-pair {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #d0d8e0;
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
}

.dc-matching-pair.dc-correct {
    background: #d4edda;
    border-color: #28a745;
}

.dc-matching-pair.dc-incorrect {
    background: #f8d7da;
    border-color: #dc3545;
}

.dc-matching-left {
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

.dc-matching-arrow {
    color: #adb5bd;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.dc-matching-select {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    font-size: 0.9rem;
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

.dc-matching-select:disabled {
    background: #e9ecef;
    opacity: 0.8;
}

.dc-matching-check {
    margin-top: 0.5rem;
    align-self: flex-start;
}

/* ── Quiz Placement Toggle ── */
.dc-quizstyle-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.dc-quizstyle-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
}

.dc-quizstyle-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dc-quizstyle-option {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #495057;
    cursor: pointer;
    font-weight: normal;
}

.dc-quizstyle-radio,
.dc-quizcount-radio {
    margin: 0;
    cursor: pointer;
}

.dc-quizstyle-sep {
    color: #ced4da;
    font-size: 0.9rem;
    padding: 0 0.25rem;
}

.dc-quizcount-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── Inline Quiz Block (within depth sections) ── */
.dc-quiz-inline {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: #f0f4f8;
    border-radius: 8px;
    border: 1px solid #d0d8e0;
}

.dc-quiz-inline .dc-quiz-heading {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

/* ── Original Language Toggle ── */
.dc-original-lang {
    margin: 1rem 0;
    border: 1px solid #d0d8e0;
    border-radius: 8px;
    background: #f8f9fc;
    overflow: hidden;
}

.dc-original-lang summary {
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a6785;
    background: #eef2f7;
    border-bottom: 1px solid #d0d8e0;
    user-select: none;
    list-style: none;
}

.dc-original-lang summary::-webkit-details-marker {
    display: none;
}

.dc-original-lang summary::before {
    content: '\25B6\00a0';
    font-size: 0.7rem;
    transition: transform 0.2s;
    display: inline-block;
}

.dc-original-lang[open] summary::before {
    transform: rotate(90deg);
}

.dc-original-lang[open] summary {
    border-bottom: 1px solid #d0d8e0;
}

.dc-original-lang > blockquote,
.dc-original-lang > p {
    padding: 0.75rem 1rem;
    margin: 0;
    font-style: italic;
    color: #555;
    line-height: 1.6;
}

/* ── Practice Section ── */
.dc-practice {
    margin: 2rem 0;
    padding: 1.25rem;
    background: #f5f0e8;
    border-radius: 8px;
    border: 1px solid #e0d5c0;
}

.dc-practice h4 {
    margin: 0 0 0.75rem;
    color: #8b6914;
    font-size: 1rem;
}

.dc-practice-action {
    font-style: italic;
    line-height: 1.6;
}

.dc-habit-tip {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #666;
}

/* ── Navigation Buttons ── */
.dc-nav-buttons {
    margin: 1rem 0 0.5rem;
}

.dc-nav-buttons .btn {
    margin-right: 0.5rem;
}

/* ── Review Dashboard ── */
.dc-review-dashboard {
    max-width: 800px;
    margin: 0 auto;
}

.dc-stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.dc-stat-card {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 1.25rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.dc-stat-card.dc-stat-mastered {
    background: #d4edda;
    border-color: #c3e6cb;
}

.dc-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #1a365d;
    line-height: 1;
}

.dc-stat-mastered .dc-stat-number {
    color: #155724;
}

.dc-stat-label {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dc-review-list {
    margin-bottom: 1.5rem;
}

.dc-review-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
}

.dc-review-item:last-child {
    border-bottom: none;
}

.dc-review-link {
    text-decoration: none;
    color: #1a365d;
}

.dc-review-link:hover {
    text-decoration: underline;
}

.dc-review-point {
    font-weight: 600;
    font-family: monospace;
    background: #e8eef5;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

.dc-review-action {
    margin-bottom: 2rem;
}

.dc-review-empty {
    text-align: center;
    padding: 3rem;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.dc-upcoming-day {
    margin-bottom: 1rem;
}

.dc-upcoming-date {
    font-size: 0.9rem;
    color: #8b6914;
    border-bottom: 1px solid #e0d5c0;
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
}

.dc-upcoming-item {
    padding: 0.4rem 0 0.4rem 1rem;
    font-size: 0.9rem;
}

.dc-upcoming-point {
    font-family: monospace;
    font-size: 0.8rem;
    color: #666;
}

.dc-mastery-bar {
    display: flex;
    height: 24px;
    border-radius: 12px;
    overflow: hidden;
    background: #e9ecef;
    margin-bottom: 0.5rem;
}

.dc-mastery-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    transition: width 0.5s ease;
}

.dc-mastery-mastered { background: #28a745; }
.dc-mastery-review { background: #ffc107; color: #333; }
.dc-mastery-learning { background: #17a2b8; }

.dc-mastery-legend {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
}

.dc-mastery-legend span::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 0.3rem;
    vertical-align: middle;
}

.dc-legend-mastered::before { background: #28a745; }
.dc-legend-review::before { background: #ffc107; }
.dc-legend-learning::before { background: #17a2b8; }

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
    .dc-depth-bar-top {
        flex-direction: column;
        align-items: stretch;
    }

    .dc-depth-label {
        text-align: center;
    }

    .dc-depth-selector {
        justify-content: center;
    }

    .dc-depth-btn {
        font-size: 0.78rem;
        padding: 0.3rem 0.55rem;
    }

    .dc-remember-row {
        text-align: center;
    }

    .dc-quizstyle-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .dc-matching-pair {
        flex-wrap: wrap;
    }

    .dc-matching-select {
        max-width: none;
        width: 100%;
    }

    .dc-quiz-section {
        padding: 1rem;
    }

    .dc-quiz-option {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .dc-depth-selector {
        gap: 0.15rem;
    }

    .dc-depth-btn {
        font-size: 0.72rem;
        padding: 0.25rem 0.4rem;
    }
}

/* ── Mode Links (view.php) ── */
.dc-mode-links {
    margin: 2rem 0 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── Dashboard Actions ── */
.dc-dashboard-actions {
    margin-bottom: 1.5rem;
}

/* ── Credit by Examination (review.php) ── */
.dc-examine {
    max-width: 900px;
    margin: 0 auto;
}

.dc-examine-header h3 {
    margin: 0 0 0.25rem;
    color: #1a365d;
}

.dc-examine-header .text-muted {
    margin-bottom: 1.5rem;
}

.dc-examine-instruction {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2d3748;
}

.dc-examine-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dc-examine-count {
    font-size: 0.9rem;
    color: #666;
}

/* Point selection list */
.dc-examine-points {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dc-examine-point {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    flex-wrap: wrap;
    font-weight: normal;
}

.dc-examine-point:hover {
    background: #f0f4f8;
    border-color: #b0c0d0;
}

.dc-examine-point.dc-already-mastered {
    background: #d4edda;
    border-color: #c3e6cb;
    opacity: 0.7;
    cursor: default;
}

.dc-examine-check {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.dc-examine-pointid {
    font-family: monospace;
    font-weight: 700;
    font-size: 0.85rem;
    background: #e8eef5;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    white-space: nowrap;
}

.dc-examine-name {
    font-weight: 600;
    color: #1a365d;
}

.dc-examine-summary {
    display: block;
    width: 100%;
    padding-left: 2rem;
    font-size: 0.9rem;
    color: #555;
    font-style: italic;
    line-height: 1.5;
}

.dc-examine-qcount {
    font-size: 0.8rem;
    color: #888;
    white-space: nowrap;
}

.dc-examine-badge {
    font-size: 0.75rem;
}

.dc-examine-action {
    display: flex;
    gap: 0.5rem;
}

/* Quiz phase */
.dc-quiz-progress {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.dc-exam-question {
    padding: 1.5rem;
    background: #f0f4f8;
    border-radius: 8px;
    border: 1px solid #d0d8e0;
}

.dc-exam-point-label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.5rem;
    font-family: monospace;
}

.dc-examine-nav {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

/* Results phase */
.dc-results-stats {
    margin-bottom: 2rem;
}

.dc-result-point {
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.dc-result-passed {
    background: #f0faf0;
    border-color: #c3e6cb;
}

.dc-result-failed {
    background: #fff8f0;
    border-color: #ffeeba;
}

.dc-result-point-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.dc-result-questions {
    margin-left: 1rem;
}

.dc-result-question {
    padding: 0.3rem 0;
    font-size: 0.9rem;
}

.dc-rq-icon {
    font-weight: 700;
}

.dc-rq-correct .dc-rq-icon {
    color: #28a745;
}

.dc-rq-incorrect .dc-rq-icon {
    color: #dc3545;
}

.dc-rq-answer {
    margin-left: 1.5rem;
    font-size: 0.85rem;
    color: #155724;
    font-style: italic;
}

.dc-result-study-link {
    margin-top: 0.75rem;
}

/* Responsive exam styles */
@media (max-width: 768px) {
    .dc-examine-point {
        padding: 0.6rem 0.75rem;
    }

    .dc-examine-summary {
        padding-left: 0;
    }

    .dc-exam-question {
        padding: 1rem;
    }

    .dc-examine-nav {
        flex-direction: column;
    }
}

/* ── S13: Feedback panel and modal ── */
.depthcontent-feedback-panel {
    margin: 1.5rem 0;
    padding: 0.75rem 1rem;
    background: #fafbfc;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.depthcontent-feedback-panel h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.depthcontent-feedback-slot-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.depthcontent-feedback-slot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.depthcontent-feedback-slot-label {
    color: #6c757d;
    font-size: 0.85rem;
    min-width: 10rem;
}

.dc-fb-btn {
    font-size: 0.85rem;
}

.dc-fb-btn-locked {
    color: #6c757d;
    border-color: #ced4da;
    background: transparent;
    text-decoration: underline;
}

.dc-fb-toast {
    display: inline-block;
    margin-left: 0.5rem;
    color: #198754;
    font-size: 0.85rem;
}

/* Modal body — candidate picker laid out side-by-side on wide screens. */
.depthcontent-feedback-modal {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.depthcontent-feedback-candidate {
    flex: 1 1 0;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
}

.depthcontent-feedback-candidate-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.depthcontent-feedback-candidate-notes,
.depthcontent-feedback-candidate-score {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.depthcontent-feedback-candidate-pick {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.depthcontent-feedback-candidate-play {
    margin-top: 0.25rem;
}

@media (min-width: 720px) {
    .depthcontent-feedback-modal {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .depthcontent-feedback-candidate {
        min-width: 14rem;
    }
    .depthcontent-feedback-why-wrap,
    .depthcontent-feedback-basic {
        flex-basis: 100%;
    }
}

.depthcontent-feedback-basic fieldset {
    border: none;
    padding: 0;
    margin: 0.5rem 0;
}

.depthcontent-feedback-basic fieldset legend {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.depthcontent-feedback-basic fieldset label {
    display: inline-block;
    margin-right: 1rem;
    font-weight: normal;
}

.depthcontent-feedback-why-wrap {
    margin-top: 0.5rem;
}

.depthcontent-feedback-why-wrap label {
    display: block;
    font-size: 0.9rem;
    color: #495057;
}

.depthcontent-feedback-why-wrap textarea {
    width: 100%;
    margin-top: 0.25rem;
}
