html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Mobile-first: Buttons mit Icon + Text auf Smartphones als reine Icon-Buttons anzeigen */
@media (max-width: 768px) {
    .mud-button-root:has(.mud-button-start-icon),
    .mud-button-root:has(.mud-button-end-icon) {
        min-width: 44px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .mud-button-root:has(.mud-button-start-icon) .mud-button-label,
    .mud-button-root:has(.mud-button-end-icon) .mud-button-label {
        font-size: 0;
        gap: 0;
    }

    .mud-button-root:has(.mud-button-start-icon) .mud-button-start-icon,
    .mud-button-root:has(.mud-button-end-icon) .mud-button-end-icon {
        margin: 0;
    }

    .mud-button-root:has(.mud-button-start-icon) .mud-icon-root,
    .mud-button-root:has(.mud-button-end-icon) .mud-icon-root {
        font-size: 1.25rem;
    }
}

.admindesk-context-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-divider);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iN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wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.splash-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.splash-logo {
    max-width: 200px;
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    text-align: center;
    font-weight: bold;
    margin-top: 1rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* ============================================
   LERNAPP - GLOBALE TYPOGRAPHIE & DESIGN
   ============================================ */

/* Moderne Schriftart-Stack */
html, body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   STATION CARD STYLES
   ============================================ */

/* Konsistente Lerninhalt-Typographie */
.station-card-content {
    font-size: 1rem;
    line-height: 1.7;
}

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

.station-card-content p:last-child {
    margin-bottom: 0;
}

.station-card-content ul,
.station-card-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.station-card-content li {
    margin-bottom: 0.5rem;
}

.station-card-content h1,
.station-card-content h2,
.station-card-content h3,
.station-card-content h4,
.station-card-content h5,
.station-card-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.station-card-content h1:first-child,
.station-card-content h2:first-child,
.station-card-content h3:first-child,
.station-card-content h4:first-child,
.station-card-content h5:first-child,
.station-card-content h6:first-child {
    margin-top: 0;
}

/* ============================================
   TOUCH-OPTIMIERTE BUTTONS
   ============================================ */

/* Mindesthöhe für Touch-Targets */
.station-card .mud-button-root {
    min-height: 48px;
    border-radius: 12px;
}

/* Quiz-Antwort-Buttons */
.quiz-answer-option {
    min-height: 56px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.quiz-answer-option:hover {
    transform: translateY(-1px);
}

/* ============================================
   FEEDBACK-FARBEN
   ============================================ */

.feedback-correct {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: var(--mud-palette-success);
}

.feedback-incorrect {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--mud-palette-error);
}

.feedback-hint {
    background-color: rgba(14, 165, 233, 0.1);
    border-color: var(--mud-palette-info);
}

/* ============================================
   KONTRASTSTARKE STATION-KARTEN
   Helle Hintergründe mit dunklem Text für Lesbarkeit
   ============================================ */

/* Praxis-Karte: Hellgrüner Hintergrund mit dunklem Text */
.station-card-praxis {
    background-color: #ECFDF5 !important; /* Sehr helles Grün */
    border-left: 4px solid #059669 !important; /* Dunkles Grün für Akzent */
}

.station-card-praxis .station-card-label {
    color: #047857 !important; /* Dunkles Grün für Label */
    font-weight: 600;
}

.station-card-praxis .station-card-icon {
    color: #059669 !important; /* Dunkelgrün für Icon */
}

.station-card-praxis .station-card-text {
    color: #1E293B !important; /* Dunkler Text für beste Lesbarkeit */
}

/* Info-Karte: Hellblauer Hintergrund mit dunklem Text */
.station-card-info {
    background-color: #EFF6FF !important; /* Sehr helles Blau */
    border-left: 4px solid #2563EB !important; /* Kräftiges Blau für Akzent */
}

.station-card-info .station-card-label {
    color: #1D4ED8 !important; /* Dunkles Blau für Label */
    font-weight: 600;
}

.station-card-info .station-card-icon {
    color: #2563EB !important; /* Kräftiges Blau für Icon */
}

.station-card-info .station-card-text {
    color: #1E293B !important; /* Dunkler Text */
}

/* Erfolg-Karte: Für bestätigte Aufgaben */
.station-card-success {
    background-color: #ECFDF5 !important; /* Sehr helles Grün */
    border: 2px solid #059669 !important; /* Kräftiger grüner Rahmen */
    border-radius: 12px;
}

.station-card-success .station-card-icon {
    color: #047857 !important; /* Dunkelgrün für Icon */
}

.station-card-success .station-card-text {
    color: #047857 !important; /* Dunkelgrün für Erfolgstext */
    font-weight: 600;
}

/* Warnung/Merke-Karte: Orange Akzent mit dunklem Text */
.station-card-warning {
    background-color: #FFFBEB !important; /* Sehr helles Orange/Gelb */
    border-left: 4px solid #D97706 !important; /* Kräftiges Orange */
}

.station-card-warning .station-card-label {
    color: #B45309 !important; /* Dunkles Orange für Label */
    font-weight: 600;
}

.station-card-warning .station-card-icon {
    color: #D97706 !important; /* Kräftiges Orange für Icon */
}

.station-card-warning .station-card-text {
    color: #1E293B !important; /* Dunkler Text */
}

/* Hinweis-Box: Dezenter Info-Stil */
.station-hint-box {
    background-color: #F8FAFC !important; /* Sehr helles Grau */
    border: 1px solid #E2E8F0 !important;
    border-radius: 8px;
    padding: 12px 16px;
}

.station-hint-box .hint-icon {
    color: #64748B !important; /* Mittleres Grau für Icon */
}

.station-hint-box .hint-text {
    color: #475569 !important; /* Dunkles Grau für Text */
}

/* ============================================
   TEACHERDESK - KONTEXTNAVIGATION & PANEL-HEADER
   ============================================ */

.teacherdesk-context-nav {
    position: sticky;
    top: 64px;
    z-index: 10;
    background: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-divider);
}

.teacherdesk-context-select {
    min-width: 260px;
}

.teacherdesk-panel {
    overflow: hidden;
    border: 1px solid var(--mud-palette-divider);
}

.teacherdesk-panel-header {
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    padding: 10px 14px;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.teacherdesk-panel-body {
    background: var(--mud-palette-surface);
    padding: 12px;
}

.teacherdesk-panel-header .mud-typography,
.teacherdesk-panel-header .mud-icon-root {
    color: var(--mud-palette-primary-text) !important;
}

/* ============================================
   STATION EDITOR OVERLAY HEADER (global)
   ============================================ */

.station-editor-toolbar-global {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--mud-palette-primary) !important;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.mud-paper.station-editor-toolbar-global {
    background-color: var(--mud-palette-primary) !important;
    color: var(--mud-palette-primary-text) !important;
}

.station-editor-toolbar-global .station-editor-toolbar-content {
    min-height: 52px;
}

.station-editor-toolbar-global .station-editor-main-title {
    font-weight: 600;
    color: var(--mud-palette-primary-text) !important;
}

.station-editor-toolbar-global .station-editor-position {
    color: rgba(255, 255, 255, 0.9) !important;
}

.station-editor-toolbar-global .station-editor-type-chip {
    font-weight: 700;
    font-size: 0.85rem;
    min-height: 30px;
}

.station-editor-toolbar-global .station-editor-station-name {
    font-weight: 600;
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--mud-palette-primary-text) !important;
}

.station-editor-toolbar-global .station-editor-nav-icon,
.station-editor-toolbar-global .station-editor-action-icon {
    color: var(--mud-palette-primary-text) !important;
    border-radius: 10px;
}

.station-editor-toolbar-global .station-editor-save-blink {
    animation: stationSavePulse 0.9s ease-in-out infinite;
}

.station-editor-toolbar-global .station-editor-saved-check {
    color: var(--mud-palette-success) !important;
    background-color: var(--mud-palette-success) !important;
    color: white !important;
    font-size: 1rem;
    margin: 0 4px;
}

.station-editor-toolbar-global .station-editor-saved-check .mud-icon-root {
    color: white !important;
}

.station-editor-toolbar-global .station-editor-nav-icon .mud-icon-root,
.station-editor-toolbar-global .station-editor-action-icon .mud-icon-root,
.station-editor-toolbar-global .station-editor-nav-icon .mud-icon-button-label,
.station-editor-toolbar-global .station-editor-action-icon .mud-icon-button-label {
    color: var(--mud-palette-primary-text) !important;
}

.station-editor-toolbar-global .station-editor-nav-icon:hover,
.station-editor-toolbar-global .station-editor-action-icon:hover {
    background-color: rgba(255, 255, 255, 0.16) !important;
}

.station-editor-toolbar-global .station-editor-nav-icon:focus-visible,
.station-editor-toolbar-global .station-editor-action-icon:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.72);
    outline-offset: 1px;
}

.station-editor-toolbar-global .station-editor-nav-icon.mud-disabled,
.station-editor-toolbar-global .station-editor-action-icon.mud-disabled {
    color: rgba(255, 255, 255, 0.55) !important;
    opacity: 0.45;
}

.station-editor-toolbar-global .station-editor-nav-icon.mud-disabled .mud-icon-root,
.station-editor-toolbar-global .station-editor-action-icon.mud-disabled .mud-icon-root,
.station-editor-toolbar-global .station-editor-nav-icon.mud-disabled .mud-icon-button-label,
.station-editor-toolbar-global .station-editor-action-icon.mud-disabled .mud-icon-button-label {
    color: rgba(255, 255, 255, 0.55) !important;
}

@keyframes stationSavePulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
    }

    50% {
        transform: scale(1.12);
        opacity: 0.82;
        filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.45));
    }
}

@media (max-width: 1200px) {
    .station-editor-toolbar-global .station-editor-station-name {
        max-width: 220px;
    }
}

@media (max-width: 960px) {
    .station-editor-toolbar-global .station-editor-toolbar-content {
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .station-editor-toolbar-global .station-editor-position {
        width: 100%;
        margin-left: 42px;
    }
}

/* Fehler-Karte */
.station-card-error {
    background-color: #FEF2F2 !important; /* Sehr helles Rot */
    border-left: 4px solid #DC2626 !important; /* Kräftiges Rot */
}

.station-card-error .station-card-icon {
    color: #DC2626 !important; /* Kräftiges Rot für Icon */
}

.station-card-error .station-card-text {
    color: #1E293B !important; /* Dunkler Text */
}

/* ============================================
   MOBILE-OPTIMIERUNG
   ============================================ */

@media (max-width: 600px) {
    .station-card-content {
        font-size: 1rem;
        line-height: 1.6;
    }

    .station-card .mud-button-root {
        width: 100%;
        min-height: 52px;
    }

    /* Keine Tabellen auf Mobilgeräten */
    .station-card-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.animate-slide-in {
    animation: slideInUp 0.3s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* ============================================
   STUDENT EXPERIENCE REDESIGN (mobile-first)
   ============================================ */

.student-hero {
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(var(--mud-palette-primary-rgb), 0.06) 0%, rgba(var(--mud-palette-primary-rgb), 0.015) 100%);
}

.student-station-header {
    position: sticky;
    top: 0;
    z-index: 120;
    background: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-divider);
}

.student-player-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 84px;
}

.student-player-body {
    flex: 1;
}

.student-bottom-nav .mud-button-root {
    min-height: 52px;
    border-radius: 12px;
}

.flex-1 {
    flex: 1;
}
