#app {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.app-header {
    height: var(--header-height);
    background-color: var(--secondary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Main Content Area */
.app-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex; /* Panels side-by-side on desktop */
}

.panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: white;
    border-right: 1px solid var(--border-color);
}

/* Specific Panel Layouts */
#list-panel {
    flex: 0 0 320px; /* Fixed width on desktop */
    z-index: 2;
}

#map-panel {
    flex: 1; /* Map takes remaining space */
    position: relative;
    z-index: 1;
}

#details-panel {
    flex: 0 0 300px;
    z-index: 2;
    background: #f9f9f9;
    overflow-y: auto;
    min-height: 0;
}

/* Mobile Navigation (Hidden by default on desktop) */
.mobile-nav {
    display: none;
    height: var(--nav-height);
    background: white;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
    z-index: 10;
}

.nav-item {
    flex: 1;
    text-align: center;
    background: none;
    border: none;
    border-top: 3px solid transparent;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.nav-item.active {
    color: var(--primary-color);
    border-top-color: var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        min-height: 100dvh;
    }

    #app {
        height: 100dvh;
    }

    .app-content {
        display: block; /* Stack panels (only one visible at a time) */
        padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)); /* Space for bottom nav */
    }

    .panel {
        display: none; /* Hide all by default */
        width: 100%;
        border-right: none;
    }

    .panel.active-panel {
        display: flex; /* Show only active */
    }

    #list-panel, #map-panel, #details-panel {
        flex: none; /* Reset flex values */
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    #details-panel {
        -webkit-overflow-scrolling: touch;
    }
    
    .hidden-mobile {
        display: none !important; /* Force hide in mobile if class present unless active */
    }
    
    /* Override hidden-mobile if it is the active panel */
    .panel.active-panel.hidden-mobile {
        display: flex !important;
    }

    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        width: 100%;
        min-height: 78px;
        padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
        gap: 8px;
        border-top: 1px solid #dde5ed;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(12px);
        box-shadow: 0 -10px 22px rgba(44, 62, 80, 0.08);
        box-sizing: border-box;
    }

    .nav-item {
        min-height: 60px;
        border-top: none;
        border-radius: 12px;
        background: #f4f7fa;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 8px 6px;
        font-size: 0.82rem;
        line-height: 1.1;
    }

    .nav-item i {
        font-size: 1rem;
    }

    .nav-item span {
        display: block;
    }

    .nav-item.active {
        background: #e9f4fd;
        border-top-color: transparent;
    }
}
