@import url('../telc-theme-dark.css');
@import url('../telc-micro-interactions.css');
@import url('../telc-exercise-chrome.css');
@import url('../telc-language-selector.css');

/* ===================================
   B2 Exam - External Styles
   =================================== */

/* Basic Layout */
body { 
    font-family: Arial, sans-serif; 
    margin: 0; 
    background-color: #e0e0e0; 
    display: flex; 
    flex-direction: column; 
    height: 100vh; 
}

/* Header */
.header-top { 
    background-color: #1a2a44; 
    color: white; 
    padding: 10px 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 4px solid #cc0000; 
}

.logo-box { 
    background-color: white; 
    color: #1a2a44; 
    padding: 5px 15px; 
    font-weight: bold; 
    border-radius: 4px; 
    text-transform: uppercase; 
}

.info-top { 
    text-align: right; 
    font-size: 14px; 
}

.timer-highlight { 
    color: #ffcc00; 
    font-weight: bold; 
    font-size: 16px; 
}

/* Buttons */
.btn-blue { 
    background-color: #0056b3; 
    color: white; 
    border: none; 
    padding: 5px 15px; 
    border-radius: 4px; 
    cursor: pointer; 
    margin-left: 10px; 
    font-weight: bold; 
    text-decoration: none; 
    font-size: 12px;
}

.btn-blue:hover {
    background-color: #003d82;
}

.btn-green {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    margin-top: 10px;
}

.btn-green:hover {
    background-color: #218838;
}

.btn-green:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Main Content */
.main-content { 
    display: flex; 
    flex: 1; 
    overflow: hidden; 
    padding: 15px; 
    gap: 15px; 
}

/* ── Premium Schreiben chrome ── */
body.schreiben-exercise-page,
body[data-exercise-id*="schreiben"] {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: 'Inter', Arial, sans-serif;
}

body.schreiben-exercise-page .telc-exercise-topbar,
body.schreiben-exercise-page .telc-exercise-toolbar,
body[data-exercise-id*="schreiben"] .telc-exercise-topbar,
body[data-exercise-id*="schreiben"] .telc-exercise-toolbar {
    display: none !important;
}

.schreiben-page-frame {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 16px 15px 32px;
    box-sizing: border-box;
}

.schreiben-utility-bar {
    width: 100%;
    max-width: 896px;
    margin: 0 auto 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.4);
}

html.dark .schreiben-utility-bar {
    border-bottom-color: rgba(30, 41, 59, 0.4);
}

.schreiben-utility-bar__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    width: 100%;
}

.schreiben-utility-bar__nav--tools-only {
    justify-content: flex-end;
}

.schreiben-utility-home {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    background: #f1f5f9;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.2);
    transition: color 200ms ease, background 200ms ease, border-color 200ms ease;
}

.schreiben-utility-home:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.25);
}

html.dark .schreiben-utility-home {
    color: #94a3b8;
    background: #0f172a;
    border-color: rgba(51, 65, 85, 0.45);
}

html.dark .schreiben-utility-home:hover {
    color: #60a5fa;
    background: rgba(37, 99, 235, 0.12);
}

.schreiben-utility-bar__actions,
.schreiben-utility-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    flex-shrink: 0;
}

.schreiben-utility-controls .telc-lang-selector {
    flex-shrink: 0;
}

.schreiben-utility-controls .telc-lang-trigger {
    min-height: 42px;
    padding: 8px 14px;
    border-radius: 12px;
}

.schreiben-utility-controls .telc-theme-capsule {
    flex-shrink: 0;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
}

.schreiben-utility-bar .telc-lang-mount {
    display: flex;
    align-items: center;
}

.schreiben-utility-title {
    margin: 14px 0 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    line-height: 1.35;
}

html.dark .schreiben-utility-title {
    color: #e2e8f0;
}

@media (max-width: 640px) {
    .schreiben-utility-bar__nav {
        flex-direction: column;
        align-items: stretch;
    }

    .schreiben-utility-bar__actions {
        justify-content: center;
        flex-wrap: wrap;
    }
}

body.schreiben-exercise-page .header-top,
body.schreiben-exercise-page .telc-exercise-header,
body[data-exercise-id*="schreiben"] .header-top,
body[data-exercise-id*="schreiben"] .telc-exercise-header,
body.schreiben-exercise-page .schreiben-breadcrumb,
body[data-exercise-id*="schreiben"] .schreiben-breadcrumb {
    display: none !important;
}

body.schreiben-exercise-page .telc-exercise-topbar .telc-home-btn,
body[data-exercise-id*="schreiben"] .telc-exercise-topbar .telc-home-btn {
    display: none !important;
}

body.schreiben-exercise-page .main-content,
body[data-exercise-id*="schreiben"] .main-content {
    overflow: visible;
    flex: none;
    min-height: auto;
    padding-top: 0;
    align-items: flex-start;
}

body.schreiben-exercise-page .writing-side,
body[data-exercise-id*="schreiben"] .writing-side {
    overflow: visible;
    width: 58%;
}

body.schreiben-exercise-page .textarea-container,
body[data-exercise-id*="schreiben"] .textarea-container {
    flex: none;
    width: 100%;
}

body.schreiben-exercise-page .word-counter,
body[data-exercise-id*="schreiben"] .word-counter {
    margin-bottom: 12px;
    border-radius: 12px;
}

.schreiben-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    margin: 0 15px 32px;
    padding: 10px 20px;
    border-radius: 9999px;
    width: fit-content;
    background: rgba(241, 245, 249, 0.6);
    border: 1px solid rgba(226, 232, 240, 0.2);
    transition: all 300ms ease-in-out;
}

.schreiben-breadcrumb a {
    color: #64748b;
    text-decoration: none;
    transition: color 300ms ease-in-out;
}

.schreiben-breadcrumb a:hover {
    color: #2563eb;
}

.schreiben-breadcrumb__sep {
    font-size: 9px;
    margin: 0 4px;
    color: #cbd5e1;
}

.schreiben-breadcrumb__current {
    color: #475569;
}

.schreiben-glass-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    transition: all 300ms ease-in-out;
}

.schreiben-writing-panel {
    padding: 16px;
}

.schreiben-textarea,
body.schreiben-exercise-page #essay,
body[data-exercise-id*="schreiben"] #essay {
    width: 100%;
    min-height: 650px;
    height: auto;
    padding: 32px;
    font-size: 1rem;
    line-height: 1.625;
    border-radius: 24px;
    background: rgba(248, 250, 252, 0.7);
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 2px 10px rgba(15, 23, 42, 0.06);
    resize: vertical;
    font-family: 'Inter', Arial, sans-serif;
    transition: all 200ms ease-out;
    flex: none;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .schreiben-textarea,
    body.schreiben-exercise-page #essay,
    body[data-exercise-id*="schreiben"] #essay {
        min-height: 750px;
    }
}

.schreiben-textarea:focus,
body.schreiben-exercise-page #essay:focus,
body[data-exercise-id*="schreiben"] #essay:focus {
    outline: none;
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow:
        0 0 0 4px rgba(59, 130, 246, 0.3),
        inset 0 2px 10px rgba(15, 23, 42, 0.04);
}

.schreiben-check-actions {
    display: none !important;
}

.schreiben-action-zone {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 48px;
    margin-bottom: 24px;
    padding: 0 16px;
    box-sizing: border-box;
}

.schreiben-check-btn,
#check-btn.schreiben-check-btn {
    width: 100%;
    max-width: 100%;
    padding: 16px 64px;
    background: linear-gradient(to right, #2563eb, #4f46e5, #7c3aed);
    color: #ffffff !important;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.04em;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.35);
    transition: all 300ms ease-in-out;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.schreiben-check-btn__icon {
    color: #fbbf24;
    font-size: 1.125rem;
    animation: schreiben-sparkle-pulse 2s ease-in-out infinite;
    transition: transform 300ms ease;
}

.schreiben-check-btn:hover .schreiben-check-btn__icon {
    transform: rotate(12deg);
}

@keyframes schreiben-sparkle-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

@media (min-width: 768px) {
    .schreiben-check-btn,
    #check-btn.schreiben-check-btn {
        width: auto;
        min-width: 320px;
    }
}

.schreiben-check-btn:hover,
#check-btn.schreiben-check-btn:hover {
    box-shadow: 0 25px 50px -12px rgba(79, 70, 229, 0.45);
    transform: scale(1.02);
}

.schreiben-check-btn:active,
#check-btn.schreiben-check-btn:active {
    transform: scale(0.99);
}

.schreiben-check-btn:disabled,
#check-btn.schreiben-check-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.schreiben-bottom-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #94a3b8;
    text-decoration: none;
    transition: color 200ms ease;
}

.schreiben-bottom-home:hover {
    color: #3b82f6;
}

html.dark .schreiben-bottom-home {
    color: #64748b;
}

html.dark .schreiben-bottom-home:hover {
    color: #60a5fa;
}

.schreiben-bottom-home i {
    font-size: 0.75rem;
}

.exercise-result-card {
    display: block;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    max-width: 36rem;
    margin: 32px auto 0;
    text-align: center;
    transform: scale(0.95) translateY(8px);
    opacity: 0;
    transition: all 300ms ease-out;
}

@media (min-width: 768px) {
    .exercise-result-card {
        padding: 32px;
    }
}

.exercise-result-card.hidden {
    display: none;
}

.exercise-result-card.exercise-result-card--visible {
    display: block;
    transform: scale(1) translateY(0);
    opacity: 1;
    animation: exerciseResultFadeIn 300ms ease-out;
}

@keyframes exerciseResultFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.exercise-result-card__score-wrap {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.exercise-result-card__score {
    font-size: 2.25rem;
    font-weight: 900;
    color: #2563eb;
    margin: 0 0 8px;
    line-height: 1.1;
}

.exercise-result-card__max {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 400;
}

.exercise-result-card__badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #ecfdf5;
    color: #047857;
    margin-bottom: 8px;
}

.exercise-result-card__grade {
    font-size: 0.875rem;
    color: #64748b;
    margin: 8px 0 0;
    font-weight: 600;
}

.exercise-result-card__criteria {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    margin-bottom: 16px;
    text-align: left;
}

.exercise-result-card__criterion {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(241, 245, 249, 0.7);
    transition: all 300ms ease-out;
}

.exercise-result-card__criterion-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.exercise-result-card__criterion-score {
    font-size: 0.9375rem;
    font-weight: 800;
    color: #1e293b;
}

.exercise-result-card__insights {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.exercise-result-card__insight {
    font-size: 0.8125rem;
    line-height: 1.55;
    color: #475569;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.6);
    transition: all 300ms ease-out;
}

.task-side { 
    width: 45%; 
    background: white; 
    padding: 20px; 
    border-radius: 8px; 
    overflow-y: auto; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    line-height: 1.5; 
    font-size: 13.5px; 
}

.task-side.schreiben-prompt-borderless,
body.schreiben-exercise-page .task-side.schreiben-prompt-borderless,
body[data-exercise-id*="schreiben"] .task-side.schreiben-prompt-borderless {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
    margin-bottom: 24px;
    overflow: visible;
}

.task-side.schreiben-prompt-borderless .schreiben-ad-plain,
.task-side.schreiben-prompt-borderless .ad-full {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 0 16px 0;
}

.task-side.schreiben-prompt-borderless .schreiben-meta-line,
.task-side.schreiben-prompt-borderless .yellow-box {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 0 12px 0 !important;
    margin-bottom: 12px !important;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

html.dark .task-side.schreiben-prompt-borderless .schreiben-meta-line,
html.dark .task-side.schreiben-prompt-borderless .yellow-box {
    color: #94a3b8;
}

.task-side.schreiben-prompt-frame {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.4) !important;
    border: 1px solid rgba(226, 232, 240, 0.6) !important;
    border-radius: 24px !important;
    padding: 24px !important;
    margin-bottom: 32px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    color: #1e293b;
    overflow-y: auto;
    transition: all 300ms ease;
}

@media (min-width: 768px) {
    .task-side.schreiben-prompt-frame {
        padding: 32px !important;
    }
}

.schreiben-prompt-glass-inner {
    position: relative;
    z-index: 1;
}

html.dark .task-side.schreiben-prompt-frame {
    background: rgba(15, 23, 42, 0.4) !important;
    border-color: rgba(30, 41, 59, 0.6) !important;
    color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.task-side.schreiben-prompt-frame .ad-full {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(148, 163, 184, 0.45);
}

html.dark .task-side.schreiben-prompt-frame .ad-full {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(51, 65, 85, 0.65);
}

.task-side.schreiben-glass-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 24px;
}

.writing-side { 
    width: 55%; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}

/* Textarea */
.textarea-container {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

textarea { 
    flex: 1; 
    padding: 15px; 
    border-radius: 8px; 
    border: 1px solid #38055f; 
    font-size: 16px; 
    line-height: 1.6; 
    resize: none; 
    outline: none; 
    font-family: Arial, sans-serif;
}

/* Word Counter */
.word-counter { 
    background: #1a2a44; 
    color: white; 
    padding: 8px 15px; 
    border-radius: 5px; 
    font-weight: bold; 
    display: flex; 
    gap: 15px; 
    align-items: center;
    justify-content: space-between;
}

.counter-left {
    display: flex;
    gap: 15px;
}

/* Ad Boxes */
.ad-full { 
    border: 2px solid #333; 
    padding: 15px; 
    background: #fff; 
    margin: 10px 0; 
}

.yellow-box { 
    background-color: #ffffcc; 
    border: 1px solid #e6e600; 
    padding: 10px; 
    margin-bottom: 15px; 
    font-size: 13px; 
    border-radius: 5px; 
    font-weight: bold; 
}

/* ===================================
   Correction Panel Styles
   =================================== */

.correction-panel {
    background: white;
    border-radius: 8px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: none;
}

.correction-panel.show {
    display: block;
}

.correction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1a2a44;
}

.correction-title {
    font-size: 18px;
    font-weight: bold;
    color: #1a2a44;
}

.close-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.close-btn:hover {
    background: #c82333;
}

.correction-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 14px;
}

.summary-label {
    font-weight: bold;
    color: #495057;
}

.summary-value {
    color: #1a2a44;
    font-weight: bold;
}

.error-item {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.error-type {
    font-weight: bold;
    color: #856404;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.error-message {
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.error-context {
    background: white;
    padding: 8px;
    border-radius: 3px;
    margin-bottom: 8px;
    font-family: monospace;
    font-size: 13px;
}

.error-word {
    background: #ff6b6b;
    color: white;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: bold;
}

.suggestion {
    background: #d4edda;
    color: #155724;
    padding: 2px 6px;
    border-radius: 2px;
    font-weight: bold;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0056b3;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-errors {
    text-align: center;
    padding: 30px;
    color: #28a745;
    font-size: 16px;
}

.no-errors::before {
    content: "✓";
    display: block;
    font-size: 48px;
    margin-bottom: 10px;
}

.score-badge {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
}

/* Notification */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none;
    animation: slideIn 0.3s ease-out;
}

.notification.show {
    display: block;
}

.notification.error {
    background: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ── Schreiben (B2) dark mode ── */
html.dark body {
    background-color: #0f172a;
    color: #e2e8f0;
}

html.dark .task-side:not(.schreiben-prompt-borderless):not(.schreiben-prompt-frame),
html.dark .correction-panel {
    background: rgba(30, 41, 59, 0.92);
    border-color: #475569;
    color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

html.dark .ad-full:not(.schreiben-ad-plain) {
    background: rgba(30, 41, 59, 0.92);
    border-color: #475569;
    color: #e2e8f0;
}

html.dark .task-side.schreiben-prompt-borderless .ad-full,
html.dark .task-side.schreiben-prompt-borderless .schreiben-ad-plain {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

html.dark .task-side.schreiben-prompt-frame .ad-full {
    background: rgba(15, 23, 42, 0.55) !important;
    border-color: rgba(51, 65, 85, 0.65) !important;
    color: #e2e8f0;
}

html.dark .yellow-box {
    background: rgba(51, 65, 85, 0.85);
    border-color: #64748b;
    color: #fde68a;
}

html.dark .correction-title,
html.dark .summary-value {
    color: #f1f5f9;
}

html.dark .correction-summary,
html.dark .error-context {
    background: #334155;
    color: #e2e8f0;
}

html.dark .summary-label {
    color: #94a3b8;
}

html.dark .error-item {
    background: rgba(71, 55, 20, 0.45);
    border-left-color: #fbbf24;
}

html.dark .error-message {
    color: #e2e8f0;
}

html.dark textarea {
    background: #0f172a;
    color: #f1f5f9;
    border-color: #475569;
}

html.dark .word-counter {
    background: #334155;
    color: #f1f5f9;
}

html.dark .schreiben-breadcrumb {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(51, 65, 85, 0.45);
    color: #64748b;
}

html.dark .schreiben-breadcrumb a {
    color: #94a3b8;
}

html.dark .schreiben-breadcrumb a:hover {
    color: #60a5fa;
}

html.dark .schreiben-breadcrumb__current {
    color: #cbd5e1;
}

html.dark .schreiben-glass-card,
html.dark .task-side.schreiben-glass-card {
    background: rgba(15, 23, 42, 0.7) !important;
    border-color: rgba(51, 65, 85, 0.5) !important;
}

html.dark .schreiben-textarea,
html.dark body.schreiben-exercise-page #essay,
html.dark body[data-exercise-id*="schreiben"] #essay {
    background: rgba(2, 6, 23, 0.4);
    border-color: #1e293b;
    color: #f1f5f9;
}

html.dark .schreiben-textarea:focus,
html.dark body.schreiben-exercise-page #essay:focus,
html.dark body[data-exercise-id*="schreiben"] #essay:focus {
    background: #020617;
    border-color: #3b82f6;
    box-shadow:
        0 0 0 4px rgba(59, 130, 246, 0.3),
        inset 0 2px 10px rgba(0, 0, 0, 0.25);
}

html.dark .exercise-result-card {
    background: rgba(15, 23, 42, 0.95);
    border-color: #1e293b;
}

html.dark .exercise-result-card__score-wrap {
    border-bottom-color: rgba(51, 65, 85, 0.8);
}

html.dark .exercise-result-card__score {
    color: #60a5fa;
}

html.dark .exercise-result-card__badge {
    background: rgba(6, 78, 59, 0.4);
    color: #34d399;
}

html.dark .exercise-result-card__grade {
    color: #94a3b8;
}

html.dark .exercise-result-card__criterion {
    background: rgba(30, 41, 59, 0.6);
}

html.dark .exercise-result-card__criterion-label {
    color: #94a3b8;
}

html.dark .exercise-result-card__criterion-score {
    color: #f1f5f9;
}

html.dark .exercise-result-card__insight {
    background: rgba(30, 41, 59, 0.55);
    border-color: rgba(51, 65, 85, 0.6);
    color: #cbd5e1;
}

/* Schreiben canvas — final overrides (must beat generic textarea rules below) */
body.schreiben-exercise-page .main-content,
body[data-exercise-id*="schreiben"] .main-content {
    overflow: visible !important;
    flex: none !important;
    min-height: auto !important;
}

body.schreiben-exercise-page .textarea-container,
body[data-exercise-id*="schreiben"] .textarea-container {
    flex: none !important;
    overflow: visible !important;
    width: 100% !important;
}

body.schreiben-exercise-page #essay,
body.schreiben-exercise-page .schreiben-textarea,
body[data-exercise-id*="schreiben"] #essay,
body[data-exercise-id*="schreiben"] .schreiben-textarea {
    flex: none !important;
    width: 100% !important;
    min-height: 650px !important;
    height: auto !important;
    resize: vertical !important;
    padding: 32px !important;
    font-size: 1rem !important;
    line-height: 1.625 !important;
    border-radius: 24px !important;
    box-sizing: border-box !important;
}

@media (min-width: 768px) {
    body.schreiben-exercise-page #essay,
    body.schreiben-exercise-page .schreiben-textarea,
    body[data-exercise-id*="schreiben"] #essay,
    body[data-exercise-id*="schreiben"] .schreiben-textarea {
        min-height: 750px !important;
    }
}

body.schreiben-exercise-page #check-btn.btn-green,
body.schreiben-exercise-page .schreiben-check-btn,
body[data-exercise-id*="schreiben"] #check-btn.btn-green,
body[data-exercise-id*="schreiben"] .schreiben-check-btn {
    background: linear-gradient(to right, #2563eb, #4f46e5) !important;
    border: none !important;
    margin-top: 0 !important;
}

@import url('../telc-theme-dark-exercises.css');
