/* Common Layout Styles */
#map-layer-directory #layer-page #layer-group-page .container-fluid {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    position: relative;
    overflow-x: hidden;
}

.content-container {
    background-color: #f8f9fa; /* Light grey background */

}

.content-area {
    background-color: #ffffff; /* White inner content */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 60vh
}

/* Sidebar Styles */
.sidebar-container-maps {
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Apply max-width only for desktop sizes */
@media (min-width: 768px) {
    .sidebar-container-maps {
        max-width: 300px;
    }
}

.map-layers-sidebar {
    background-color: #ebf4fa;
    border-right: 1px solid #d9e8f5;
    height: 100%;
    min-height: calc(100vh - 0px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Apply max-width only for desktop sizes */
@media (min-width: 768px) {
    .map-layers-sidebar {
        max-width: 300px;
    }
}

.map-layers-sidebar::-webkit-scrollbar {
    display: none;
}

.map-layers-sidebar .sidebar-header {
    background-color: #ebf4fa;
    color: #011e61;
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #d9e8f5;
}

.map-layers-sidebar .sidebar-header h5 {
    margin: 0;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Search container within sidebar header */
.map-layers-sidebar .search-container {
    background-color: #ebf4fa;
}

.map-layers-sidebar .search-container input {
    border: 1px solid #d9e8f5;
    border-radius: 4px;
    font-size: 0.875rem;
}

.map-layers-sidebar .search-container input:focus {
    border-color: #011e61;
    box-shadow: 0 0 0 0.2rem rgba(1, 30, 97, 0.25);
}

/* Mobile navbar styling */
.map-layers-navbar {
    background-color: #ebf4fa;
    border-bottom: 1px solid #d9e8f5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding-top: .5rem;
    padding-bottom: .5rem;
}

.map-layers-navbar .navbar-brand {
    color: #011e61;
    font-weight: 600;
}

.map-layers-navbar .navbar-toggler {
    border-color: rgba(1, 30, 97, 0.25);
}

.map-layers-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(1, 30, 97, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.map-layers-navbar .search-container {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.map-layers-navbar .search-container input {
    border: 1px solid #d9e8f5;
}

.map-layers-navbar .search-container input:focus {
    border-color: #011e61;
    box-shadow: 0 0 0 0.2rem rgba(1, 30, 97, 0.25);
}

/* Mobile responsive adjustments */
@media (max-width: 767.98px) {
    .map-layers-navbar .container-fluid {
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }
    
    .map-layers-navbar .d-flex {
        align-items: center;
        gap: 0.5rem;
    }
    
    .map-layers-navbar .search-container {
        margin-top: 0;
        margin-bottom: 0;
    }
}

/* Navigation Items */
.map-layers-sidebar .nav-item {
    width: 100%;
    border-bottom: 1px solid #f8f9fa;
}

.map-layers-sidebar .nav-item:last-child {
    border-bottom: none;
}

/* Styling for the container of group title and toggle icon */
.map-layers-sidebar .nav-link-group-container {
    color: #011e61;
}

/* Styling for the navigational title link */
.map-layers-sidebar .nav-link-title {
    color: #011e61;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    padding: 12px 16px;
    display: inline-block;
}

.map-layers-sidebar .nav-link-title:hover,
.map-layers-sidebar .nav-link-title:focus {
    background-color: #d7fade;
    text-decoration: none;
}

/* Styling for the toggle icon */
.map-layers-sidebar .toggle-icon {
    font-weight: bold;
    cursor: pointer;
    padding: 12px 16px;
    margin-left: auto;
    align-self: center;
    user-select: none;
}

/* Standard links */
.map-layers-sidebar .nav-link {
    color: #011e61;
    text-decoration: none;
    font-weight: 600;
    padding: 12px 16px;
    transition: all 0.2s ease;
    font-size: 0.95em;
    border-radius: 0;
}

.map-layers-sidebar .nav-link.active {
    background-color: #d9e8f5;
    color: #011e61;
}

/* Sub-item styling for desktop */
.map-layers-sidebar ul.collapse {
    background-color: #f0f8ff;
    margin-left: 0;
    padding-left: 0;
    border-left: none;
}

.map-layers-sidebar ul.collapse.show {
    margin-left: 15px;
    padding-left: 15px;
    border-left: 1px solid #011e61;
}

.map-layers-sidebar .nav-item-sub .nav-link.sub-link {
    font-size: 0.85em;
    font-weight: normal;
    color: #333;
    padding: 8px 16px;
}

.map-layers-sidebar .nav-item-sub .nav-link.sub-link:hover {
    background-color: #d7fade;
    color: #011e61;
}

.map-layers-sidebar .nav-item-sub .nav-link.sub-link.active {
    background-color: #d9e8f5;
    color: #011e61;
}

/* Mobile-specific styles */
.map-layers-navbar .navbar-nav .nav-link {
    color: #011e61;
    font-weight: 600;
    padding: 8px 16px;
}

.map-layers-navbar .navbar-nav .nav-link:hover {
    background-color: #d7fade;
}

.map-layers-navbar .navbar-nav .nav-link.active {
    background-color: #d9e8f5;
}

/* Search dropdown styling */
.search-container, .search-section, .search-section-mobile {
    background-color: #ebf4fa;
    border-color: #d9e8f5;
}

#search-dropdown, .search-dropdown {
    border: 1px solid #d9e8f5;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    background-color: white;
    max-height: 300px;
    overflow-y: auto;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: -1px;
}

.layer-result, .search-result {
    padding: 8px 12px;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.layer-result:last-child, .search-result:last-child {
    border-bottom: none;
}

.layer-result:hover, .search-result:hover {
    background-color: #f0f8ff;
}

.layer-result h6, .search-result h6 {
    margin: 0 0 4px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #011e61;
}

.layer-result .layer-type, .search-result .layer-type {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 4px;
}

.layer-result .layer-description, .search-result .layer-description {
    font-size: 0.8rem;
    color: #495057;
    margin: 0;
}

.search-highlight {
    background-color: #fff3cd;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 600;
}

.search-loading {
    padding: 12px;
    text-align: center;
    color: #6c757d;
}

.no-results {
    padding: 12px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.view-more-results {
    padding: 8px 12px;
    text-align: center;
    border-top: 1px solid #d9e8f5;
    background-color: #f8f9fa;
    color: #011e61;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

.view-more-results:hover {
    background-color: #e9ecef;
}

/* Focus states for search inputs in sidebar */
.sidebar-container-maps input[type="text"]:focus {
    border-color: #011e61;
    box-shadow: 0 0 0 0.2rem rgba(1, 30, 97, 0.25);
    outline: none;
}

/* Card Styles */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-width: 10rem;
}

.card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Image and Placeholder Styles */
.map-sample.aspect-16-9 {
    position: relative;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    min-height: 0;
    border: 2px solid #011e61;
}

.img-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #e0e0e0;
    z-index: 2;
    border-radius: 6px;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
    0% { background-color: #e0e0e0; }
    50% { background-color: #cccccc; }
    100% { background-color: #e0e0e0; }
}

.img-spinner {
    width: 38px;
    height: 38px;
    border: 4px solid #b0b0b0;
    border-top: 4px solid #888;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    background: none;
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Breadcrumb Styles */
.breadcrumb {
    background-color: #f8f9fa;
    
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem;
}

.breadcrumb-item {
    padding: 0.1rem 0.1rem 0.1rem 0.1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #6c757d;
    padding-left: 0.1rem;
}

.breadcrumb a {
    color: #0077cc;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease !important;
}

.breadcrumb a:hover {
    color: #005fa3;
    text-decoration: none !important; /* important to override default underline */
}

.breadcrumb-item.active {
    color: #495057;
    font-weight: 600;
}

/* Responsive Styles */
@media (max-width: 991.98px) {
    .main-content-inner {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    
    #search-dropdown {
        max-height: 250px;
    }
    
    .layer-result {
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .container-fluid.px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .main-content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .content-area {
        border-radius: 0;
        margin: 0;
        padding: 1rem;
    }
}

/* Let images display at their natural proportions */
.card-img-top {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 0 !important;
    max-height: 220px;
}

/* ------------------------------------------------------------------
   Responsive fix for extra-wide screens (> 992px)
   Ensures the sidebar stays 300px and the content panel fills the rest
   ------------------------------------------------------------------ */
@media (min-width: 992px) {
    .sidebar-container-maps {
        flex: 0 0 300px !important;  /* Fixed width sidebar */
        max-width: 300px !important;
        width: 300px !important;
    }
    .content-container {
        flex: 1 1 0% !important;    /* Grow to fill remaining space */
        max-width: none !important; /* Remove Bootstrap's percentage cap */
        width: auto !important;
    }
}

/* ------------------------------------------------------------------
   Scoped styles for /maps/florida/hazards.php (id="help-page")
   These replicate key Help Center visuals while staying isolated.
-------------------------------------------------------------------*/
#help-page .content-container {
    min-height: 100vh;
    background-color: #f8f9fa;
}
#help-page .content-area {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: calc(100vh - 60px);
}
#help-page .card {
    border: 1px solid #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}
#help-page .card:hover {
    transform: none; /* disable hover lift for docs */
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}
#help-page .map-sample.aspect-16-9 {
    border: 2px solid #011e61;
    border-radius: 6px;
}
#help-page .img-placeholder {
    background: linear-gradient(90deg,#f0f0f0 25%,transparent 37%,#f0f0f0 63%);
    background-size: 400% 100%;
    animation: pulse 1.5s ease-in-out infinite;
}
#help-page .img-spinner {
    width: 2rem;
    height: 2rem;
    border: 0.25em solid #dee2e6;
    border-top: 0.25em solid #011e61;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ------------------------------------------------------------------
   Scoped styles for /maps/florida/parcels-appraiser.php (id="parcels-page")
   ------------------------------------------------------------------*/
#parcels-page {
    max-width: 1200px;
}
#parcels-page h1,
#parcels-page h2,
#parcels-page h3 {
    color: #011e61;
    font-weight: 600;
}
#parcels-page .btn-success {
    background-color: #011e61;
    border-color: #011e61;
}
#parcels-page .btn-success:hover,
#parcels-page .btn-success:focus {
    background-color: #013495;
    border-color: #013495;
}
#parcels-page .data_title {
    margin-top: 2rem;
}
#parcels-page .data_body {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}
#parcels-page img.img-fluid {
    border: 2px solid #011e61;
    border-radius: 6px;
}
