/* css/style.css - PHASE 2: LOGIN & BASE LAYOUT */

:root {
    /* FARBEN */
    --bg-color: #ffffff;
    --text-color: #000000;
    --brand-red: #cc0000;
    --btn-blue: #002a7a;
    --btn-blue-active: #0037a3;
    --btn-blue-active-border: #1a5cb3;
    
    /* UI ELEMENTE */
    --bar-bg: #000000;
    --bar-text: #ffffff;
    --menu-bg: #f4f4f4;
    --input-bg: #eeeeee;
    --input-border: #cccccc;

    /* DIMENSIONEN */
    --content-max-width: 800px; /* Wunschbreite */

    /* CONTENT CONTAINER – alle vier Pages */
    --content-padding-x: 8px;
    --content-padding-y: 12px;
    --content-padding-top: 0;
}

/* DARK MODE */
body.dark-mode {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --menu-bg: #1a1a1a;
    --input-bg: #2a2a2a;
    --input-border: #444444;
}

body.dark-mode .system-top-bar {
    background-color: var(--tab-inactive);
}

/* CONTENT CONTAINER – Breakpoints */
@media (min-width: 1025px) {
    :root {
        --content-padding-x: 4px;
    }
}

@media (max-width: 768px) {
    :root {
        --content-padding-x: 8px;
        --content-padding-y: 12px;
    }
}

@media (max-width: 480px) {
    :root {
        --content-padding-x: 6px;
        --content-padding-y: 10px;
    }
}

/* GLOBAL RESET */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Arial Narrow', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background: var(--bg-color);
    min-height: 100vh;
    position: relative;
}

/* --- BRAND HEADER: MODERN SOLO PIANO ACADEMY + HANON MASTER (ein Element, kein schwarzer Balken) --- */
.brand-header {
    padding: 8px 12px 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1em;
    width: 100%;
    background-color: #ffffff;
}

body.dark-mode .brand-header {
    background-color: #000000;
}

.brand-academy {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1;
    font-size: clamp(1.5rem, 5vw, 3rem);
    color: var(--brand-red);
}

.brand-app {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1;
    font-size: clamp(1.5rem, 5vw, 3rem);
    color: #000000;
}

body.dark-mode .brand-app {
    color: #ffffff;
}

/* --- 3. SYSTEM TOP BAR --- */
.system-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
    padding: 18px 10px;
    background-color: var(--tab-inactive, #666666);
    color: #ccc;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    width: 100%;
}

.user-info {
    text-transform: lowercase;
    font-family: 'Arial Narrow', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-info-hidden {
    display: none;
}

.logout-hidden-for-admin {
    display: none !important;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

/* Gemeinsames Korsett für alle Action-Buttons */
.top-bar-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    transition: color 0.3s;
}

.top-bar-action-btn svg {
    width: 100%;
    height: 100%;
}

.top-bar-action-btn:hover {
    color: #fff;
}

/* Optischer Skalierungs-Trick für Theme-Icons */
.theme-icon-btn svg {
    width: 85%;
    height: 85%;
}

/* Fullscreen-Button: Icon-Wechsel */
.fullscreen-btn svg {
    width: 100%;
    height: 100%;
}

/* Theme Button Styles */
.theme-icon-btn {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
}

/* Icon Styles */
.icon-sun, .icon-moon {
    stroke: #ccc;
    transition: stroke 0.3s ease;
}

.theme-icon-btn:hover .icon-sun,
.theme-icon-btn:hover .icon-moon {
    stroke: #fff;
}

/* Icon-Sichtbarkeit */
.icon-sun {
    display: none;
}

.dark-mode .icon-sun {
    display: block;
}

.dark-mode .icon-moon {
    display: none;
}

body:not(.dark-mode) .icon-sun {
    display: none;
}

body:not(.dark-mode) .icon-moon {
    display: block;
}

.logout-btn svg {
    width: 90%;
    height: 90%;
    stroke: #ccc;
    transition: stroke 0.2s ease;
}

.logout-btn:hover svg {
    stroke: #fff;
}

/* Utility Fonts */
.font-oswald { font-family: 'Oswald', sans-serif; }

/* VOLLE BREITE FÜR TABS */
.page-wrapper {
    width: 100%;
    max-width: 100%; /* Tabs nehmen volle Breite ein */
    margin: 0 auto;
    background: var(--bg-color);
    min-height: 100vh;
}

/* DESKTOP: Kompaktere Kopfzeile (optional) */
@media (min-width: 1025px) {
    .brand-header {
        padding: 6px 12px 10px 12px;
    }
}

/* DESKTOP: Masteransicht mit allen vier Bereichen */
@media (min-width: 1025px) {
    .desktop-master {
        display: none;
        max-width: 100%;
        margin: 10px 0 40px 0;
        padding: 10px 20px 40px 20px;
    }

    .desktop-master.desktop-master-active {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-auto-rows: minmax(260px, auto);
        gap: 8px;
    }

    /* Student: 3 Panels gleichmäßig unter 3 Buttons */
    body.role-student .desktop-master.desktop-master-active {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .desktop-panel {
        background-color: var(--menu-bg);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* Tab-Buttons auf Desktop: nicht klickbar, nur Anzeige */
    body.desktop-master-view .tab-btn {
        pointer-events: none;
        cursor: default;
    }

    /* Überschriften in geladenen Views ausblenden (Buttons sind die Überschriften) */
    .desktop-panel-content h2 {
        display: none;
        margin: 0;
        padding: 0;
    }

    .desktop-panel-content {
        flex: 1;
        overflow: auto;
        padding: 4px;
        background-color: var(--bg-color);
    }
}

/* --- TABLET: Reduzierte Kopfzeile, Brand, Hero --- */
@media (max-width: 768px) {
    .system-top-bar {
        min-height: 48px;
        padding: 18px 10px;
    }

    .user-info {
        max-width: 50%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .brand-header {
        padding: 6px 12px;
    }

    .brand-academy,
    .brand-app {
        font-size: clamp(1.5rem, 6vw, 3rem);
    }
}

/* --- PHONE: Maximal kompakt --- */
@media (max-width: 480px) {
    .system-top-bar {
        min-height: 44px;
        height: auto;
        padding: 0 10px;
        justify-content: flex-end;
    }

    .system-top-bar .user-info {
        display: none;
    }

    .brand-header {
        padding: 6px 12px 10px 12px;
    }

    .brand-academy,
    .brand-app {
        font-size: clamp(1.2rem, 7vw, 2.5rem);
        white-space: nowrap;
    }
}