/* =====================================================
   MINA RESULTAT — CSS
   ===================================================== */

/* Hero */
.resultat-hero {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(16, 185, 129, 0.1) 100%);
}

.resultat-hero .hero-content {
    text-align: center;
    margin: 0 auto;
}

.resultat-hero .hero-stats {
    justify-content: center;
}

.resultat-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* Period filter */
.resultat-period-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.resultat-period-btn {
    padding: 0.5rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.resultat-period-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.resultat-period-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

/* Stat cards */
.resultat-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.resultat-stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.resultat-stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.resultat-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.resultat-stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Section */
.resultat-section {
    margin-bottom: 2.5rem;
}

.resultat-section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1rem;
}

/* Subject grid */
.resultat-subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.resultat-subject-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.25rem;
}

.resultat-subject-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.resultat-subject-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
}

.resultat-subject-name {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.resultat-subject-attempts {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.resultat-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.resultat-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.resultat-progress-fill.good { background: #10b981; }
.resultat-progress-fill.medium { background: #f59e0b; }
.resultat-progress-fill.low { background: #ef4444; }

.resultat-subject-score {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-align: right;
}

/* Empty */
.resultat-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.5);
}

.resultat-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.resultat-empty p {
    font-size: 0.95rem;
    max-width: 400px;
    margin: 0 auto;
}

/* History filters */
.resultat-history-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.resultat-filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 150px;
}

.resultat-filter-select option {
    background: #1a1a2e;
    color: #fff;
}

/* History list */
.resultat-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.resultat-history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.resultat-history-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.3);
}

.resultat-type-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    min-width: 50px;
    text-align: center;
}

.resultat-type-badge.quiz { background: rgba(102, 126, 234, 0.2); color: #667eea; }
.resultat-type-badge.np { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.resultat-type-badge.exam { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }

.resultat-history-info {
    flex: 1;
    min-width: 0;
}

.resultat-history-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resultat-history-subject {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.resultat-history-score {
    font-size: 1.1rem;
    font-weight: 700;
    min-width: 55px;
    text-align: right;
}

.resultat-history-score.good { color: #10b981; }
.resultat-history-score.medium { color: #f59e0b; }
.resultat-history-score.low { color: #ef4444; }

.resultat-history-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
}

.resultat-history-arrow {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.2rem;
}

/* Load more */
.resultat-load-more {
    display: block;
    margin: 1.5rem auto 0;
    padding: 0.7rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.resultat-load-more:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* =====================================================
   REVIEW MODAL
   ===================================================== */
.resultat-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.resultat-modal {
    background: #1e1e3a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.resultat-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.resultat-modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

.resultat-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.resultat-modal-close:hover {
    color: #fff;
}

.resultat-modal-stats {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
}

.resultat-modal-stat {
    text-align: center;
}

.resultat-modal-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.resultat-modal-stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.resultat-modal-filter {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.resultat-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

.resultat-toggle-label input[type="checkbox"] {
    accent-color: #667eea;
}

.resultat-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Question review */
.resultat-review-question {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
}

.resultat-review-question.correct {
    border-left: 3px solid #10b981;
}

.resultat-review-question.wrong {
    border-left: 3px solid #ef4444;
}

.resultat-review-q-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.resultat-review-q-num {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-weight: 600;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.resultat-review-q-status {
    font-size: 0.85rem;
    font-weight: 600;
}

.resultat-review-q-status.correct { color: #10b981; }
.resultat-review-q-status.wrong { color: #ef4444; }

.resultat-review-q-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.resultat-review-q-text img {
    max-width: 100%;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
}

.resultat-review-answer {
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.resultat-review-answer.user-wrong {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.resultat-review-answer.user-correct {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.resultat-review-answer.correct-answer {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.resultat-review-answer-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 0.15rem;
}

.resultat-review-explanation {
    margin-top: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.resultat-review-no-facit {
    padding: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    font-size: 0.9rem;
}

/* MC options in review */
.resultat-review-options {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.resultat-review-option {
    padding: 0.5rem 0.75rem;
    border-radius: 0.4rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.resultat-review-option.selected {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.resultat-review-option.correct-option {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
}

.resultat-review-option.selected.correct-option {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

/* MC option with wrong highlight */
.resultat-review-option.wrong-option {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

/* Option images */
.resultat-review-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.resultat-review-option-img {
    max-width: 200px;
    max-height: 120px;
    border-radius: 0.4rem;
    object-fit: contain;
}

.resultat-review-empty-opt {
    font-style: italic;
    opacity: 0.5;
}

/* Write answer: "eller" separator */
.resultat-review-or {
    opacity: 0.5;
    font-style: italic;
    margin: 0 0.25rem;
}

/* Question images */
.resultat-review-image {
    max-width: 100%;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    display: block;
}

.resultat-inline-image-row {
    display: flex;
    gap: 12px;
    margin: 0.5rem 0;
}

.resultat-inline-image-half {
    flex: 1;
}

.resultat-inline-image-half img {
    max-width: 100%;
}

.resultat-text-segment {
    display: inline;
}

/* Group parent */
.resultat-review-group-parent {
    margin-bottom: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.5;
}

.resultat-review-group-parent img {
    max-width: 100%;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
}

.resultat-review-child {
    margin-left: 1rem;
    border-left-width: 3px;
}

/* Explanation images */
.resultat-review-explanation img {
    max-width: 100%;
    border-radius: 0.4rem;
    margin-top: 0.5rem;
}

/* Matching review */
.resultat-review-matching {
    margin-top: 0.25rem;
}

.resultat-review-matching-titles {
    display: flex;
    gap: 1rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.resultat-review-matching-titles span {
    flex: 1;
}

.resultat-review-matching-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: 0.4rem;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.resultat-review-matching-row.correct {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.resultat-review-matching-row.wrong {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.resultat-review-matching-left,
.resultat-review-matching-mid,
.resultat-review-matching-right {
    flex: 1;
    color: rgba(255, 255, 255, 0.85);
}

.resultat-review-matching-arrow {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.resultat-review-matching-img {
    max-width: 80px;
    max-height: 50px;
    border-radius: 0.3rem;
    margin: 0.2rem 0;
    object-fit: contain;
}

.resultat-match-correct { color: #6ee7b7; }
.resultat-match-wrong { color: #fca5a5; }

.resultat-review-matching-correct-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.8rem 0.3rem 2.5rem;
    font-size: 0.8rem;
    color: #6ee7b7;
    margin-bottom: 0.3rem;
}

.resultat-review-matching-correct-label {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.7;
}

/* Loading spinner */
.resultat-loading {
    text-align: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.5);
}

.resultat-loading::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: resultat-spin 0.6s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

@keyframes resultat-spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   LIGHT MODE
   ===================================================== */
body.light-mode .resultat-period-btn {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.03);
    color: rgba(0, 0, 0, 0.6);
}

body.light-mode .resultat-period-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #000;
}

body.light-mode .resultat-period-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

body.light-mode .resultat-stat-card {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.light-mode .resultat-stat-value {
    color: #1a1a2e;
}

body.light-mode .resultat-stat-label {
    color: rgba(0, 0, 0, 0.5);
}

body.light-mode .resultat-section-title {
    color: #1a1a2e;
}

body.light-mode .resultat-subject-card {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.light-mode .resultat-subject-name {
    color: #1a1a2e;
}

body.light-mode .resultat-subject-attempts {
    color: rgba(0, 0, 0, 0.5);
}

body.light-mode .resultat-progress-bar {
    background: rgba(0, 0, 0, 0.08);
}

body.light-mode .resultat-subject-score {
    color: rgba(0, 0, 0, 0.7);
}

body.light-mode .resultat-filter-select {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.15);
    color: #333;
}

body.light-mode .resultat-filter-select option {
    background: #fff;
    color: #333;
}

body.light-mode .resultat-history-item {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .resultat-history-item:hover {
    background: #f8f9fa;
    border-color: rgba(102, 126, 234, 0.3);
}

body.light-mode .resultat-history-title {
    color: #1a1a2e;
}

body.light-mode .resultat-history-subject {
    color: rgba(0, 0, 0, 0.5);
}

body.light-mode .resultat-history-date {
    color: rgba(0, 0, 0, 0.4);
}

body.light-mode .resultat-history-arrow {
    color: rgba(0, 0, 0, 0.3);
}

body.light-mode .resultat-load-more {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.03);
    color: rgba(0, 0, 0, 0.6);
}

body.light-mode .resultat-load-more:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #000;
}

body.light-mode .resultat-empty {
    color: rgba(0, 0, 0, 0.5);
}

/* Modal light mode */
body.light-mode .resultat-modal {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .resultat-modal-header {
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .resultat-modal-title {
    color: #1a1a2e;
}

body.light-mode .resultat-modal-close {
    color: rgba(0, 0, 0, 0.5);
}

body.light-mode .resultat-modal-close:hover {
    color: #000;
}

body.light-mode .resultat-modal-stats {
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .resultat-modal-stat-value {
    color: #1a1a2e;
}

body.light-mode .resultat-modal-stat-label {
    color: rgba(0, 0, 0, 0.5);
}

body.light-mode .resultat-modal-filter {
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .resultat-toggle-label {
    color: rgba(0, 0, 0, 0.7);
}

body.light-mode .resultat-review-question {
    background: #f8f9fa;
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .resultat-review-q-num {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.6);
}

body.light-mode .resultat-review-q-text {
    color: #333;
}

body.light-mode .resultat-review-option {
    color: rgba(0, 0, 0, 0.7);
    border-color: rgba(0, 0, 0, 0.06);
    background: rgba(0, 0, 0, 0.02);
}

body.light-mode .resultat-review-option.selected {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

body.light-mode .resultat-review-option.correct-option {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
}

body.light-mode .resultat-review-option.selected.correct-option {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

body.light-mode .resultat-review-option.wrong-option {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

body.light-mode .resultat-review-answer.user-wrong {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: #dc2626;
}

body.light-mode .resultat-review-answer.user-correct {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
    color: #059669;
}

body.light-mode .resultat-review-answer.correct-answer {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.2);
    color: #059669;
}

body.light-mode .resultat-review-answer-label {
    color: rgba(0, 0, 0, 0.5);
}

body.light-mode .resultat-review-matching-row.correct {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.2);
}

body.light-mode .resultat-review-matching-row.wrong {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.2);
}

body.light-mode .resultat-loading {
    color: rgba(0, 0, 0, 0.5);
}

body.light-mode .resultat-review-or {
    color: rgba(0, 0, 0, 0.4);
}

body.light-mode .resultat-review-empty-opt {
    color: rgba(0, 0, 0, 0.4);
}

body.light-mode .resultat-review-explanation {
    background: rgba(102, 126, 234, 0.08);
    border-color: rgba(102, 126, 234, 0.15);
    color: rgba(0, 0, 0, 0.6);
}

body.light-mode .resultat-review-no-facit {
    color: rgba(0, 0, 0, 0.5);
}

body.light-mode .resultat-review-group-parent {
    background: rgba(102, 126, 234, 0.06);
    border-color: rgba(102, 126, 234, 0.12);
    color: #333;
}

body.light-mode .resultat-review-matching-titles {
    color: rgba(0, 0, 0, 0.5);
}

body.light-mode .resultat-review-matching-left,
body.light-mode .resultat-review-matching-mid,
body.light-mode .resultat-review-matching-right {
    color: #333;
}

body.light-mode .resultat-review-matching-arrow {
    color: rgba(0, 0, 0, 0.3);
}

body.light-mode .resultat-review-matching-correct-row {
    color: #059669;
}

body.light-mode .resultat-match-correct { color: #059669; }
body.light-mode .resultat-match-wrong { color: #dc2626; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .resultat-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .resultat-subjects-grid {
        grid-template-columns: 1fr 1fr;
    }

    .resultat-history-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .resultat-history-info {
        order: 1;
        flex-basis: calc(100% - 70px);
    }

    .resultat-type-badge {
        order: 0;
    }

    .resultat-history-score {
        order: 2;
    }

    .resultat-history-date {
        order: 3;
    }

    .resultat-history-arrow {
        display: none;
    }

    .resultat-modal {
        max-height: 90vh;
        border-radius: 0.75rem;
    }

    .resultat-modal-stats {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .resultat-content {
        padding: 1rem 1rem 3rem;
    }

    .resultat-stats-grid {
        grid-template-columns: 1fr;
    }

    .resultat-subjects-grid {
        grid-template-columns: 1fr;
    }

    .resultat-period-filter {
        gap: 0.35rem;
    }

    .resultat-period-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .resultat-stat-card {
        padding: 1rem;
    }

    .resultat-stat-value {
        font-size: 1.3rem;
    }

    .resultat-modal {
        max-width: 100%;
        max-height: 95vh;
    }

    .resultat-modal-body {
        padding: 1rem;
    }

    .resultat-review-question {
        padding: 1rem;
    }
}

/* =====================================================
   ICKE-INLOGGAD POPUP
   ===================================================== */

.resultat-guest-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: resultatGuestFadeIn 0.3s ease;
}
@keyframes resultatGuestFadeIn { from { opacity: 0; } to { opacity: 1; } }

.resultat-guest-modal {
    background: #1e1e3a;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    padding: 40px 30px;
    max-width: 420px;
    width: 90%;
    text-align: center;
}
.resultat-guest-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}
.resultat-guest-modal h2 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.resultat-guest-headline {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.resultat-guest-desc {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 20px;
}
.resultat-guest-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    margin: 20px 0;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.resultat-guest-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}
.resultat-guest-feature span {
    font-size: 1rem;
    flex-shrink: 0;
}
.resultat-guest-cta {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}
.resultat-guest-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}
.resultat-guest-login {
    display: inline-block;
    margin-top: 15px;
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
}
.resultat-guest-login:hover {
    text-decoration: underline;
}

/* Light mode */
body.light-mode .resultat-guest-modal {
    background: #fff;
    border-color: rgba(102, 126, 234, 0.2);
}
body.light-mode .resultat-guest-headline {
    color: #1d1d1f;
}
body.light-mode .resultat-guest-desc {
    color: rgba(0, 0, 0, 0.4);
}
body.light-mode .resultat-guest-features {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .resultat-guest-feature {
    color: rgba(0, 0, 0, 0.7);
}
