/* ==========================================================================
   hauptseite.css - Basis-Styles + Stile für die Hauptanwendung (Spielegruppe)
   MINIMALINVASIVE ANPASSUNG für Hintergrund
   ========================================================================== */

/* --- Allgemeines Reset & Basis-Styling --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html {
    min-height: 100%; /* <<<< Hinzugefügt/Sichergestellt */
}
body {
    /* height: 100%; */ /* <<< Explizites height: 100% entfernt/auskommentiert */
    min-height: 100%; /* <<<< Hinzugefügt/Sichergestellt */
    font-family: sans-serif;
    color: #333;
    font-size: 16px;
    line-height: 1.6;
    background-color: #f4f4f4; /* Fallback */
}
a { color: #007bff; text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { margin-bottom: 0.8em; color: #444; line-height: 1.2; }
h1 { font-size: 2em; } h2 { font-size: 1.5em; } h3 { font-size: 1.2em; } h4 { font-size: 1.1em; } h5 { font-size: 1em; } h6 { font-size: 0.9em; }
img { max-width: 100%; height: auto; vertical-align: middle; }
.inline-icon { width: 16px; height: 16px; vertical-align: middle; margin-right: 4px; object-fit: contain; }

/* --- Basis-Formular-Styling --- */
form { margin-bottom: 20px; }
.form-group { margin-bottom: 15px; text-align: left; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-control { display: block; width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; line-height: 1.5; box-sizing: border-box; }
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { height: calc(1.5em + .75rem + 12px); }
input[type="file"].form-control { padding: 5px; height: auto; }
.form-control-sm { height: calc(1.5em + .5rem + 2px); padding: .25rem .5rem; font-size: .875rem; line-height: 1.5; border-radius: .2rem; }
select.form-control-sm { height: calc(1.5em + .5rem + 6px); }
.form-info, .help-block { font-size: 0.9em; color: #666; margin-top: 5px; display: block; }
fieldset { border: 1px solid #ccc; padding: 15px; margin-bottom: 20px; border-radius: 4px; }
legend { padding: 0 10px; font-weight: bold; width: auto; margin-left: 10px; font-size: 1.1em; }

/* --- Basis Button-Styling --- */
.btn { display: inline-block; padding: 10px 20px; font-size: 1rem; font-weight: 400; line-height: 1.5; text-align: center; text-decoration: none; vertical-align: middle; cursor: pointer; user-select: none; background-color: transparent; border: 1px solid transparent; border-radius: .25rem; transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out; margin: 5px 5px 5px 0; }
.btn:hover { text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: .65; cursor: not-allowed; }
.btn-sm { padding: .25rem .5rem; font-size: .875rem; border-radius: .2rem; }
.btn-xs { padding: .1rem .4rem; font-size: .75rem; line-height: 1.2; border-radius: .15rem; }
.btn-primary { color: #fff; background-color: #007bff; border-color: #007bff; }
.btn-primary:hover { color: #fff; background-color: #0056b3; border-color: #0056b3; }
.btn-secondary { color: #fff; background-color: #6c757d; border-color: #6c757d; }
.btn-secondary:hover { color: #fff; background-color: #5a6268; border-color: #545b62; }
.btn-success { color: #fff; background-color: #28a745; border-color: #28a745; }
.btn-success:hover { color: #fff; background-color: #218838; border-color: #1e7e34; }
.btn-danger { color: #fff; background-color: #dc3545; border-color: #dc3545; }
.btn-danger:hover { color: #fff; background-color: #c82333; border-color: #bd2130; }
.btn-warning { color: #212529; background-color: #ffc107; border-color: #ffc107; }
.btn-warning:hover { color: #212529; background-color: #e0a800; border-color: #d39e00; }
.btn-info { color: #fff; background-color: #17a2b8; border-color: #17a2b8; }
.btn-info:hover { color: #fff; background-color: #138496; border-color: #117a8b; }
.btn-default { color: #333; background-color: #e9ecef; border-color: #ced4da; }
.btn-default:hover { background-color: #d8dce0; border-color: #b4bbc1; }
.btn-block { display: block; width: 100%; }

/* --- Basis Alert-Boxen --- */
.alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; }
.alert-success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }
.alert-danger { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }
.alert-warning { color: #856404; background-color: #fff3cd; border-color: #ffeeba; }
.alert-info { color: #0c5460; background-color: #d1ecf1; border-color: #bee5eb; }

/* --- Basis Tabellen-Styling --- */
table { width: 100%; border-collapse: collapse; margin-bottom: 20px; background-color: rgba(255, 255, 255, 0.8); }
th, td { padding: 10px 12px; border: 1px solid #ddd; text-align: left; vertical-align: top; }
th { background-color: rgba(242, 242, 242, 0.85); font-weight: bold; }
tr:nth-child(even) { background-color: rgba(249, 249, 249, 0.8); }
tr:hover { background-color: rgba(233, 233, 233, 0.9); }
td.actions { white-space: nowrap; text-align: right; vertical-align: middle; }
td.actions .btn, td.actions form { margin-bottom: 0; margin-right: 5px; }
td.actions form { display: inline-block; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%;}

/* --- Basis Helper Klassen --- */
.text-danger { color: #dc3545 !important; }
.text-success { color: #28a745 !important; }
.text-warning { color: #ffc107 !important; }
.text-info { color: #17a2b8 !important; }
.text-muted { color: #6c757d !important; }

/* ================================================== */
/* === SPEZIFISCHE STYLES NUR FÜR HAUPTANWENDUNG === */
/* ================================================== */

/* --- Spezifische Hintergrundbilder pro Seite --- */
/* MINIMALINVASIV: min-height und background-attachment sicherstellen */
body.page-home, body.page-spieleliste, body.page-muenzkonto,
body.page-abstimmung, body.page-events, body.page-ausleihe,
body.page-profil, body.page-benutzerverwaltung, body.public-section, body.page-vorschlaege {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* <<< Wichtig! */
    min-height: 100%;            /* <<< Wichtig! */
}
body.page-home { background-image: url('../images/backgrounds/home.jpg'); }
body.page-spieleliste { background-image: url('../images/backgrounds/spiele.jpg'); }
body.page-muenzkonto { background-image: url('../images/backgrounds/muenzen.jpg'); }
body.page-abstimmung { background-image: url('../images/backgrounds/abstimmung.jpg'); }
body.page-events { background-image: url('../images/backgrounds/event.jpg'); }
body.page-ausleihe { background-image: url('../images/backgrounds/ausleihe.jpg'); }
body.page-profil { background-image: url('../images/backgrounds/profil.jpg'); }
body.page-benutzerverwaltung { background-image: url('../images/backgrounds/admin_konsole.jpg'); }
body.public-section { background-image: url('../images/backgrounds/login_bild.jpg'); }
body.page-vorschlaege { background-image: url('../images/backgrounds/vorschlaege.jpg'); }


/* --- Layout: Seiten mit Navigation (Haupt-App) - Alte, funktionierende Version --- */
body:not(.public-section) .page-container { display: flex; min-height: 100vh; }

/* --- Haupt-Navigation (Spielegruppe) - Alte, funktionierende Version --- */
body:not(.public-section) #navigation { width: 220px; flex-shrink: 0; background-color: rgba(238, 238, 238, 0.85); padding: 20px; height: 100vh; position: fixed; left: 0; top: 0; overflow-y: auto; border-right: 1px solid #ccc; box-shadow: 2px 0 5px rgba(0,0,0,0.1); z-index: 10; }
body:not(.public-section) #navigation h2 { margin-top: 0; margin-bottom: 20px; border-bottom: 1px solid #ccc; padding-bottom: 10px; }
body:not(.public-section) #navigation ul { list-style: none; padding: 0; }
body:not(.public-section) #navigation li { margin-bottom: 10px; }
body:not(.public-section) #navigation a { display: block; padding: 8px 10px; border-radius: 4px; transition: background-color 0.2s ease; color: #333; }
body:not(.public-section) #navigation a:hover { background-color: #ddd; text-decoration: none; }
body:not(.public-section) #navigation li.admin-link a { color: #dc3545; font-weight: bold; }
body:not(.public-section) #navigation .nav-back-button { font-weight: bold; color: #5a6268; }
body:not(.public-section) #navigation .nav-back-button:hover { background-color: #e9ecef; }

/* --- Inhalt Bereich (Haupt-App) - Alte, funktionierende Version --- */
body:not(.public-section) #content { flex-grow: 1; padding: 25px; margin-left: 220px; overflow-y: auto; position: relative; }
/* Spezifischer Content-Container - Alte, funktionierende Version */
body:not(.public-section) .content-window { max-width: 950px; margin: 20px auto; background-color: rgba(255, 255, 255, 0.88); padding: 25px 30px; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); position: relative; z-index: 1; }

/* --- Layout: Login & Registrierung (Öffentliche Seiten) - Alte, funktionierende Version --- */
body.public-section { display: flex; flex-direction: column; min-height: 100vh; justify-content: center; align-items: center; padding: 20px; }
.public-container { width: 100%; max-width: 450px; padding: 30px 40px; margin: 20px; background-color: rgba(255, 255, 255, 0.9); border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); text-align: center; }
.public-container h1 { margin-bottom: 15px; font-size: 1.8em; color: #333;}
.public-container h2 { margin-bottom: 25px; font-size: 1.3em; color: #555; font-weight: normal;}
.public-container form { text-align: left; }
.public-container .login-links { margin-top: 20px; font-size: 0.9em;}
.public-container .login-links p { margin-bottom: 5px; }
.public-container .login-links a { color: #007bff; }
.public-container .alert { text-align: left; }


/* --- Spezifische Elemente Haupt-App (Unverändert) --- */
.spieleliste-item, .abstimmung-item { border: 1px solid #eee; margin-bottom: 15px; padding: 15px; border-radius: 5px; display: flex; align-items: flex-start; background-color: rgba(255, 255, 255, 0.9); }
.spieleliste-item img, .abstimmung-item img { max-width: 100px; max-height: 100px; margin-right: 15px; border-radius: 4px; flex-shrink: 0; object-fit: contain;}
.spieleliste-item-no-img img, .abstimmung-item-no-img img { display: none; }
.spieleliste-item-content, .abstimmung-item-content { flex-grow: 1; }
.spieleliste-item h3, .abstimmung-item h3 { margin-top: 0; margin-bottom: 5px; }
.spieleliste-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 15px; }
.abstimmung-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 15px; }

.event-item { border: 1px solid #ccc; padding: 15px; margin-bottom: 20px; border-radius: 5px; background-color: rgba(255, 255, 255, 0.9); }
.event-item h3 { margin-top: 0; margin-bottom: 5px; }

.action-log-list { list-style: none; padding-left: 0; max-height: 300px; overflow-y: auto; border: 1px solid #eee; padding: 10px; background-color: rgba(253, 253, 253, 0.95); border-radius: 4px; }
.action-log-list li { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dotted #ccc; font-size: 0.9em; }
.action-log-list li:last-child { border-bottom: none; margin-bottom: 0; }
.action-log-list .log-time { font-size: 0.85em; color: #666; margin-right: 10px; }
.action-log-list .log-user { font-weight: bold; margin-right: 5px; }
.muenzstand { font-weight: bold; color: #e8a800; }
.history-log-window { max-height: 400px; overflow-y: auto; border: 1px solid #ccc; padding: 15px; background-color: rgba(253, 253, 253, 0.95); border-radius: 5px; }
.admin-section { border: 1px solid #ccc; margin-bottom: 25px; padding: 20px; border-radius: 5px; background-color: rgba(245, 245, 245, 0.9); }
.admin-section h2, .admin-section h3 { margin-top: 0; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #eee; }


/* --- Footer (Haupt-App) - Alte, funktionierende Version --- */
footer { background-color: rgba(51, 51, 51, 0.9); color: #f1f1f1; font-size: 0.9em; margin-top: 30px; position: relative; z-index: 5; }
body.public-section footer { width: 100%; margin-top: auto; padding: 10px 0; text-align: center; background-color: transparent; border-top: 1px solid #e0e0e0; box-shadow: none; color: #6c757d; margin-left: 0;}
body.public-section footer .footer-wrapper { max-width: 100%; padding: 0 15px; }
body:not(.public-section) footer { margin-left: 220px; }
.footer-wrapper { }
.footer-content { display: flex; justify-content: space-between; align-items: center; padding: 5px 20px; min-height: 45px; flex-wrap: wrap; }
.footer-content p { margin: 5px 0; }
#audio-player-controls { display: flex; align-items: center; gap: 10px; margin: 5px 0; }
#audio-player-controls .btn { padding: 5px 10px; margin: 0; }
#background-audio { display: none; }


/* --- Responsive Anpassungen (Haupt-App) - Alte, funktionierende Version --- */
@media (max-width: 768px) {
    body:not(.public-section) #navigation { width: 180px; }
    body:not(.public-section) #content, body:not(.public-section) footer { margin-left: 180px; }
    body:not(.public-section) .content-window { padding: 15px; margin: 10px auto; }
    .footer-content { flex-direction: column; text-align: center; }
    #audio-player-controls { margin-top: 10px; }
    .spieleliste-container, .abstimmung-container { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
    
    body:not(.public-section) #content, body:not(.public-section) footer { margin-left: 0; padding: 10px; }
    body:not(.public-section) .content-window { margin: 5px; padding: 10px 15px; }
    body:not(.public-section) .btn:not(.btn-sm):not(.btn-xs):not(#audio-player-controls .btn) { display: block; width: 100%; margin-bottom: 10px; margin-right: 0; margin-left: 0; }
    body:not(.public-section) td.actions .btn { display: inline-block; width: auto; margin-bottom: 5px; }
    .footer-content p { text-align: center; width: 100%; }
    .public-container { max-width: 95%; padding: 20px 15px; }
}
/* ================================================== */
/* === HAMBURGER MENÜ STYLES FÜR HAUPTNAVIGATION === */
/* (Diese Regeln sind sehr ähnlich zu denen in spiel.css,
   aber mit spezifischen Selektoren für die Hauptnavigation, um Konflikte zu vermeiden) */
/* ================================================== */

/* --- Hamburger-Button Styling (wird nur auf Mobile sichtbar) --- */
.hamburger-menu-button#hamburger-toggle-main { /* Spezifische ID für den Haupt-Burger */
    display: none; 
    position: fixed; 
    top: 10px;     
    left: 10px;      
    z-index: 1001; 
    background-color: #555; /* Dunkleres Grau, oder wähle eine passende Farbe */
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.hamburger-menu-button#hamburger-toggle-main span {
    display: block;
    width: 22px; 
    height: 3px;  
    background-color: white; 
    margin: 4px 0; 
    transition: all 0.3s ease-in-out;
}

/* --- Verhalten der Haupt-Navigation auf Mobile --- */
/* Breakpoint, ab dem der Burger aktiv wird (z.B. 768px oder 576px) */
@media (max-width: 768px) { 
    
    body.main-app-section .hamburger-menu-button#hamburger-toggle-main { 
        display: block; 
    }

    /* Haupt-Navigationsleiste anpassen */
    body.main-app-section nav#navigation { 
        position: fixed; 
        left: -230px; /* Standardmäßig außerhalb, Breite anpassen (z.B. -220px) */
        top: 0;
        width: 220px; /* Deine normale Breite der Hauptnavigation */
        height: 100%; 
        background-color: rgba(238, 238, 238, 0.98); /* Deine Haupt-Navi Farbe, leicht transparent */
        box-shadow: 2px 0 5px rgba(0,0,0,0.2);
        transition: left 0.3s ease-in-out; 
        z-index: 1000; 
        overflow-y: auto; 
        padding-top: 50px; /* Platz für den Burger-Button */
    }
    
    body.main-app-section nav#navigation.open {
        left: 0; 
    }

    /* Overlay für Haupt-Navigation */
    .overlay-nav-open-main {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.4); 
        z-index: 999; 
        display: none; 
        cursor: pointer; 
    }
    body.main-app-section.navigation-main-open .overlay-nav-open-main {
        display: block;
    }

    /* Hamburger-Icon Animation zu "X" */
    .hamburger-menu-button#hamburger-toggle-main.open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .hamburger-menu-button#hamburger-toggle-main.open span:nth-child(2) {
        opacity: 0;
    }
    .hamburger-menu-button#hamburger-toggle-main.open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Linken Rand für Inhalt und Footer entfernen, wenn Navi mobil ist */
    body.main-app-section main#content {
        margin-left: 0 !important; 
    }
    body.main-app-section footer { /* Gilt für den Footer in der Hauptanwendung */
        margin-left: 0 !important;
    }
}