.app-header {
    /* Using sticky-top Bootstrap utility in HTML - minimal custom styles needed */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1030;
}

/* Navbar Customization */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Ensure main content area fits */
.main-content {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Side Panel Styles */
.side-panel-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1090; /* Higher than Bootstrap's tooltip (1080) */
    pointer-events: none; /* Allow clicks to pass through except where specified */
}

.side-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: calc(100vw - 600px); /* Don't cover the side panel area */
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    pointer-events: auto; /* Enable clicks on overlay to close panel */
}

.side-panel {
    position: fixed;
    top: 0;
    right: -600px;
    width: 600px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    z-index: 1100; /* Highest z-index to appear above all other elements */
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
    overflow: hidden;
    pointer-events: auto; /* Ensure side panel can receive pointer events */
}

.side-panel.open {
    right: 0;
}

.side-panel-header {
    background: var(--bs-dark, #212529);
    color: white;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

/* Ensure buttons in side panel header are clickable */
.side-panel-header button {
    pointer-events: auto;
    z-index: 1110; /* Higher than panel content to ensure clickability */
    position: relative;
}

.side-panel-header button:hover {
    opacity: 0.8;
}

.side-panel-header button:active {
    transform: scale(0.95);
}

.side-panel-content {
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
    pointer-events: auto; /* Ensure content can receive pointer events */
}

/* Ensure all interactive elements in side panel content are clickable */
.side-panel-content button,
.side-panel-content input,
.side-panel-content select,
.side-panel-content textarea,
.side-panel-content a {
    pointer-events: auto;
    position: relative;
    z-index: 1105; /* Higher than overlay but lower than header */
}

.side-panel-debug {
    background: #fff3cd;
    border-top: 1px solid #ffeaa7;
    padding: 0.5rem 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #856404;
    flex-shrink: 0;
}

/* Mobile responsive side panel */
@media (max-width: 768px) {
    .side-panel {
        width: 90vw;
        right: -90vw;
    }
    
    .side-panel.open {
        right: 0;
    }
    
    .side-panel-overlay {
        width: calc(100vw - 90vw); /* Adjust overlay for mobile panel width */
    }
}

@media (max-width: 576px) {
    .side-panel {
        width: 100vw;
        right: -100vw;
    }
    
    .side-panel-overlay {
        width: 0; /* No overlay on very small screens since panel covers full width */
    }
}
