﻿/* Define CSS variables for consistent color scheme */
:root {
    --accordion-bg-color: black; /* Match the icon background color */
    --accordion-border-color: white; /* Match the icon border color */
    --accordion-expanded-bg-color: #cf810c; /* Match the icon hover background color */
    --accordion-text-color: white; /* Keep the text color consistent */
    --toolbar-button-bg-color: black;
    --toolbar-button-border-color: white;
    --toolbar-button-text-color: white;
}

/* Map container styling */
#map {
    border: 1px solid black;
    border-radius: 10px;
    height: 86vh;
    width: 100%;
    resize: vertical;
}

/* Collapse fully, no leftover blank space */
#mapToolsInner.collapse:not(.show) {
    display: none;
}

/* Sidebar styling */
#sidebarDivId {
    flex: 1;
    float: left;
    width: 100%;
    height: 87vh;
    max-height: 100%;
    resize: both;
    overflow: hidden;
    color: #175B81;
}

    #sidebarDivId ::placeholder {
        color: #999;
    }


#sidebarContent {
    height: 100%;
    overflow-y: auto; /* this scrolls instead */
}

.main-content {
    position: relative;
}

#sidebarToggleButtonId {
    position: absolute;
    left: 0; /* Adjust this value as needed */
    top: 50%;
    transform: translateY(50%);
    z-index: 1000; /* Ensure the button is on top of other elements */
}

/* No padding utility classes */
.no-padding {
    padding: 0 !important;
}

.no-padding-left {
    padding: 0 !important;
    padding-left: 5px !important;
}

/* Main content styling */
.main-content {
    flex: 2;
}

/* Flexbox row container */
.row {
    display: flex;
    flex-wrap: wrap;
}

/* Table field and values */
.text-xs {
    font-size: 0.75rem;
}

.list-group-item-xs {
    padding: 0.25rem 0.5rem;
    margin: 0;
    font-size: 0.75rem;
}

.table-sm th, .table-sm td,
#bottomTableID th, #bottomTableID td,
#intermentBuryTableId th, #intermentBuryTableId td {
    padding: 5px;
    margin: 5px;
    font-size: 0.75rem;
}

.table-sm, .table-sm td, .table-sm th {
    border-color: #444 !important;
}


/* Bottom table container styling */
#bottomTableInnerContainerDivId {
    position: absolute;
    margin: 1px;
    bottom: 0;
    width: 100%;
}

/* Bottom table styling */
#bottomTableDivId {
    overflow: auto;
    height: 200px;
    border: 1px solid #000000;
    border-radius: 10px;
    resize: vertical;
}

/* Search wrapper styling */
.search-wrapper {
    display: flex;
    flex-direction: column;
}

#searchNav {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

    /* Lighter top section inside sidebar */
    #searchNav .search-wrapper {
        background: linear-gradient(to bottom, #3a3a3a, #262626);
        border: none !important; /* ✅ This removes all borders */
        border-radius: 8px;
        padding: 10px;
    }

    #searchNav input[type="radio"],
    #searchNav input[type="checkbox"] {
        accent-color: #cf810c;
        background-color: #3a3a3a;
        border: 1px solid #777;
    }

        #searchNav input[type="radio"]:hover,
        #searchNav input[type="checkbox"]:hover {
            box-shadow: 0 0 3px #cf810c;
        }

    #searchNav .form-check-label {
        color: #f0f0f0;
    }


#searchTextId:focus {
    background-color: #444;
    border-color: #cf810c;
    box-shadow: 0 0 4px #cf810c;
}

#searchTextId:hover {
    border-color: #cf810c;
}

.form-text {
    font-size: 0.85rem;
    opacity: 0.85;
}

/* Modal styling */
.modal {
    z-index: 1060;
}

/* Toolbar button styles */
.newcom-background-circle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 2px solid var(--toolbar-button-border-color);
    border-radius: 50%;
    background-color: var(--toolbar-button-bg-color);
    color: var(--toolbar-button-text-color);
    font-size: 16px;
    padding: 2px;
    transition: background-color 0.3s;
}

.newcom-background-rectangle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px; /* vertical | horizontal */
    border: 2px solid var(--toolbar-button-border-color);
    border-radius: 6px; /* keeps a softer rectangular shape */
    background-color: var(--toolbar-button-bg-color);
    color: darkorange; /*var(--toolbar-button-text-color);*/
    font-size: 16px;
    transition: background-color 0.3s;
    height: auto; /* let padding + text determine height */
    width: auto; /* grow naturally with text */
}

.newcom-background-rectangle-icon:hover {
    background-color: var(--accordion-expanded-bg-color);
    color: white;
}

    /* Hover effect for toolbar buttons */
    .newcom-background-circle-icon:hover {
        background-color: var(--accordion-expanded-bg-color);
        color: var(--accordion-text-color);
    }

/* Change background color when the associated radio button is checked */
input[type="radio"]:checked + label.newcom-background-circle-icon {
    background-color: #cf810c;
}

/* Styling for rectangular icon background */
.newcom-background-rect-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 30px;
    border: 2px solid white;
    border-radius: 4px;
    background-color: #cf810c;
    color: white;
    font-size: 16px;
    padding: 2px 8px;
}

/* Navigation item styling */
.nav-item .btn-dark {
    background-color: var(--toolbar-button-bg-color);
    color: var(--toolbar-button-text-color);
}

    .nav-item .btn-dark:hover {
        background-color: #cf810c;
        color: black;
    }

/* Adjusting button size */
.btn-smaller {
    padding: 0 5px;
    font-size: 14px;
    line-height: 1.5;
}

/* Ensure icon does not capture click events */
#dfAltContactBtnId .bi {
    pointer-events: none;
}

/* Interment view container */
#intermentViewContainer {
    width: 100%;
    overflow-x: auto;
}

    #intermentViewContainer img {
        max-width: 100%;
        height: auto;
    }

    /* Styling for the accordion within .accordion-container */
    #intermentViewContainer .accordion {
        background-color: var(--accordion-bg-color);
        border: 1px solid var(--accordion-border-color);
        border-radius: 0.25rem;
    }

    #intermentViewContainer .accordion-button {
        background-color: var(--accordion-bg-color);
        color: var(--accordion-text-color);
        font-size: 1rem;
        padding: 0.125rem 0.5rem;
        border: none;
    }

        #intermentViewContainer .accordion-button:not(.collapsed) {
            background-color: var(--accordion-expanded-bg-color);
        }

    /* Simplified selector for accordion tables */
    #intermentViewContainer .accordion-table {
        border: 2px solid var(--accordion-border-color);
        border-radius: 0.25rem;
    }

    #intermentViewContainer .accordion-button {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 1rem;
        padding: 0.5rem 1rem;
        background-color: var(--accordion-bg-color);
        color: var(--accordion-text-color);
        border: none;
        transition: background-color 0.3s, color 0.3s;
    }

        #intermentViewContainer .accordion-button:not(.collapsed) {
            background-color: var(--accordion-expanded-bg-color);
            color: var(--accordion-text-color);
        }

    #intermentViewContainer .badge {
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
        border-radius: 0.25rem;
    }


/* Navbar nav-item styling for the last four items */
/*.navbar-nav .nav-item:nth-last-child(-n+4) {
    border: 1px solid #000;
    padding: 0;
    margin-right: 5px;
}*/

/* Media query for larger screens */
@media (min-width: 768px) {
    #sidebarDivId {
        width: 33%;
    }
}

/* Media query for smaller screens */
@media (max-width: 768px) {
    .row {
        flex-direction: column;
    }

    #sidebarDivId {
        width: 100%;
    }
}

.legend-container, .mapControl-wrapper {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 10px;
    width: 100%;
    max-height: none !important; /* ✅ Remove height cap */
    overflow-y: visible !important; /* ✅ Remove inner scroll */
}

.legend-item {
    display: flex;
    flex-direction: column;
    /*align-items: center;*/ /* Align items to the center */
    /* padding: 10px 0;*/
}

    .legend-item div {
        margin-bottom: 5px; /* Spacing between title and image */
    }

    .legend-item img {
        margin: 0 auto; /* Center image */
    }

/* Enlarged Leaflet button styles */
.leaflet-button-enlarged {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px; /* Increase by 1/3 (30px * 1.33) */
    height: 20px; /* Increase by 1/3 (30px * 1.33) */
    border: 1px solid #430505;
    border-radius: 50%;
    background-color: var(--toolbar-button-bg-color);
    color: var(--toolbar-button-text-color);
    font-size: 10px; /* Increase by 1/3 (16px * 1.33) */
    padding: 0;
    margin: 1px;
    transition: background-color 0.3s;
}

/* Display controls vertically and add spacing between them */
#leafletControlsContainer {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Add space between controls */
    align-items: flex-start; /* Align items to the start to remove space on the right */
}

.leaflet-control-mouseposition.leaflet-control {
    font-size: 12px; /* Change 12px to your desired font size */
}

/* Main control panel */
.leaflet-control-layers {
    background-color: black !important;
    color: white !important;
    border: 2px solid white !important;
    border-radius: 10px !important;
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    padding: 1px;
    font-size: 0.7rem !important;
}

/* Scrollable layer list section */
.leaflet-control-layers-list {
    max-height: 400px;
    overflow-y: auto;
}

/* Individual layer labels */
.leaflet-control-layers label {
    display: block;
    padding: 1px 2px;
    border-radius: 6px;
    margin: 2px 0;
    transition: background-color 0.3s;
    color: white;
}

    .leaflet-control-layers label span {
        font-size: inherit; /* ensures it uses the parent size */
    }


    .leaflet-control-layers label:hover {
        background-color: #cf810c; /* Match hover color */
        color: black;
    }

/* Checkboxes and radio buttons */
.leaflet-control-layers-selector {
    transform: scale(1.2);
    margin-right: 6px;
}

    /* Disabled labels */
    .leaflet-control-layers-selector:disabled + span {
        color: gray;
        font-style: italic;
    }

/* Base and overlay section headers */
.leaflet-control-layers-base label,
.leaflet-control-layers-overlays label {
    font-weight: bold;
    color: white;
}

/* Separator line */
.leaflet-control-layers-separator {
    border-top: 1px solid white;
    margin: 8px 0;
}

/* Toggle button */
.leaflet-control-layers-toggle {
    background-color: black;
    border: 2px solid white;
    background-image: url('https://unpkg.com/leaflet@1.9.4/dist/images/layers.png');
    background-size: 70% 70%;
    background-repeat: no-repeat;
    background-position: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

    .leaflet-control-layers-toggle:hover {
        background-color: #cf810c;
        border-color: #cf810c;
    }


.geo-search.leaflet-control button {
    width: 26px;
    height: 26px;
    margin: 1px;
}

.browser-print-mode {
    font-size: 12px; /* Adjust the font size as needed */
    margin: 0;
    padding: 5px;
}

/* Suggestions Dropdown Styling */
#lotSuggestions,
#sectionSuggestions,
#blockSuggestions,
#plotSuggestions {
    font-size: 0.75rem; /* Match form-control-sm */
    line-height: 1.4;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    background-color: white;
    padding: 0;
    margin-top: 2px;
}

    /* Suggestion List Items */
    #lotSuggestions li,
    #sectionSuggestions li,
    #blockSuggestions li,
    #plotSuggestions li {
        font-size: 0.75rem; /* Same as .text-xs */
        padding: 0.25rem 0.5rem; /* Same as .list-group-item-xs */
        cursor: pointer;
        border-bottom: 1px solid #eee;
    }

        /* Hover Effect */
        #lotSuggestions li:hover,
        #sectionSuggestions li:hover,
        #blockSuggestions li:hover,
        #plotSuggestions li:hover {
            background-color: #f0f0f0;
        }

#clearFields {
    margin-top: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem; /* same as form-control-sm */
    line-height: 1.5;
}

/* General Sidebar Section Styling */
#sidebar-nav > div {
    border-bottom: 1px solid #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
}

/* Remove the section spacing ONLY when the inner panel is collapsed */
#sidebar-nav > #mapToolsContainer:has(#mapToolsInner.collapse:not(.show)) {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: 0 !important;
}

/* Optional: when open, keep your normal spacing */
#sidebar-nav > #mapToolsContainer:has(#mapToolsInner.show) {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

/* Also ensure the button row doesn't add extra gap */
#mapToolsContainer .d-flex {
    margin-bottom: 0 !important;
}


/* Section Headings */
#sidebar-nav > div label,
#sidebar-nav > div .form-label,
#sidebar-nav > div .card-header {
    color: #cf810c;
    font-weight: 600;
}

/* Inputs and Radio Controls */
#sidebar-nav input[type="search"],
#sidebar-nav input[type="radio"],
#sidebar-nav input[type="checkbox"],
#sidebar-nav .form-check-label {
    background-color: #262626;
    color: white;
    border-color: #444;
}

#sidebar-nav .form-control {
    background-color: #262626;
    border: 1px solid #555;
    color: white;
}

/* Dropdown (search results) */
#contactListId {
    background-color: #1e1e1e;
    color: white;
    border: 1px solid #666;
}

    /* Highlight selected result */
    #contactListId li:hover {
        background-color: #cf810c;
        color: black;
    }

/* Inline interment block styling */
#inlineIntermentContainer {
    border-top: 1px solid #444;
    padding-top: 10px;
}

/* Map control wrapper customization */
.mapControl-wrapper {
    background-color: #101010;
    border: 1px solid #555;
}

/* Card background for legends */
.legend-container .card {
    background-color: #1e1e1e;
    border: 1px solid #333;
    color: white;
}

/* Card headers for legends */
.legend-container .card-header {
    background-color: #000;
    color: #cf810c;
    font-weight: bold;
}

/* Map control icon buttons hover */
.mapControl-wrapper .btn-outline-light:hover {
    background-color: #cf810c;
    color: black;
}

.legend-container .card-body {
    background-color: #f7f7f7;
    color: #000;
}

input[type="search"]::-webkit-search-cancel-button {
    filter: invert(1); /* Makes the "X" white in dark mode */
    cursor: pointer;
}

/* Make checkboxes and radios larger and clearer */
input[type="checkbox"],
input[type="radio"] {
    transform: scale(1.3);
    accent-color: #cf810c; /* Adds bright amber tone */
    background-color: #262626;
    border: 1px solid #888;
    cursor: pointer;
}

    /* On hover: add subtle glow effect */
    input[type="checkbox"]:hover,
    input[type="radio"]:hover {
        box-shadow: 0 0 3px #cf810c;
    }

.form-check-label {
    color: white;
    font-size: 0.85rem;
    margin-left: 0.4rem;
}


.newcom-dark-panel {
    background-color: #1f1f1f; /* dark background to match sidebar */
    color: #f8f9fa; /* light text */
    border: 1px solid #444; /* subtle border */
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); /* 3D effect */
}

.newcom-search-header {
    background-color: #000; /* Match Search customers box */
    color: #fff; /* White text */
    font-weight: bold;
    padding: 8px 12px;
    border-bottom: 1px solid #333; /* Optional subtle separator */
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

/* HEADER TWEAKS */
.navbar {
    background-color: #1f1f1f; /* match dark sidebar */
    border-bottom: 1px solid #444;
    color: #fff;
}

    .navbar .navbar-brand,
    .navbar .nav-link {
        color: #fff;
        font-weight: 500;
    }

        .navbar .nav-link:hover,
        .navbar .navbar-brand:hover {
            color: #cf810c;
        }

/* FOOTER TWEAKS */
footer.footer {
    background-color: #1f1f1f;
    color: #ccc;
    padding: 1rem 0;
    border-radius: 8px;
    font-size: 0.85rem;
    border-top: 1px solid #444;
}

    footer.footer a {
        color: #cf810c;
        text-decoration: none;
    }

        footer.footer a:hover {
            color: #fff;
            text-decoration: underline;
        }

footer img,
.navbar-brand img {
    filter: brightness(1.1) contrast(1.2);
}

/* Wrap your toggle and layer list in a relative container */
.leaflet-control-layers {
    position: relative;
}

/* Position the toggle button absolutely inside the container */
#layerToggleBtn {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 1001;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 2px solid var(--toolbar-button-border-color);
    border-radius: 50%;
    background-color: var(--toolbar-button-bg-color);
    color: var(--toolbar-button-text-color);
    font-size: 16px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s, color 0.3s;
}

    #layerToggleBtn:hover {
        background-color: var(--accordion-expanded-bg-color);
        color: var(--accordion-text-color);
    }


    #layerToggleBtn.minimized {
        font-size: 12px;
        opacity: 0.6;
    }


.leaflet-control-layers-list.minimized {
    display: none;
}

/* Chevron base */
.btn .chevron {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transition: transform 0.25s ease;
}

/* Collapsed → ▼ */
button[aria-expanded="false"] .chevron {
    transform: rotate(45deg); /* ▼ */
}

/* Expanded → ▲ */
button[aria-expanded="true"] .chevron {
    transform: rotate(-135deg); /* ▲ */
}




/* If your utility class is .mh-700 (min-height) or .max-mh-700 (max-height),
   kill it on small screens so it can't force a tall empty box */
@media (max-width: 991.98px) {
    .mh-700,
    .max-mh-700,
    #sidebarDivId {
        min-height: 0 !important;
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
    }

    #sidebarContent {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* Keep your cap *only* on desktop if you still want it */
@media (min-width: 992px) {
    .mh-700,
    .max-mh-700 {
        /* pick whichever you really intended: */
        /* min-height: 700px;   or   max-height: 700px; */
    }
}
