﻿.language-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    align-items: center;
}

    .language-grid > * {
        min-width: 0;
        width: 100%;
    }

:root {
    --coral: #FF6056;
    --purple: #382060;
    --lightgray: #F6F6F6;
    --darkgray: #97999B;
    --mud-palette-primary-darken: var(--purple);
    --mud-palette-info-darken: var(--purple);
    --mud-palette-primary: var(--purple);
    --myMaxWidth: 1000px;
    --myMaxWidthS: 450px;
    /* Zentrale Footer-Hoehe: Action-Bar richtet sich daran aus, damit zwischen beiden keine Luecke entsteht */
    --footer-height: 48px;
}

html, body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
}

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

/* Loading Styles */
.loading-container {
    position: absolute;
    top: 30vh;
    width: 100%;
    text-align: center;
    color: #666;
}

.loading-text {
    margin-top: 16px;
}

.boot-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.boot-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #382060;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.boot-loading-text {
    margin-top: 16px;
    color: #97999B;
    font-family: 'Roboto', sans-serif;
    font-size: 0.875rem;
}

/* Professional Skill App Layout */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
.skill-header {
    background-color: var(--coral);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    /* Horizontales Padding sitzt im .header-container; oben Notch-Bereich beruecksichtigen */
    padding: max(12px, env(safe-area-inset-top, 0px)) 0 12px 0;
}

.header-container {
    max-width: var(--myMaxWidth);
    margin: 0 auto;
    padding: 0 16px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

    .header-container > * {
        min-width: 0;
    }

/* Logo responsive behavior */
.logo-desktop {
    flex-shrink: 0;
    max-height: 32px;
}

    .logo-desktop img {
        height: 32px;
        width: auto;
        max-height: 32px;
    }

.logo-mobile {
    flex-shrink: 0;
    display: none;
    max-height: 28px;
}

    .logo-mobile img {
        height: 28px;
        width: auto;
        max-height: 28px;
    }

.header-title {
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
    margin: 0;
    /* Verhindert den Umbruch "IT-" / "Skills", wenn rechts daneben ein langer Name steht */
    white-space: nowrap;
    flex-shrink: 0;
}

/* Benutzerbereich rechts im Header */
.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    min-width: 0;
    color: white;
}

.header-logout-text {
    color: white !important;
    text-transform: none;
    min-width: auto;
    padding: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Nur auf Mobilgeraeten sichtbar, siehe Media-Query weiter unten */
.header-logout-icon {
    display: none;
    color: white !important;
    flex-shrink: 0;
}

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

/* Footer Styles */
.skill-footer {
    background-color: var(--purple);
    color: white;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    min-height: var(--footer-height);
    /* Home-Indicator / Safari-Leiste auf dem iPhone freihalten */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: content-box;
    display: flex;
    align-items: center;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

/* Desktop Footer */
.footer-desktop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.footer-slogan {
    color: white;
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
}

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

.footer-spacer {
    flex: 1;
}

.footer-separator {
    color: white;
    margin: 0 8px;
}

.footer-link {
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    transition: opacity 0.2s;
    white-space: nowrap;
}

    .footer-link:hover {
        opacity: 0.8;
    }

.footer-version {
    color: rgba(255,255,255,0.8);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Mobile Footer - Impressum und Datenschutz stehen ausgeschrieben in der Mitte, die Version
   klein rechts. Die drei Spalten halten die Rechtslinks exakt mittig. */
.footer-mobile {
    display: none;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    gap: 8px;
}

    .footer-mobile > * {
        min-width: 0;
    }

    .footer-mobile .footer-links {
        justify-self: center;
        gap: 0;
        font-size: 0.75rem;
    }

    /* Das Innenabstandspolster vergroessert die Trefferflaeche, ohne die Footerhoehe zu sprengen */
    .footer-mobile .footer-link {
        font-size: 0.75rem;
        padding: 12px 6px;
    }

    .footer-mobile .footer-separator {
        margin: 0 4px;
    }

    .footer-mobile .footer-version {
        justify-self: end;
        font-size: 0.7rem;
        text-align: right;
    }

/* Responsive Breakpoints */
@media (max-width: 599px) {
    /* Mobile: XS breakpoint */
    :root {
        --footer-height: 44px;
    }

    .logo-desktop {
        display: none;
    }

    .logo-mobile {
        display: block;
    }

    /* Mobiler Header: nur Logo, Titel und Logout-Icon */
    .header-logout-text {
        display: none;
    }

    /* Icon bleibt klein, die Trefferflaeche erreicht aber die empfohlenen 44px */
    .header-logout-icon {
        display: inline-flex;
        width: 44px;
        height: 44px;
    }

    /* Feste Zeilenhoehe: Das 44px-Logout-Icon wuerde die Kopfzeile sonst aufblaehen, sobald
       die Anmeldung steht - der Header spraenge beim Wechsel von der Ladephase zur Anwendung. */
    .skill-header {
        padding: max(4px, env(safe-area-inset-top, 0px)) 0 4px 0;
    }

    /* Drei gleich breite Aussenspalten halten den Titel exakt mittig, egal wie breit Logo
       und Logout-Icon sind. Ohne Anmeldung bleibt die dritte Spalte leer - der Titel bleibt zentriert. */
    .header-container {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        min-height: 44px;
    }

        .header-container > * {
            min-width: 0;
        }

    .header-title {
        font-size: 1.25rem;
        text-align: center;
    }

    .header-user {
        justify-self: end;
        margin-left: 0;
    }

    .footer-desktop {
        display: none;
    }

    .footer-mobile {
        display: grid;
    }

    .content-area {
        padding: 16px 12px 16px 12px;
    }

    .language-grid {
        grid-template-columns: 1fr auto;
    }

    .language-grid > :first-child {
        grid-column: 1 / -1;
    }

    .footer-container {
        padding: 0 12px;
    }
}

/* Additional Mobile Optimizations */
@media (max-width: 480px) {
    .header-container {
        padding: 0 12px;
        gap: 8px;
    }

    .footer-container {
        padding: 0 8px;
    }

    /* Auf 320px muss "Impressum | Datenschutz" samt Version in eine Zeile passen */
    .footer-mobile .footer-links,
    .footer-mobile .footer-link {
        font-size: 0.7rem;
    }

    .footer-mobile .footer-version {
        font-size: 0.65rem;
    }
}

/* Amadeus Fire Button Styles */
.myMainButton {
    background: var(--coral) !important;
    color: white !important;
    border: none !important;
}

    .myMainButton:hover {
        background: color-mix(in srgb, var(--coral) 85%, black) !important;
    }

.myAlternateButtonWithBorder {
    background: white !important;
    color: var(--coral) !important;
    border: 1px solid var(--coral) !important;
}

    .myAlternateButtonWithBorder:hover {
        background: var(--lightgray) !important;
    }

/* Action Buttons Fixed Above Footer */
.action-buttons-fixed {
    position: fixed;
    /* Sitzt buendig auf dem Footer, inklusive Safe-Area des Geraets */
    bottom: calc(var(--footer-height) + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    background: white;
    padding: 12px 16px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    z-index: 999;
}

.action-buttons-container {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
}

    /* Ohne Uppercase und Sperrschrift passen die Labels auch auf schmale Buttons */
    .action-buttons-container .mud-button-root {
        text-transform: none;
        letter-spacing: 0;
        white-space: nowrap;
        padding-left: 10px;
        padding-right: 10px;
    }

/* Kurzform der Button-Labels, nur auf Mobilgeraeten sichtbar */
.label-narrow {
    display: none;
}

/* Muss hinter den Basisregeln der Action-Bar stehen, sonst gewinnen diese bei gleicher Spezifitaet */
@media (max-width: 599px) {
    /* Schmalere Buttons: kleinere Schrift und Icons, kuerzeres Label */
    .action-buttons-container {
        gap: 8px;
    }

        .action-buttons-container .mud-button-root {
            font-size: 0.8125rem;
        }

            .action-buttons-container .mud-button-root .mud-icon-root {
                font-size: 1.1rem;
            }

    .label-wide {
        display: none;
    }

    .label-narrow {
        display: inline;
    }
}

/* Bewertungslegende - steht einmalig ueber der Gruppenliste.
   Feste Spalten statt Flex-Umbruch, damit die Eintraege buendig untereinander stehen. */
.rating-legend {
    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: start;
    gap: 2px 20px;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--lightgray);
    font-size: 0.75rem;
    color: var(--darkgray);
}

.rating-legend-title {
    grid-column: 1 / -1;
    margin-bottom: 2px;
    font-weight: 600;
    color: var(--purple);
}

/* Gleiche Farbe wie die tatsaechlichen Bewertungssterne */
.rating-legend-stars {
    color: var(--mud-palette-warning);
}

/* Muss hinter der Basisregel stehen, sonst gewinnt diese bei gleicher Spezifitaet.
   Zwei statt vier Spalten ergeben auf schmalen Displays einen buendigen 2x2-Block,
   in dem Sterne und Beschriftung nebeneinander passen. */
@media (max-width: 599px) {
    .rating-legend {
        grid-template-columns: auto auto;
        gap: 4px 16px;
    }
}

/* Rating Styles */
.mud-rating-item {
    cursor: pointer !important;
    pointer-events: auto !important;
}

.mud-rating-item-active {
    color: var(--coral) !important;
}

.mud-rating {
    pointer-events: auto !important;
}

/* Snackbar positioning - oberhalb von Footer und Action-Bar */
.mud-snackbar {
    margin-bottom: calc(var(--footer-height) + 68px + env(safe-area-inset-bottom, 0px)) !important;
}