/* ==========================================================================
   RESERVIERUNGSSYSTEM - HAUPTSTYLES
   ========================================================================== */

:root {
    --primaer: #d49f47;
    --sekundaer: #b8833d;
}

/* ==========================================================================
   ALLGEMEINE STYLES
   ========================================================================== */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Buttons */
.btn-primary {
    background-color: var(--primaer);
    border-color: var(--primaer);
}

.btn-primary:hover {
    background-color: var(--sekundaer);
    border-color: var(--sekundaer);
}

/* Text */
.text-primary {
    color: var(--primaer) !important;
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */

.navbar-fixed {
    position: sticky;
    top: 0;
    z-index: 1030;
}

/* Navigation Buttons */
.navbar .btn {
    white-space: nowrap;
}

/* Fixierter Speicher-Button (Einstellungen) */
.fixed-save-button {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
    z-index: 1020;
    border-top: 2px solid var(--primaer);
}

@media (max-width: 767px) {
    .fixed-save-button {
        padding: 12px;
    }
    
    .fixed-save-button .btn {
        width: 100%;
    }
    
    /* Platz für fixierten Button */
    body.has-fixed-save {
        padding-bottom: 80px;
    }
}

/* ==========================================================================
   TABELLEN
   ========================================================================== */

/* Sticky Table Header */
.sticky-table-wrapper table thead {
    position: sticky;
    top: 56px;
    background-color: white;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Zebra-Streifen */
table.dataTable tbody tr:hover {
    background-color: rgba(0,0,0,0.02);
}

table.dataTable tbody tr.odd {
    background-color: rgba(0,0,0,0.02);
}

/* Datum-Trennung */
table.dataTable tbody tr.neuer-tag,
tr.neuer-tag {
    border-top: 5px solid var(--primaer) !important; /* Noch dicker und farbig */
    position: relative;
}

tr.neuer-tag td {
    border-top: 5px solid var(--primaer) !important;
    padding-top: 15px !important; /* Mehr Abstand nach Trenner */
}

/* Schatten-Effekt ENTFERNT - ::before auf <tr> erzeugt Phantom-Zelle in manchen Browsern!
   Das war die Ursache für die verschobenen Spalten bei neuer-tag Zeilen.
   Der border-top: 5px reicht als visueller Separator vollkommen aus.
*/

/* ==========================================================================
   STATISTIK-KARTEN
   ========================================================================== */

.stat-card {
    border-left: 4px solid var(--primaer);
    transition: transform 0.2s;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Stats Row: Sicherstellen dass Cards nebeneinander sind */
.row.g-3 {
    display: flex;
    flex-wrap: wrap;
}

.row.g-3 .col-md-3 {
    flex: 0 0 auto;
    width: 25%;
}

/* Desktop & Tablet Stats - nur auf Mobile verstecken */
.desktop-tablet-stats {
    display: flex !important;
}

@media (max-width: 767px) {
    .desktop-tablet-stats {
        display: none !important;
    }
    
    .row.g-3 .col-md-3 {
        width: 100%;
    }
}

/* ==========================================================================
   FILTER & AKTIONEN
   ========================================================================== */

.filter-active {
    background-color: var(--primaer) !important;
    border-color: var(--primaer) !important;
    color: white !important;
}

/* ==========================================================================
   MODAL & FORMULARE
   ========================================================================== */

.logo-preview {
    max-width: 200px;
    max-height: 100px;
    margin-top: 10px;
}

.hinweistext {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* ==========================================================================
   RESPONSIVE - MOBILE (< 768px)
   ========================================================================== */

@media (max-width: 767px) {
    /* Navbar MUSS fixiert sein */
    .navbar {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1030;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    /* Platz für fixierte Navbar */
    body {
        padding-top: 56px;
    }
    
    /* Container volle Breite */
    .container,
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Kompakte Statistik - Eine Zeile */
    .stats-compact {
        display: flex;
        justify-content: space-between;
        padding: 10px 15px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        font-size: 0.85rem;
        margin-bottom: 15px;
    }
    
    .stats-compact .stat-item {
        display: inline-block;
        padding: 0 8px;
    }
    
    .stats-compact .stat-item:not(:last-child) {
        border-right: 1px solid #ddd;
    }
    
    .stats-compact .stat-value {
        font-weight: bold;
        color: var(--primaer);
    }
    
    /* Statistik-Karten ausblenden auf Mobile */
    .stat-card.mobile-hide-stat {
        display: none !important;
    }
    
    /* Reservierungs-Cards - OHNE linken farbigen Border */
    .reservation-card {
        background: white;
        border-radius: 10px;
        padding: 15px;
        margin-bottom: 15px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.1);
        cursor: pointer;
        transition: all 0.2s;
        border-left: none !important; /* Kein farbiger Border - Card hebt sich durch Datum-Separator ab */
    }
    
    .reservation-card:active {
        transform: scale(0.98);
        box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    }
    
    .reservation-card .card-header-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        padding-bottom: 8px;
        border-bottom: 1px solid #eee;
    }
    
    .reservation-card .date-info {
        font-weight: bold;
        font-size: 0.95rem;
    }
    
    .reservation-card .guest-count {
        color: var(--primaer);
        font-weight: bold;
        font-size: 0.9rem;
    }
    
    .reservation-card .card-body-mobile {
        font-size: 0.85rem;
        line-height: 1.6;
    }
    
    .reservation-card .info-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 5px;
    }
    
    .reservation-card .info-label {
        color: #666;
        min-width: 60px;
    }
    
    .reservation-card .info-value {
        font-weight: 500;
        text-align: right;
        flex: 1;
    }
    
    .reservation-card .bemerkung {
        background: #f8f9fa;
        padding: 8px;
        border-radius: 4px;
        margin-top: 8px;
        font-size: 0.8rem;
        color: #555;
    }
    
    .reservation-card .status-badge {
        display: inline-block;
        margin-top: 8px;
    }
    
    .reservation-card .expand-icon {
        color: #999;
        font-size: 1.2rem;
    }
    
    /* Tabellen ausblenden auf Mobile */
    .table-responsive.desktop-only {
        display: none !important;
    }
    
    /* Mobile Cards Container */
    .mobile-cards-container {
        display: block !important;
    }
    
    /* Datum-Trennung zwischen Tagen - MAXIMAL SICHTBAR */
    .day-separator {
        background: linear-gradient(135deg, rgba(212, 159, 71, 0.35), rgba(212, 159, 71, 0.2)); /* Goldener Gradient */
        border-top: 4px solid var(--primaer); /* FETTE Linie oben */
        border-bottom: 4px solid var(--primaer); /* FETTE Linie unten */
        border-radius: 0; /* Keine Rundung für klare Trennung */
        padding: 18px 20px;
        margin: 25px 0 15px;
        box-shadow: 0 2px 8px rgba(212, 159, 71, 0.3), 0 -2px 8px rgba(212, 159, 71, 0.2);
    }
    
    .day-separator h6 {
        margin: 0;
        color: #000;
        font-weight: 800;
        font-size: 1.15rem;
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }
    
    .day-separator small {
        color: #222;
        font-size: 0.95rem;
        font-weight: 700;
    }
    
    /* Filter als Dropdown */
    .filter-dropdown {
        width: 100%;
        padding: 10px;
        border-radius: 8px;
        border: 1px solid #ddd;
        background: white;
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    /* Accordion für Status-Filter */
    .status-filter-accordion {
        background: white;
        border-radius: 8px;
        overflow: hidden;
        margin-bottom: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .status-filter-accordion .accordion-header {
        padding: 12px 15px;
        background: var(--primaer);
        color: white;
        font-weight: bold;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .status-filter-accordion .accordion-body {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .status-filter-accordion .accordion-body.open {
        max-height: 500px;
    }
    
    .status-filter-accordion .filter-option {
        padding: 12px 15px;
        border-bottom: 1px solid #eee;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
    }
    
    .status-filter-accordion .filter-option:active {
        background: #f8f9fa;
    }
    
    .status-filter-accordion .filter-option.active {
        background: #e8f4f8;
        font-weight: bold;
    }
    
    /* Buttons Stack */
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 5px;
    }
    
    /* Navbar kompakt */
    .navbar-brand {
        font-size: 0.9rem;
    }
    
    /* Cards kompakt */
    .card {
        margin-bottom: 15px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    /* Filter-Buttons ausblenden */
    .card-header .btn-group.mobile-hide-filters {
        display: none !important;
    }
    
    /* Modal volle Breite */
    .modal-dialog {
        margin: 10px;
    }
    
    /* Formulare */
    .row .col-md-6,
    .row .col-md-4,
    .row .col-md-3 {
        margin-bottom: 15px;
    }
}

/* ==========================================================================
   RESPONSIVE - TABLET (768px - 1024px)
   ========================================================================== */

@media (min-width: 768px) and (max-width: 1024px) {
    /* Container */
    .container {
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }
    
    /* Login-Formular: Checkbox gut sichtbar */
    .form-check {
        padding: 12px;
        background: #f8f9fa;
        border-radius: 6px;
        border: 1px solid #dee2e6;
    }
    
    .form-check-label {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    /* WICHTIG: Desktop-Elemente ausblenden - AUSSER Stats-Cards! */
    .desktop-only {
        display: none !important;
    }
    
    .card-header.mobile-hide {
        display: none !important;
    }
    
    /* Stats-Cards MÜSSEN auf Tablet nebeneinander sein */
    .row.g-3 {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }
    
    .row.g-3 > div {
        flex: 1 1 25% !important;
    }
    
    /* Mobile-Elemente anzeigen */
    .mobile-show,
    .mobile-cards-container {
        display: block !important;
    }
    
    /* Navbar fixiert auf Tablet */
    .navbar {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1030;
    }
    
    body {
        padding-top: 56px;
    }
    
    /* Stats kompakt */
    .stats-compact {
        display: flex !important;
        justify-content: space-around;
        padding: 15px 20px;
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    .stats-compact .stat-item {
        padding: 0 15px;
    }
    
    .stats-compact .stat-value {
        font-size: 1.2rem;
    }
    
    /* Filter-Dropdown */
    .filter-dropdown {
        display: block !important;
        max-width: 500px;
        margin: 0 auto 20px;
        font-size: 1rem;
    }
    
    /* Cards-Container 2-spaltig */
    .mobile-cards-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 0 10px;
    }
    
    /* Datum-Separator über beide Spalten */
    .day-separator {
        grid-column: 1 / -1;
        background: linear-gradient(135deg, rgba(212, 159, 71, 0.35), rgba(212, 159, 71, 0.2));
        border-top: 5px solid var(--primaer); /* Noch dicker auf Tablet */
        border-bottom: 5px solid var(--primaer);
        border-radius: 0;
        padding: 20px 25px;
        margin: 30px 0 20px;
        box-shadow: 0 3px 10px rgba(212, 159, 71, 0.35), 0 -3px 10px rgba(212, 159, 71, 0.25);
    }
    
    .day-separator h6 {
        font-size: 1.3rem;
        margin-bottom: 5px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.6px;
        color: #000;
    }
    
    .day-separator small {
        font-size: 1.05rem;
        font-weight: 700;
        color: #222;
    }
    
    /* Reservierungs-Cards größer und schöner */
    .reservation-card {
        background: white;
        border-radius: 12px;
        padding: 20px;
        box-shadow: 0 3px 10px rgba(0,0,0,0.12);
        transition: all 0.2s;
        cursor: pointer;
    }
    
    .reservation-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    }
    
    .reservation-card .card-header-mobile {
        padding-bottom: 10px;
        margin-bottom: 12px;
    }
    
    .reservation-card .date-info {
        font-size: 1.1rem;
    }
    
    .reservation-card .card-body-mobile {
        font-size: 1rem;
        line-height: 1.8;
    }
    
    .reservation-card .info-label {
        min-width: 80px;
    }
    
    /* Kompakte stornierte Cards auch 2-spaltig */
    .reservation-card-compact {
        grid-column: span 1;
    }
    
    /* Modal breiter */
    .modal-lg {
        max-width: 90%;
    }
    
    /* Card-Body größer */
    .card-body {
        padding: 1.5rem;
    }
    
    /* Cards etwas kompakter auf Tablet */
    .card {
        margin-bottom: 1.25rem;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .navbar,
    .btn,
    .filter-btn,
    .card-header .btn-group {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

.text-truncate-mobile {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Desktop (ÜBER 1024px): Mobile-Cards ausblenden */
@media (min-width: 1025px) {
    .mobile-cards-container {
        display: none !important;
    }
    
    .stats-compact {
        display: none !important;
    }
    
    .status-filter-accordion {
        display: none !important;
    }
    
    .filter-dropdown {
        display: none !important;
    }
}

/* Mobile: Spezielle Klassen */
@media (max-width: 767px) {
    .mobile-hide {
        display: none !important;
    }
    
    .mobile-show {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
}

@media (min-width: 1025px) {
    .mobile-hide {
        display: block !important;
    }
    
    .mobile-show {
        display: none !important;
    }
    
    .desktop-only {
        display: block !important;
    }
}