/* 
 * App Map Styles - Split View & Fullscreen
 */

 .app-container {
    position: relative;
    width: 100vw;
    height: 100dvh; /* Use dynamic viewport height to prevent browser bar cutoffs */
    overflow: hidden;
    background-color: var(--theme-bg);
    display: flex;
    flex-direction: column;
}

/* Header Area (Optional, mimics app brand) */
.app-header {
    background: var(--theme-surface);
    padding: 12px 16px;
    border-bottom: 1px solid var(--theme-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1010;
}

.app-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--theme-text);
    margin: 0;
}

/* Main Content Area */
.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Map Wrapper */
.app-map-wrapper {
    position: relative;
    width: 100%;
    height: 50%; /* Split view default */
    transition: height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 1;
    background-color: var(--theme-surface-muted);
}

/* Fullscreen modifier */
.app-container.map-fullscreen .app-map-wrapper {
    height: 100%;
}

.app-container.map-fullscreen .app-list-wrapper {
    display: none;
}

/* Map Canvas */
.app-map {
    width: 100%;
    height: 100%;
}

/* Overlay Layer (above map) */
.app-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--theme-surface);
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--theme-overlay);
    pointer-events: auto;
}

/* Top Bar (Search & Filters) */
.app-top-bar {
    margin: 0;
    padding: 10px 14px;
    background-color: var(--theme-surface) !important;
    border-bottom: 1px solid var(--theme-border);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--theme-surface-muted);
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    padding: 4px 12px;
}

.search-input-wrapper input {
    box-shadow: none !important;
    font-size: 14px;
    color: var(--theme-text) !important;
}

.filters-row {
    display: flex;
    justify-content: space-between;
}

.filter-select {
    background-color: var(--theme-surface-muted) !important;
    color: var(--theme-text) !important;
    border: 1px solid var(--theme-border) !important;
    border-radius: 10px;
    font-size: 13px;
    padding: 6px 12px;
    box-shadow: none !important;
}

/* Floating Action Buttons */
.app-fab-container {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
    z-index: 1010;
}

.fab-btn {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--theme-text);
    box-shadow: 0 4px 12px var(--theme-overlay);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.fab-btn:active {
    background: var(--theme-surface-muted);
    transform: scale(0.95);
}

.fab-btn.active {
    background: var(--theme-accent-muted);
    color: var(--theme-accent);
    border-color: var(--theme-accent);
}

.fab-primary {
    width: 52px;
    height: 52px;
    border-radius: 26px;
    background: var(--theme-accent);
    color: #181512;
    font-size: 20px;
    box-shadow: 0 6px 16px var(--theme-overlay);
}

/* List Wrapper (Bottom half) */
.app-list-wrapper {
    flex: 1;
    background: var(--theme-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2;
    border-top: 1px solid var(--theme-border);
    box-shadow: 0 -2px 10px var(--theme-overlay);
}

.list-header {
    padding: 12px 16px 8px;
    background: var(--theme-surface);
    border-bottom: 1px solid var(--theme-border);
    color: var(--theme-text);
}

.bottom-sheet-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px;
}

/* Leaflet Overrides */
.leaflet-control-container .leaflet-top {
    display: none;
}
.leaflet-control-zoom {
    display: none !important; /* Hide completely, we have custom FABs */
}

/* Pins */
.app-pin-wrap {
    background: none;
    border: none;
}
.app-pin {
    display: block;
    width: 24px;
    height: 24px;
    background-color: var(--theme-accent);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}
.app-pin--absent {
    background-color: var(--theme-danger); /* Danger (Red) */
}
.app-pin--charity {
    background-color: var(--theme-charity); /* Charity (Purple) */
}
.app-pin--pending {
    background-color: var(--theme-warning); /* Warning (Yellow) */
}
.app-pin--approximate {
    width: 44px;
    height: 44px;
    background-color: rgba(13, 110, 253, 0.25);
    border: 2px dashed var(--theme-accent);
    border-radius: 50%;
    box-shadow: none;
}
.app-pin--approximate.app-pin--charity {
    background-color: rgba(111, 66, 193, 0.25);
    border-color: var(--theme-charity);
}
.app-pin--approximate.app-pin--absent {
    background-color: rgba(220, 53, 69, 0.25);
    border-color: var(--theme-danger);
}
.app-pin--approximate.app-pin--pending {
    background-color: rgba(255, 193, 7, 0.25);
    border-color: var(--theme-warning);
}
.app-pin--selected {
    transform: scale(1.3);
    border-color: var(--theme-warning);
    z-index: 1000 !important;
}

/* List View Cards */
.app-list-card {
    background: var(--theme-surface);
    border-radius: 12px;
    border: 1px solid var(--theme-border);
    padding: 12px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
}
.app-list-card:active {
    background-color: var(--theme-surface-muted);
}

.app-card-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: var(--theme-surface-muted);
    flex-shrink: 0;
}
.placeholder-img {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
}

@media (min-width: 768px) {
    .app-content {
        flex-direction: row;
    }
    .app-map-wrapper {
        height: 100%;
        flex: 1;
    }
    .app-top-bar {
        max-width: 380px;
    }
    .app-container.map-fullscreen .app-list-wrapper {
        display: none;
    }
    .app-list-wrapper {
        width: 400px;
        flex: none;
        border-top: none;
        border-left: 1px solid #dee2e6;
    }
    .app-container:not(.map-fullscreen) .toggle-fullscreen-btn {
        display: none; /* Hide toggle on desktop when split view is active since there's plenty of space */
    }
}

/* Item Details Gallery (Swiper) */
.stone-gallery-swiper {
    --swiper-theme-color: #0d6efd;
    --swiper-pagination-bullet-inactive-color: #fff;
    --swiper-pagination-bullet-inactive-opacity: 0.6;
}
.stone-gallery-swiper .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #fff;
    opacity: 0.6;
}
.stone-gallery-swiper .swiper-pagination-bullet-active {
    width: 24px;
    border-radius: 4px;
    background: #0d6efd;
    opacity: 1;
}

#itemDetailOffcanvasBody {
    padding: 0 !important; /* Usuwa domyślny padding dla galerii na całą szerokość */
}
