/* SAP Learning Hub Style - Japanese Version */

:root {
    --sap-gold: #f0ab00;
    --sap-blue: #0a6ed1;
    --sap-dark-blue: #354a5f;
    --sap-light-blue: #e5f0f9;
    --sap-green: #107e3e;
    --sap-red: #bb0000;
    --sap-orange: #e9730c;
    --bg-primary: #f5f6f7;
    --bg-white: #ffffff;
    --text-primary: #32363a;
    --text-secondary: #6a6d70;
    --border-color: #d9d9d9;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Header */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-sap {
    background: var(--sap-gold);
    color: white;
    font-weight: 700;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.logo-text {
    font-weight: 500;
    font-size: 16px;
    color: var(--sap-dark-blue);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-summary {
    font-size: 14px;
    color: var(--text-secondary);
}

.btn-import {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--sap-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-import:hover {
    background: #0854a0;
}

/* Main Container */
.main-container {
    display: flex;
    min-height: calc(100vh - 56px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.exam-list {
    padding: 12px;
}

.exam-item {
    display: block;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-primary);
}

.exam-item:hover {
    background: var(--sap-light-blue);
}

.exam-item.active {
    background: var(--sap-blue);
    color: white;
}

.exam-item-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.exam-item-meta {
    font-size: 12px;
    opacity: 0.8;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* Home View */
.welcome-card {
    background: linear-gradient(135deg, var(--sap-dark-blue), var(--sap-blue));
    color: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.welcome-card h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.welcome-card p {
    font-size: 16px;
    opacity: 0.9;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--sap-blue);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.exam-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.exam-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.2s;
}

.exam-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.exam-card-header {
    background: var(--sap-dark-blue);
    color: white;
    padding: 20px;
}

.exam-card-id {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.exam-card-title {
    font-size: 18px;
    font-weight: 600;
}

.exam-card-body {
    padding: 20px;
}

.exam-card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.exam-card-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    font-size: 14px;
}

.exam-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.exam-stat-icon {
    color: var(--sap-blue);
}

.exam-card-progress {
    margin-bottom: 16px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.progress-bar {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--sap-green);
    border-radius: 3px;
    transition: width 0.3s;
}

.exam-card-actions {
    display: flex;
    gap: 12px;
}

.btn-primary {
    flex: 1;
    padding: 10px 20px;
    background: var(--sap-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #0854a0;
}

.btn-secondary {
    flex: 1;
    padding: 10px 20px;
    background: transparent;
    color: var(--sap-blue);
    border: 1px solid var(--sap-blue);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--sap-light-blue);
}

/* Quiz View */
.quiz-view {
    max-width: 900px;
    margin: 0 auto;
}

.quiz-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back:hover {
    background: var(--bg-primary);
}

.quiz-info {
    flex: 1;
}

.quiz-info h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.quiz-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

#quiz-progress-text {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.quiz-progress .progress-bar {
    flex: 1;
    max-width: 200px;
}

.quiz-actions {
    display: flex;
    gap: 8px;
}

.btn-toggle-lang {
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-toggle-lang:hover {
    background: var(--sap-light-blue);
    border-color: var(--sap-blue);
}

/* Question Card */
.question-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 32px;
    margin-bottom: 24px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.question-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--sap-blue);
}

.question-type {
    font-size: 12px;
    padding: 4px 10px;
    background: var(--sap-light-blue);
    color: var(--sap-blue);
    border-radius: 12px;
}

.question-text {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-primary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.option-item:hover {
    background: var(--sap-light-blue);
    border-color: var(--sap-blue);
}

.option-item.selected {
    background: var(--sap-light-blue);
    border-color: var(--sap-blue);
}

.option-item.correct {
    background: #e6f4ea;
    border-color: var(--sap-green);
}

.option-item.incorrect {
    background: #fce8e6;
    border-color: var(--sap-red);
}

.option-item.disabled {
    pointer-events: none;
}

.option-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.option-item.selected .option-checkbox {
    background: var(--sap-blue);
    border-color: var(--sap-blue);
}

.option-item.selected .option-checkbox::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.option-item.correct .option-checkbox {
    background: var(--sap-green);
    border-color: var(--sap-green);
}

.option-item.correct .option-checkbox::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.option-item.incorrect .option-checkbox {
    background: var(--sap-red);
    border-color: var(--sap-red);
}

.option-item.incorrect .option-checkbox::after {
    content: '✗';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.option-label {
    font-weight: 600;
    color: var(--sap-blue);
    margin-right: 8px;
}

.option-text {
    font-size: 15px;
    line-height: 1.6;
}

/* Quiz Navigation */
.quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.btn-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nav:hover:not(:disabled) {
    background: var(--bg-primary);
    border-color: var(--sap-blue);
}

.btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-submit {
    padding: 12px 32px;
    background: var(--sap-gold);
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-submit:hover {
    background: #d99a00;
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Explanation Panel */
.explanation-panel {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-top: 20px;
    border-left: 4px solid var(--sap-blue);
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.result-icon {
    font-size: 24px;
}

.result-text {
    font-size: 16px;
    font-weight: 600;
}

.result-text.correct {
    color: var(--sap-green);
}

.result-text.incorrect {
    color: var(--sap-red);
}

.explanation-content h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.explanation-content p {
    font-size: 15px;
    line-height: 1.8;
}

/* Results View */
.results-view {
    max-width: 700px;
    margin: 0 auto;
}

.results-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 40px;
}

.results-header {
    text-align: center;
    margin-bottom: 32px;
}

.results-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.results-header span {
    font-size: 14px;
    color: var(--text-secondary);
}

.results-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-bottom: 32px;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sap-blue), var(--sap-dark-blue));
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-percent {
    font-size: 36px;
    font-weight: 700;
    color: white;
}

.score-details {
    text-align: left;
}

.score-details p {
    font-size: 18px;
    margin-bottom: 8px;
}

.score-status {
    font-weight: 600;
}

.score-status.pass {
    color: var(--sap-green);
}

.score-status.fail {
    color: var(--sap-red);
}

.results-breakdown {
    margin-bottom: 32px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 14px;
}

.breakdown-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
}

.breakdown-icon.correct {
    background: var(--sap-green);
}

.breakdown-icon.incorrect {
    background: var(--sap-red);
}

.results-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.import-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 8px 20px;
    background: var(--bg-primary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--sap-blue);
    color: white;
}

.import-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.file-upload {
    margin-bottom: 16px;
}

.file-upload input {
    display: none;
}

.file-upload label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload label:hover {
    border-color: var(--sap-blue);
    background: var(--sap-light-blue);
}

.modal-body textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 13px;
    resize: vertical;
}

.csv-format {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .header {
        padding: 0 16px;
    }

    .content-area {
        padding: 16px;
    }

    .welcome-card {
        padding: 24px;
    }

    .welcome-card h1 {
        font-size: 22px;
    }

    .quiz-header {
        flex-wrap: wrap;
    }

    .quiz-info {
        order: -1;
        width: 100%;
        margin-bottom: 12px;
    }

    .question-card {
        padding: 20px;
    }

    .quiz-navigation {
        flex-wrap: wrap;
    }

    .btn-submit {
        order: -1;
        width: 100%;
        margin-bottom: 12px;
    }

    .results-score {
        flex-direction: column;
    }

    .score-details {
        text-align: center;
    }
}

/* ================================================
   NEW: Scenario Panel
   ================================================ */

.scenario-panel {
    background: linear-gradient(135deg, #fefbf3, #fdf6e3);
    border: 1px solid #e8dcc8;
    border-left: 4px solid var(--sap-gold);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 20px;
}

.scenario-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sap-orange);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.scenario-header::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--sap-gold);
    border-radius: 50%;
}

.scenario-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
}

/* ================================================
   NEW: Domain Badge on Questions
   ================================================ */

.question-domain-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    background: #eef3f8;
    color: var(--sap-blue);
    border-radius: 12px;
    border: 1px solid #d0dde8;
    margin-left: auto;
}

/* ================================================
   NEW: Exam Card Meta Badges
   ================================================ */

.exam-card-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.exam-meta-badge {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    background: #f0f5fa;
    color: var(--sap-blue);
    border-radius: 12px;
    border: 1px solid #d8e4ee;
}

/* ================================================
   NEW: Mock Exam Button
   ================================================ */

.btn-mock {
    flex: 1;
    padding: 10px 20px;
    background: var(--sap-gold);
    color: #1a1a1a;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-mock:hover {
    background: #d99a00;
}

/* ================================================
   NEW: Mock Exam Timer
   ================================================ */

.mock-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.3s;
}

.mock-timer.warning {
    background: #fff8e1;
    border-color: var(--sap-orange);
    color: #e65100;
}

.mock-timer.critical {
    background: #fce8e6;
    border-color: var(--sap-red);
    color: var(--sap-red);
    animation: timer-pulse 1s infinite;
}

@keyframes timer-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ================================================
   NEW: Question Navigation Grid
   ================================================ */

.question-grid-panel {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-top: 20px;
}

.question-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.question-grid-legend {
    display: flex;
    gap: 16px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid var(--border-color);
}

.legend-dot.answered {
    background: #d4e6f9;
    border-color: var(--sap-blue);
}

.legend-dot.current {
    background: var(--sap-gold);
    border-color: var(--sap-gold);
}

.legend-dot.unanswered {
    background: var(--bg-primary);
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    margin-bottom: 16px;
}

.question-grid-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-grid-btn:hover {
    border-color: var(--sap-blue);
    background: #f0f5fa;
}

.question-grid-btn.answered {
    background: #d4e6f9;
    border-color: var(--sap-blue);
    color: var(--sap-blue);
    font-weight: 600;
}

.question-grid-btn.current {
    background: var(--sap-gold);
    border-color: var(--sap-gold);
    color: white;
    font-weight: 700;
    box-shadow: 0 0 0 2px rgba(240, 171, 0, 0.3);
}

.btn-finish-exam {
    width: 100%;
    padding: 12px;
    background: var(--sap-red);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-finish-exam:hover {
    background: #990000;
}

/* ================================================
   NEW: Domain Filter Panel
   ================================================ */

.domain-filter-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.domain-filter-btn {
    padding: 6px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.domain-filter-btn.active {
    background: var(--sap-blue);
    color: white;
    border-color: var(--sap-blue);
}

.domain-filter-btn:hover:not(.active) {
    background: #eef3f8;
    border-color: var(--sap-blue);
    color: var(--sap-blue);
}

/* ================================================
   NEW: Domain Stats in Exam Card
   ================================================ */

.domain-stats {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.domain-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
}

.domain-stats-header:hover {
    color: var(--sap-blue);
}

.domain-toggle-icon {
    transition: transform 0.2s;
}

.domain-stats-body {
    margin-top: 12px;
}

.domain-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 12px;
}

.domain-stat-label {
    flex: 0 0 160px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.domain-stat-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
    min-width: 40px;
}

.domain-stat-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.domain-stat-value {
    flex: 0 0 36px;
    text-align: right;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-primary);
}

.domain-stat-count {
    flex: 0 0 40px;
    text-align: right;
    font-size: 11px;
    color: var(--text-secondary);
}

/* ================================================
   NEW: Domain Breakdown in Results
   ================================================ */

.domain-breakdown {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.domain-breakdown h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.domain-breakdown-item {
    margin-bottom: 14px;
}

.domain-breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.domain-breakdown-name {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.domain-breakdown-status {
    font-size: 12px;
    font-weight: 600;
}

.domain-breakdown-status.pass {
    color: var(--sap-green);
}

.domain-breakdown-status.fail {
    color: var(--sap-orange);
}

/* ================================================
   NEW: Mock Exam Meta in Results
   ================================================ */

.mock-exam-meta {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.mock-meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.mock-meta-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.mock-meta-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ================================================
   NEW: Responsive Additions
   ================================================ */

@media (max-width: 768px) {
    .question-grid {
        grid-template-columns: repeat(8, 1fr);
    }

    .domain-filter-panel {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .domain-stat-label {
        flex: 0 0 100px;
    }

    .mock-timer {
        font-size: 13px;
        padding: 4px 10px;
    }

    .scenario-panel {
        padding: 16px;
    }

    .scenario-text {
        font-size: 13px;
    }

    .question-grid-legend {
        display: none;
    }

    .exam-card-actions {
        flex-direction: column;
    }

    .btn-mock {
        width: 100%;
    }

    .mock-exam-meta {
        flex-direction: column;
        gap: 12px;
    }
}
