/* Custom Accordion Styling */
.accordion {
    --bs-accordion-border-radius: 12px;
    --bs-accordion-border-color: rgba(255, 103, 37, 0.15);
    --bs-accordion-bg: #ffffff;
}

.accordion-item {
    background-color: #fff;
    border: 1px solid rgba(255, 103, 37, 0.15);
    border-radius: 12px !important;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.accordion-item:hover {
    box-shadow: 0 4px 15px rgba(255, 103, 37, 0.15);
    transform: translateY(-2px);
}

.accordion-item:last-of-type {
    margin-bottom: 0;
}

.accordion-button {
    padding: 18px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    background-color: #fff;
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.accordion-button:hover {
    background-color: #fff8f5;
    color: #ff6725;
}

.accordion-button:focus {
    box-shadow: none;
    border: none;
    outline: none;
}

.accordion-button:not(.collapsed) {
    color: #cc4400;
    background: linear-gradient(135deg, #fff8f5 0%, #ffede5 100%);
    box-shadow: inset 0 -3px 0 0 #ff6725;
    border-radius: 12px 12px 0 0 !important;
}

.accordion-button::after {
    width: 24px;
    height: 24px;
    background-size: 24px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23666'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    transition: transform 0.3s ease;
}

.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ff6725'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    transform: rotate(-180deg);
}

.accordion-button:hover::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ff6725'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.accordion-collapse {
    border: none;
}

.accordion-body {
    padding: 24px;
    font-size: 14px;
    line-height: 1.7;
    color: #666;
    background-color: #fff;
    border-radius: 0 0 12px 12px;
}

.accordion-body p:last-child,
.accordion-body ul:last-child,
.accordion-body ol:last-child {
    margin-bottom: 0;
}

.accordion-body ul,
.accordion-body ol {
    padding-left: 20px;
}

.accordion-body li {
    margin-bottom: 8px;
}

.accordion-body strong {
    color: #333;
    font-weight: 600;
}

.accordion-body a {
    color: #ff6725;
    text-decoration: none;
    transition: all 0.3s ease;
}

.accordion-body a:hover {
    color: #cc4400;
    text-decoration: underline;
}

/* Accordion Header with Icon */
.accordion-button i {
    margin-right: 12px;
    font-size: 18px;
    transition: all 0.3s ease;
}

.accordion-button:not(.collapsed) i {
    color: #ff6725;
}

/* Responsive */
@media (max-width: 768px) {
    .accordion-button {
        padding: 15px 18px;
        font-size: 15px;
    }

    .accordion-body {
        padding: 18px;
        font-size: 13px;
    }

    .accordion-item {
        margin-bottom: 12px;
    }
}


/* ═══════════════════════════════════════════════
   Sidebar Tool Tree — Matches Dashboard Theme
   ═══════════════════════════════════════════════ */

.sb-tools-section {
    padding: 30px 0 20px;
}

.sb-tools-header {
    padding: 0 30px;
    margin-bottom: 10px;
}

.sb-tools-header .nav-title {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.26px;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.3);
    margin-bottom: 0 !important;
    padding-left: 0 !important;
}

.sb-tools-count {
    display: none;
}

/* Search */
.sb-tool-search-wrap {
    padding: 0 30px;
    margin-bottom: 10px;
}

#sidebar-tool-search {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 38px;
    font-size: 14px;
    font-weight: 400;
    color: #000;
    background: #f5f5f5;
    border: 1px solid #E9E9E9;
    border-radius: 10px;
    outline: none;
    transition: all 0.25s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
}

#sidebar-tool-search:focus {
    border-color: #000;
    background-color: #fff;
    box-shadow: none;
}

#sidebar-tool-search::placeholder {
    color: #aaa;
    font-size: 13px;
    font-weight: 400;
}

/* Category Group */
.sb-cat-group {
    margin-bottom: 0;
}

.sb-cat-group.sb-hidden {
    display: none !important;
}

/* Category Header — matches .dasboard-main-nav li a */
.sb-cat-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 13px 5px 13px 20px;
    margin: 0 30px;
    width: calc(100% - 60px);
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 500;
    color: #000;
    transition: all 0.25s ease-in-out;
    gap: 15px;
    text-align: left;
    border-radius: 10px;
    cursor: url(../dashboard/images/icon/pointer.svg), pointer !important;
}

.sb-cat-toggle:hover {
    text-decoration: underline;
}

.sb-cat-toggle .sb-cat-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sb-cat-toggle .sb-cat-icon img {
    width: 20px;
    height: 20px;
    max-width: 20px;
}

.sb-cat-toggle .sb-cat-label {
    flex: 1;
}

.sb-cat-toggle .sb-cat-count {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.3);
    font-weight: 400;
    margin-left: auto;
}

.sb-cat-toggle .sb-cat-chevron {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.3;
    flex-shrink: 0;
}

.sb-cat-toggle .sb-cat-chevron svg {
    width: 10px;
    height: 10px;
}

/* Expanded state — black pill like existing active nav */
.sb-cat-group.sb-open .sb-cat-toggle {
    background: #000;
    color: #fff;
    text-decoration: none;
}

.sb-cat-group.sb-open .sb-cat-toggle .sb-cat-icon img {
    filter: brightness(0) invert(1);
}

.sb-cat-group.sb-open .sb-cat-toggle .sb-cat-count {
    color: rgba(255, 255, 255, 0.5);
}

.sb-cat-group.sb-open .sb-cat-toggle .sb-cat-chevron {
    transform: rotate(90deg);
    opacity: 0.5;
    color: #fff;
}

/* Tool List — collapsible with connector line */
.sb-tool-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin-left: 39px;
    padding-left: 16px;
    border-left: 1.5px solid #E9E9E9;
}

.sb-cat-group.sb-open .sb-tool-list {
    max-height: 2000px;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tool Item — matches nav item style */
.sb-tool-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 12px;
    margin: 1px 20px 1px 0;
    border-radius: 10px;
    text-decoration: none !important;
    transition: all 0.25s ease-in-out;
    min-height: 38px;
    position: relative;
}

.sb-tool-item::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    width: 12px;
    height: 1.5px;
    background: #E9E9E9;
}

.sb-tool-item img {
    width: 18px;
    height: 18px;
    max-width: 18px;
    flex-shrink: 0;
}

.sb-tool-item span {
    font-size: 14px;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sb-tool-item:hover {
    text-decoration: underline;
}

/* Active state — orange pill */
.sb-tool-item.active {
    background: #ff6725;
    border-radius: 10px;
}

.sb-tool-item.active::before {
    background: #ff6725;
}

.sb-tool-item.active img {
    filter: brightness(0) invert(1);
}

.sb-tool-item.active span {
    color: #fff;
    font-weight: 500;
}

.sb-tool-item.active:hover {
    text-decoration: none;
}

/* Hidden items (search filter) */
.sb-tool-hidden {
    display: none !important;
}

/* No results */
.sb-no-results {
    display: none;
    text-align: center;
    padding: 30px 20px;
    color: rgba(0, 0, 0, 0.3);
    font-size: 14px;
}

.sb-no-results i {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.3;
}

/* Search mode — when filtering, show all expanded */
.sb-tools-section.sb-searching .sb-tool-list {
    max-height: 2000px;
    border-left-color: transparent;
}

.sb-tools-section.sb-searching .sb-tool-item::before {
    display: none;
}

.sb-tools-section.sb-searching .sb-cat-toggle {
    display: none;
}

.sb-tools-section.sb-searching .sb-tool-list {
    margin-left: 30px;
    padding-left: 0;
}


/* ═══════════════════════════════════════════════════════════
   Unified Map Styles — LandLens-inspired, Leaflet/OSM
   Used by all non-LandLens GIS/map tools (vr-map-* prefix)
   ═══════════════════════════════════════════════════════════ */

/* Map Container */
.vr-map-container {
    position: relative;
    height: 520px;
    background-color: #f0f0f0;
    border-radius: 16px;
    overflow: hidden;
}

.vr-map-container #map,
.vr-map-container [id$="Map"] {
    width: 100%;
    height: 100%;
    z-index: 1;
    outline: none;
}

/* Leaflet z-index fix */
.vr-map-container .leaflet-pane,
.vr-map-container .leaflet-control {
    z-index: 1 !important;
}
.vr-map-container .leaflet-top,
.vr-map-container .leaflet-bottom {
    z-index: 2 !important;
}
.vr-map-container .leaflet-control-attribution {
    display: none !important;
}

/* Leaflet Zoom Controls — frosted glass */
.vr-map-container .leaflet-control-zoom {
    border: none !important;
    border-radius: 10px !important;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.vr-map-container .leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    background-color: rgba(255, 255, 255, 0.92) !important;
    color: #1a1a1c !important;
    border: none !important;
    border-bottom: 1px solid #e9ecef !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}
.vr-map-container .leaflet-control-zoom a:last-child {
    border-bottom: none !important;
}
.vr-map-container .leaflet-control-zoom a:hover {
    background-color: #FF6725 !important;
    color: white !important;
}
.vr-map-container .leaflet-control-zoom a.leaflet-disabled {
    background-color: #f0f0f0 !important;
    color: #ccc !important;
    cursor: not-allowed;
}

/* Cursors */
.vr-map-container .leaflet-container {
    cursor: url(../dashboard/images/icon/grab.svg), grab !important;
}
.vr-map-container .leaflet-container:active,
.vr-map-container .leaflet-dragging .leaflet-container {
    cursor: url(../dashboard/images/icon/dragging.svg), grabbing !important;
}

/* Search Container */
.vr-map-search-container {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 1000;
    max-width: 400px;
}
.vr-map-search-wrapper {
    position: relative;
}
.vr-map-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: rgba(26, 26, 28, 0.4);
    pointer-events: none;
}
.vr-map-search-input {
    width: 100%;
    height: 48px;
    padding: 0 3.5rem 0 2.75rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 14px;
    color: #1a1a1c;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}
.vr-map-search-input::placeholder {
    color: rgba(26, 26, 28, 0.5);
}
.vr-map-search-input:focus {
    outline: none;
    border-color: #FF6725;
    box-shadow: 0 4px 20px rgba(255, 103, 37, 0.15);
}

/* Search Results */
.vr-map-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid #e9ecef;
    max-height: 280px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
}
.vr-map-search-results .gps-result-item {
    padding: 0.875rem 1rem;
    cursor: url(../dashboard/images/icon/pointer.svg), pointer !important;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}
.vr-map-search-results .gps-result-item:last-child {
    border-bottom: none;
}
.vr-map-search-results .gps-result-item:hover {
    background-color: rgba(255, 103, 37, 0.08);
}
.vr-map-search-results .gps-result-item i {
    color: #FF6725;
}
.vr-map-search-results .gps-no-results {
    color: rgba(26, 26, 28, 0.5);
    cursor: default;
}
.vr-map-search-results .gps-no-results:hover {
    background: transparent;
}
.vr-map-search-results .gps-searching {
    border-radius: 16px;
}

/* Location Button (inside search bar) */
.vr-map-location-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: url(../dashboard/images/icon/pointer.svg), pointer !important;
    transition: all 0.2s ease;
}
.vr-map-location-btn svg {
    width: 18px;
    height: 18px;
    color: #1a1a1c;
    transition: color 0.2s ease;
}
.vr-map-location-btn:hover svg {
    color: #FF6725;
}
.vr-map-location-btn:active {
    transform: translateY(-50%) scale(0.9);
}
.vr-map-location-btn.loading svg {
    animation: vrLocateSpin 1s linear infinite;
}
@keyframes vrLocateSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Map Instruction */
.vr-map-instruction {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(26, 26, 28, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}
.vr-map-instruction.hidden {
    opacity: 0;
    pointer-events: none;
}
.vr-map-instruction svg {
    width: 18px;
    height: 18px;
    color: #ff8f5c;
    flex-shrink: 0;
}
.vr-map-instruction i {
    color: #ff8f5c;
}

/* Map Legend */
.vr-map-legend {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    z-index: 800;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 180px;
}
.vr-map-legend h6 {
    margin: 0 0 10px 0;
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.vr-map-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 12px;
    color: #666;
}
.vr-map-legend-item:last-child {
    margin-bottom: 0;
}
.vr-map-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Map Loader */
.vr-map-loader {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    flex-direction: column;
    gap: 1rem;
}
.vr-map-loader.show {
    display: flex;
}
.vr-map-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top-color: #FF6725;
    border-radius: 50%;
    animation: vrMapSpin 0.8s linear infinite;
}
@keyframes vrMapSpin {
    to { transform: rotate(360deg); }
}
.vr-map-loader-text {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

/* Result Card — floating on map */
.vr-map-result-card {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    width: 400px;
    max-width: calc(100% - 2rem);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    overflow: hidden;
    animation: vrSlideUp 0.3s ease;
}
@keyframes vrSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.vr-map-result-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #FF6725 0%, #ff8f5c 100%);
    color: white;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.vr-map-result-header .vr-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: url(../dashboard/images/icon/pointer.svg), pointer !important;
    color: white;
    transition: all 0.2s ease;
}
.vr-map-result-header .vr-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}
.vr-map-result-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

/* Custom Marker */
.vr-custom-marker {
    background: transparent !important;
    border: none !important;
}
.vr-custom-marker div {
    animation: vrMarkerPulse 2s ease-in-out infinite;
}
@keyframes vrMarkerPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(255, 103, 37, 0.4); }
    50% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 8px rgba(255, 103, 37, 0); }
}

/* Responsive */
@media (max-width: 768px) {
    .vr-map-container {
        height: 420px;
        border-radius: 12px;
    }
    .vr-map-search-container {
        max-width: none;
    }
    .vr-map-result-card {
        width: calc(100% - 1rem);
        left: 0.5rem;
        bottom: 0.5rem;
    }
    .vr-map-legend {
        display: none;
    }
    .vr-map-instruction {
        font-size: 12px;
        padding: 0.625rem 1.25rem;
    }
}
@media (max-width: 480px) {
    .vr-map-container {
        height: 350px;
    }
}
