/* Navigation & Header Styles */

/* Navbar */
.fixed-top.transparent-navbar {
    /* Dark Aero-Glass look always */
    background: linear-gradient(180deg, rgba(10,10,10,0.75), rgba(20,20,20,0.9));
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 6px 20px rgba(0,0,0,0.45);
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

/* Ensure links are white by default on the dark navbar */
.transparent-navbar .nav-link {
    color: #fff !important;
    transition: color 0.18s ease;
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

/* Hover state: orange */
.transparent-navbar .nav-link:hover {
    color: #f97316 !important;
    transform: translateY(-1px);
}

.transparent-navbar .nav-link.active {
    color: #f97316 !important;
    font-weight: bold;
}

/* Better spacing for nav items */
.transparent-navbar .navbar-nav {
    gap: 0.5rem;
}

/* Toggler icon (light) */
.transparent-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Logo */
.transparent-navbar .logo-img {
    height: 56px !important;
    max-height: 56px !important;
    width: auto !important;
    display: inline-block;
    vertical-align: middle;
    filter: none !important;
    opacity: 1 !important;
    transition: opacity 200ms ease;
}

.fixed-top.transparent-navbar.navbar-dark-bg {
    background: linear-gradient(180deg, rgba(10,10,10,0.75), rgba(20,20,20,0.9));
}

/* Toggler focus and hover for contrast */
.navbar-toggler:hover {
    border-color: rgba(249,115,22,0.12);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 6px rgba(249,115,22,0.08);
}

/* FIX: Horizontale Zentrierung für Desktop-Navbar */
@media (min-width: 768px) {
    .navbar-expand-md .navbar-collapse {
        flex-grow: 1;
    }
    
    .navbar {
        padding: 0.75rem 0;
    }
    
    .navbar .navbar-nav {
        padding: 0 1rem;
        display: flex;
        align-items: center;
    }
}

/* FIX: Mobile Navigation Centering & Layout */
@media (max-width: 767.98px) {
    .navbar-collapse .navbar-nav {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 1rem 0;
        gap: 0.25rem;
    }

    .navbar-collapse .nav-item {
        width: 100%;
        text-align: center;
    }

    .navbar-collapse .nav-item:last-of-type {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }

    .navbar-collapse .profile-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Profile inline SVG styling */
.profile-icon-svg {
    color: #ffffffcc;
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

/* Profile button visual upgrade - enlarged */
.profile-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: none;
    transition: background 160ms ease, transform 120ms ease;
}

.profile-btn:hover {
    background: rgba(255,255,255,0.07);
}

.profile-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(66,117,170,0.08);
}

.profile-btn .profile-icon-svg {
    color: #fff;
    width: 22px;
    height: 22px;
}

/* Profile initial badge */
.profile-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(180deg, #f97316, #e65a00);
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.transparent-navbar.navbar-dark-bg .profile-initial {
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

/* Navbar brand logo sizing and appearance */
.transparent-navbar .navbar-brand img,
.transparent-navbar .logo-img {
    height: 56px !important;
    max-height: 56px !important;
    width: auto !important;
    display: inline-block;
    vertical-align: middle;
    filter: none !important;
    opacity: 1 !important;
    transition: opacity 200ms ease;
}

.transparent-navbar.navbar-dark-bg {
    filter: none !important;
    opacity: 1 !important;
}

/* --- Profile Sidebar Redesign (Aero Glass) --- */
.profile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    z-index: 1999;
}

.profile-sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

.profile-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 360px;
    max-width: 90vw;
    background: rgba(20, 20, 30, 0.9);
    color: #f0f0f0;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 2000;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    will-change: transform;
    /* Mobile/touch scrolling enhancements */
    height: 100dvh; /* avoid iOS 100vh issues */
    max-height: 100dvh;
    -webkit-overflow-scrolling: touch; /* momentum scrolling on iOS */
    touch-action: pan-y; /* allow vertical touch scroll */
    overscroll-behavior: contain; /* prevent body scroll chaining */
}

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

/* Sidebar Content Wrapper for Padding */
.sidebar-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* Grow and scroll inside the sidebar on small screens */
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

/* Close Button */
.profile-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 29px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.12s ease;
    z-index: 10;
}

.profile-close-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f97316, #d95309);
    color: white;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.sidebar-avatar .profile-icon-svg {
    width: 40px;
    height: 40px;
    color: #fff;
}

.sidebar-username {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.sidebar-user-email {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Sidebar Sections */
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-section h5 {
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    padding: 0 0.5rem;
    margin-bottom: 0.25rem;
}

/* Sidebar Links/Buttons */
.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: #f0f0f0;
    background-color: transparent;
    border: none;
    width: 100%;
    text-align: left;
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

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

.sidebar-link i {
    width: 20px;
    margin-right: 1rem;
    font-size: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-link.logout:hover {
    background-color: rgba(220, 53, 69, 0.2);
    color: #f8d7da;
}

.sidebar-link.logout:hover i {
    color: #dc3545;
}

/* QR Code Section */
.qr-code-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: rgba(0,0,0,0.2);
    border-radius: 12px;
}

.profile-qr {
    width: 180px;
    height: 180px;
    border-radius: 10px;
    background-color: #fff;
    padding: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    object-fit: contain;
}

.qr-code-section p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

/* Staff Tools */
#staffTools .form-control-custom {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

#staffTools .form-control-custom:focus {
    background-color: rgba(0, 0, 0, 0.4);
    border-color: #f97316;
}

#staffTools .form-label {
    color: rgba(255, 255, 255, 0.8);
}

#staffMessage {
    min-height: 1.2rem;
}

@media (max-width: 480px) {
    .profile-sidebar {
        width: 100%;
    }
}

/* --- Staff Theme Overrides (Cyan/Turquoise) --- */
.profile-initial.staff-theme {
    background: linear-gradient(145deg, #0ea5a9, #06b6d4);
}

button.profile-toggle.staff-theme:focus .profile-btn,
.profile-btn.staff-theme:focus {
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.25);
}

.profile-sidebar.staff-theme .sidebar-avatar {
    background: linear-gradient(145deg, #0ea5a9, #06b6d4);
}

.profile-sidebar.staff-theme .sidebar-link:hover {
    background-color: rgba(6, 182, 212, 0.15);
}
