/* Full-screen map styling for delmarvalley.com - TRUE FULL SCREEN */

/* Remove ALL margins/padding for full viewport usage */
body#home.dmv-fullscreen-map {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    height: 100vh;
}

/* Minimal header - make it compact with NO MARGINS */
body#home.dmv-fullscreen-map .logo-menu-wrapper {
    margin: 0 !important;
    padding: 5px 10px !important;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #ddd;
    position: relative;
    z-index: 1100;
    width: 100% !important;
    max-width: 100% !important;
}

body#home.dmv-fullscreen-map .logo-wrapper {
    max-height: 40px;
}

body#home.dmv-fullscreen-map .logo-wrapper img {
    max-height: 40px;
    width: auto;
}

body#home.dmv-fullscreen-map .nav-wrapper {
    font-size: 0.85em;
}

body#home.dmv-fullscreen-map .nav-wrapper .nav > li > a {
    padding: 8px 12px;
}

/* Minimal footer with NO MARGINS */
body#home.dmv-fullscreen-map .site-footer,
body#home.dmv-fullscreen-map .site-disclaimer {
    margin: 0 !important;
    padding: 8px 10px !important;
    background: rgba(240, 240, 240, 0.95);
    font-size: 0.85em;
    position: relative;
    z-index: 1100;
    width: 100% !important;
}

/* Main container takes full viewport minus header/footer - NO MARGINS */
body#home.dmv-fullscreen-map #main {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    height: calc(100vh - var(--dmv-header-height, 51px) - var(--dmv-footer-height, 45px));
    position: relative;
}

/* Map container fills the main area - edge to edge */
body#home.dmv-fullscreen-map #cndce-map-container {
    position: absolute;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

body#home.dmv-fullscreen-map #cndce-zip-map {
    width: 100% !important;
    height: 100% !important;
    min-height: unset;
    margin: 0 !important;
    padding: 0 !important;
}

/* Adjust checkbox container for full-screen mode */
body#home.dmv-fullscreen-map #cndce-map-container .cndce-checkbox-container {
    max-width: 400px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Move Leaflet zoom controls to avoid overlap with filter toggle button */
body#home.dmv-fullscreen-map .leaflet-top.leaflet-left {
    left: calc(var(--dmv-filter-toggle-width) + 10px);
    transition: left 0.3s ease;
}

/* When filter panel is open, move zoom controls further right */
body#home.dmv-fullscreen-map .dmv-filter-panel.open ~ #cndce-map-container .leaflet-top.leaflet-left,
body#home.dmv-fullscreen-map:has(.dmv-filter-panel.open) .leaflet-top.leaflet-left {
    left: calc(var(--dmv-filter-panel-width) + 10px);
}

/* Mobile responsive styles for DMV home page */
@media (max-width: 768px) {
    /* Hide menu text on smaller screens for minimal header */
    body#home.dmv-fullscreen-map .menu-text {
        display: none;
    }
    
    /* Improve touch targets and enable horizontal scrolling */
    body#home.dmv-fullscreen-map .nav-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    body#home.dmv-fullscreen-map .nav-wrapper .nav {
        display: flex;
        flex-wrap: nowrap;
        margin: 10px 0;
    }
    
    body#home.dmv-fullscreen-map .nav-wrapper .nav > li {
        flex-shrink: 0;
    }
    
    body#home.dmv-fullscreen-map .nav-wrapper .nav > li > a {
        padding: 12px 12px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Hide neighborhood panel on mobile */
    body#home.dmv-fullscreen-map #cndce-map-container .cndce-checkbox-container {
        display: none;
    }
}

/* Mobile button container - holds both filter and search buttons */
.dmv-mobile-buttons {
    display: none;
}

@media (max-width: 768px) {
    .dmv-mobile-buttons {
        display: flex;
        position: fixed;
        bottom: 15px;
        left: 5%;
        right: 5%;
        width: 90%;
        z-index: 1200;
        gap: 10px;
    }

    .dmv-mobile-buttons .dmv-mobile-filter-btn,
    .dmv-mobile-buttons .dmv-mobile-search-btn {
        flex: 1;
        font-size: 16px;
        font-weight: bold;
        padding: 14px 10px;
        border-radius: 5px;
    }

    .dmv-mobile-buttons .dmv-mobile-filter-btn {
        background: #e59e23;
        border-color: #e59e23;
        color: white;
    }

    .dmv-mobile-buttons .dmv-mobile-filter-btn:hover {
        background: #d18d1f;
        border-color: #d18d1f;
    }

    .dmv-mobile-buttons .dmv-mobile-search-btn {
        background: #000;
        border-color: #000;
        color: white;
    }

    /* Hide the original filter toggle on mobile when buttons container exists */
    body.dmv-fullscreen-map .dmv-filter-toggle {
        display: none;
    }
}

@media (max-width: 480px) {
    /* Further optimize for small phones */
    body#home.dmv-fullscreen-map .nav-wrapper .nav > li > a {
        padding: 10px 10px;
        font-size: 14px;
    }
    
    body#home.dmv-fullscreen-map .logo-menu-wrapper {
        padding: 5px;
    }
}

/* ========== FILTER PANEL STYLES ========== */

/* CSS custom properties for consistency */
:root {
    --dmv-filter-panel-width: 400px;
    --dmv-filter-toggle-width: 32px;
    --dmv-header-height: 51px;
    --dmv-footer-height: 45px;
}

/* Panel edge toggle button with chevron */
.dmv-filter-toggle {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1150;
    background: #e59e23;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 30px 8px;
    font-size: 20px;
    font-weight: 600;
    box-shadow: 2px 0 8px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: var(--dmv-filter-toggle-width);
}

.dmv-filter-toggle:hover {
    background: #d18d1f;
    box-shadow: 4px 0 12px rgba(0,0,0,0.4);
}

.dmv-filter-toggle .glyphicon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

/* Rotate icon when panel is open (becomes a chevron pointing left) */
.dmv-filter-panel.open ~ .dmv-filter-toggle .dmv-filter-toggle-icon {
    transform: rotate(180deg);
}

.dmv-filter-toggle-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 12px;
    letter-spacing: 1px;
}

.dmv-filter-badge {
    background: #dc3545;
    border-radius: 10px;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* Filter panel - slide-out from left */
.dmv-filter-panel {
    position: fixed;
    left: calc(-1 * var(--dmv-filter-panel-width) - 20px);
    top: var(--dmv-header-height, 51px);
    bottom: var(--dmv-footer-height, 45px);
    width: var(--dmv-filter-panel-width);
    background: white;
    box-shadow: 4px 0 12px rgba(0,0,0,0.2);
    z-index: 1100;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dmv-filter-panel.open {
    left: 0;
}

/* On 4k monitors (>= 2560px), show panel by default */
@media (min-width: 2560px) {
    .dmv-filter-panel {
        left: 0;
    }
    
    .dmv-filter-panel.open {
        left: 0;
    }
    
    /* Panel is visible, so toggle moves to right edge of panel */
    .dmv-filter-toggle {
        left: var(--dmv-filter-panel-width);
    }
    
    /* When panel is explicitly closed on 4k, hide it */
    .dmv-filter-panel.closed {
        left: calc(-1 * var(--dmv-filter-panel-width) - 20px);
    }
    
    .dmv-filter-panel.closed ~ .dmv-filter-toggle {
        left: 0;
    }
}

/* Filter header */
.dmv-filter-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e59e23;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.dmv-filter-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.dmv-filter-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.dmv-filter-close:hover {
    color: #000;
}

/* Filter content - scrollable */
.dmv-filter-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
}

/* Filter sections */
.dmv-filter-section {
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.dmv-filter-section-title {
    margin: 0;
    padding: 12px 15px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #ddd;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dmv-filter-section-title:hover {
    background: #e9ecef;
}

.dmv-filter-section-title .glyphicon {
    transition: transform 0.3s;
}

.dmv-filter-section.collapsed .dmv-filter-section-title .glyphicon {
    transform: rotate(-90deg);
}

.dmv-filter-section-content {
    padding: 15px;
    background: white;
}

.dmv-filter-section.collapsed .dmv-filter-section-content {
    display: none;
}

/* Form styling within filter panel */
.dmv-filter-section .form-group {
    margin-bottom: 15px;
}

.dmv-filter-section .form-group:last-child {
    margin-bottom: 0;
}

.dmv-filter-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 13px;
}

.dmv-filter-section .form-control {
    font-size: 14px;
}

.dmv-filter-section .input-group-addon {
    font-size: 13px;
}

/* Filter footer */
.dmv-filter-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.dmv-filter-footer .btn {
    flex: 1;
    font-weight: 600;
}

.dmv-filter-footer .btn-success {
    background: #e59e23;
    border-color: #e59e23;
}

.dmv-filter-footer .btn-success:hover {
    background: #d18d1f;
    border-color: #d18d1f;
}

/* Overlay when panel is open - only shown on non-4K screens */
.dmv-filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1090;
    pointer-events: none;
}

.dmv-filter-overlay.show {
    display: block;
    pointer-events: auto;
}

/* Ensure overlay is hidden when panel is not open (safety rule) */
body:has(.dmv-filter-panel:not(.open)) .dmv-filter-overlay {
    display: none !important;
}

/* Never show overlay on 4K screens */
@media (min-width: 2560px) {
    .dmv-filter-overlay,
    .dmv-filter-overlay.show {
        display: none !important;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .dmv-filter-panel {
        width: 100%;
        left: -100%;
    }
    
    .dmv-filter-panel.open {
        left: 0;
    }
    
    .dmv-filter-toggle {
        bottom: 20px;
        top: auto;
        transform: none;
        left: 10px;
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 50px;
        flex-direction: row;
        width: auto;
    }
    
    .dmv-filter-toggle-text {
        writing-mode: horizontal-tb;
        letter-spacing: normal;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .dmv-filter-header h3 {
        font-size: 18px;
    }
    
    .dmv-filter-footer {
        flex-direction: column;
    }
    
    .dmv-filter-footer .btn {
        width: 100%;
    }
}
