/* ============================================================
   Gastrogenius Core - Custom Styles
   ============================================================ */

:root {
    --gg-primary: #1e3a5f;
    --gg-primary-light: #2a4f7f;
    --gg-primary-dark: #152a45;
    --gg-secondary: #f0f2f5;
    --gg-sidebar-width: 260px;
    --gg-topbar-height: 60px;
    --gg-border-color: #e5e7eb;
}

/* ============================================================
   Branding - Auth (Login/Register)
   ============================================================ */
.auth-brand {
    text-align: center;
    padding: 0;
    margin-bottom: 0.5rem;
}

.auth-brand .brand-gastro {
    display: block;
    font-size: 2.4rem;
    font-weight: 300;
    color: var(--gg-primary);
    letter-spacing: 0.15em;
    line-height: 1;
}

.auth-brand .brand-genius {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gg-primary);
    letter-spacing: 0.05em;
    line-height: 1;
    margin-top: 0.1rem;
}

/* ============================================================
   Branding - Sidebar (Backend)
   ============================================================ */
.sidebar-brand {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand a {
    display: flex;
    align-items: baseline;
    gap: 0;
}

.sidebar-brand .brand-gastro {
    font-size: 1.15rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.02em;
    line-height: 1;
}

.sidebar-brand .brand-genius {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
    line-height: 1;
}

/* ============================================================
   Auth Layout
   ============================================================ */
.auth-wrapper {
    background: linear-gradient(135deg, var(--gg-secondary) 0%, #dfe6ed 100%);
}

.auth-container {
    width: 100%;
    max-width: 440px;
    padding: 0 1rem;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--gg-sidebar-width);
    height: 100vh;
    background: var(--gg-primary);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-left-color: #fff;
}

.sidebar-link i {
    width: 24px;
    margin-right: 0.75rem;
    font-size: 1.1rem;
    text-align: center;
}

.sidebar-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

.sidebar-heading {
    padding: 0.75rem 1.25rem 0.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

/* Aufklappbarer Bereich */
.sidebar-collapse-toggle {
    cursor: pointer;
}

.sidebar-collapse-toggle .collapse-arrow {
    font-size: 0.75rem;
    transition: transform 0.25s ease;
}

.sidebar-collapse-toggle:not(.collapsed) .collapse-arrow {
    transform: rotate(180deg);
}

.sidebar-sublink {
    padding-left: 2.75rem;
    font-size: 0.85rem;
}

/* ============================================================
   Main Content Area
   ============================================================ */
.main-wrapper {
    margin-left: var(--gg-sidebar-width);
    min-height: 100vh;
    background: var(--gg-secondary);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--gg-topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--gg-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.topbar-right {
    display: flex;
    align-items: center;
}

.user-menu-btn {
    color: #333;
    border: none;
    padding: 0.25rem 0.5rem;
}

.user-menu-btn:hover,
.user-menu-btn:focus {
    color: var(--gg-primary);
}

.main-content {
    padding: 1.5rem;
    max-width: 1200px;
}

/* ============================================================
   Backend Body
   ============================================================ */
.backend-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gg-secondary);
}

/* ============================================================
   Cards
   ============================================================ */
.card {
    border-radius: 0.75rem;
}

.card-header {
    border-bottom: none;
}

/* Progress */
.progress {
    border-radius: 1rem;
    background-color: #e9ecef;
}

.progress-bar.bg-primary {
    background-color: var(--gg-primary) !important;
    border-radius: 1rem;
    transition: width 0.6s ease;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

/* ============================================================
   Module Cards
   ============================================================ */
.module-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08) !important;
}

.module-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 58, 95, 0.08);
    border-radius: 0.75rem;
    flex-shrink: 0;
}

/* ============================================================
   Opening Hours
   ============================================================ */
.oh-table td,
.oh-table th {
    vertical-align: middle;
    white-space: nowrap;
    padding: 0.6rem 0.75rem;
}

.oh-table .time-select {
    display: inline-block;
    width: 62px;
    padding: 0.2rem 0.3rem;
    font-size: 0.85rem;
}

.oh-table .slot-2-wrapper {
    display: inline;
}

.btn-copy-down {
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1;
}

/* ============================================================
   PLZ Autocomplete
   ============================================================ */
.plz-suggestions {
    position: absolute;
    z-index: 1050;
    background: #fff;
    border: 1px solid var(--gg-border-color);
    border-radius: 0.375rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    width: 300px;
}

.plz-suggestion-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    border-bottom: 1px solid #f0f0f0;
}

.plz-suggestion-item:last-child {
    border-bottom: none;
}

.plz-suggestion-item:hover,
.plz-suggestion-item.active {
    background: var(--gg-secondary);
}

.plz-suggestion-item .plz-main {
    font-weight: 500;
}

.plz-suggestion-item .plz-detail {
    font-size: 0.75rem;
    color: #6c757d;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--gg-primary-light);
    border-color: var(--gg-primary-light);
}

.btn-outline-primary {
    color: var(--gg-primary);
    border-color: var(--gg-primary);
}

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

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1035;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

@media (min-width: 992px) {
    .sidebar-toggle {
        display: none !important;
    }
}

/* ============================================================
   Module Sub-Navigation
   ============================================================ */
.module-subnav {
    border-bottom: 1px solid var(--gg-border-color);
    padding-bottom: 0.75rem;
}

.module-subnav .btn {
    font-size: 0.85rem;
    font-weight: 500;
}

/* ============================================================
   Media Grid
   ============================================================ */
.media-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 0.5rem 0.5rem 0 0;
}
.media-zoom-btn { transition: opacity .2s; }
.media-zoom-btn:hover { opacity: 1 !important; }

/* ============================================================
   Utilities
   ============================================================ */
.user-avatar-sm {
    font-size: 1.25rem;
}

.form-check-input:checked {
    background-color: var(--gg-primary);
    border-color: var(--gg-primary);
}

a {
    color: var(--gg-primary);
}

a:hover {
    color: var(--gg-primary-light);
}

/* Fixierter Speicher-Footer */
.sticky-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: #fff;
    border-top: 1px solid #dee2e6;
    padding: 0.65rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}
@media (min-width: 768px) {
    .sticky-action-bar { left: 260px; }
}
.has-sticky-action-bar { height: 70px; }

/* Speisekartenmodul: Klappbox fuer Zusatzinformationen */
.fg-menu-collapse > summary {
    user-select: none;
}
.fg-menu-collapse > summary::-webkit-details-marker { display: none; }
.fg-menu-collapse > summary::marker { content: ''; }
.fg-menu-collapse .fg-menu-collapse-arrow {
    transition: transform 0.15s ease;
    display: inline-block;
}
.fg-menu-collapse[open] > summary .fg-menu-collapse-arrow {
    transform: rotate(180deg);
}
.fg-menu-tags .fw-semibold { color: #495057; font-size: 0.9rem; }

/* Speisekartenmodul: weicher KNR-Konflikt-Rahmen */
input.fg-knr-conflict {
    border-color: #ffc107 !important;
    background-color: #fffcee;
}
input.fg-knr-conflict:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}
