body {
    overflow: hidden;
}

/* ============ TOP BAR ============ */

.navbar-offset {
    margin-top: 50px;
}

/* Change all topbar text to white */
.navbar-default .navbar-brand,
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-nav>li>a,
.navbar-default .navbar-nav>li>a:hover,
.navbar-default .navbar-text,
.navbar-default .navbar-link {
    color: #ffffff !important;
}

/* Icon color (Font Awesome) in topbar */
.navbar-default i {
    color: #ffffff !important;
}

/* Search input text inside topbar */
.navbar-default .form-control {
    color: #1e3c72;
}

.navbar-default .navbar-nav>.active>a {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    border-radius: 5px;
}

/* ============ SEARCH BAR ============ */

.navbar-form .input-group {
    background: white;
    border-radius: 30px;
    padding: 3px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.navbar-form .form-control {
    border: none !important;
    border-radius: 30px !important;
    height: 38px;
    font-size: 14px;
    font-weight: 600;
}

.navbar-form .input-group-addon {
    background: #ffcc00 !important;
    color: #1e3c72 !important;
    border: none !important;
    border-radius: 30px !important;
    padding: 8px 14px !important;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.25s ease-in-out;
}

.navbar-form .input-group-addon i {
    color: #1e3c72 !important;
}

.navbar-form .input-group-addon:hover {
    background: #ff9900 !important;
    transform: scale(1.05);
}

.navbar-form .form-control:focus {
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.6);
}

@media (min-width: 992px) {
    .navbar-form .form-control {
        width: 280px;
    }
}

/* Apply SAME gradient as top navigation bar */
.panel-heading {
    background: linear-gradient(to right, #1e3c72, #2a5298) !important;
    color: white !important;
    border-radius: 0 !important;
    padding: 10px 12px !important;
}

/* Text inside headings */
.panel-heading .panel-title a {
    color: white !important;
    font-weight: 600;
}

/* Icons inside panel headings */
.panel-heading i {
    color: #ffcc00 !important;
}

/* Remove ugly grey borders */
.panel.panel-default {
    border-color: transparent !important;
}

#properties .panel-body {
    background: #ffffff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* ============ SIDE BAR ============ */

.sidebar {
    z-index: 45;
}

/* Add space between topbar and left sidebar */
.sidebar-left {
    margin-top: 10px !important;
    /* adjust value as needed */
}

.sidebar-left .sidebar-body {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
}

.main-row {
    position: relative;
    top: 0;
}

.mini-submenu:hover {
    cursor: pointer;
}

.slide-submenu {
    background: rgba(0, 0, 0, 0.45);
    display: inline-block;
    padding: 0 8px;
    border-radius: 4px;
    cursor: pointer;
}


/* ============ MAP ============ */

#map {
    position: absolute;
    top: 50px;
    bottom: 0px;
    left: 0px;
    right: 0px;
    z-index: 35;
}

/* Move OpenLayers zoom buttons to RIGHT above globe icon */
#map .ol-zoom {
    position: absolute !important;
    top: 100px;        /* ABOVE .basemap-toggle (which is 90px) */
    right: 20px;       /* SAME as basemap-toggle */
    left: auto !important;
    z-index: 1100;
}

/* Style zoom buttons to match your UI */
#map .ol-zoom button {
    background: #1e3c72 !important;
    color: white !important;
    border-radius: 6px !important;
    margin-bottom: 4px;
    border: none !important;
}

#map .ol-zoom button:hover {
    background: #2a5298 !important;
}

.zoom-top-opened-sidebar {
    margin-top: 5px;
}

.zoom-top-collapsed {
    margin-top: 45px;
}

.mini-submenu {
    display: none;
    background-color: rgba(255, 255, 255, 0.46);
    border: 1px solid rgba(0, 0, 0, 0.9);
    border-radius: 4px;
    padding: 9px;
    width: 42px;
    text-align: center;
}

.mini-submenu-left {
    position: absolute;
    top: 60px;
    left: .5em;
    z-index: 40;
}


/* ============ POP UP ============ */

/* Windows-style Popup */
.ol-popup {
    position: absolute;
    z-index: 9;
    background: #f4f6f9;
    border-radius: 8px;
    border: 1px solid #c6c6c6;
    min-width: 300px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    font-family: "Segoe UI", Tahoma, sans-serif;
}

/* Title bar */
.popup-header {
    background: linear-gradient(to right, #1e3c72, #2a5298);
    z-index: 10;
    color: white;
    padding: 8px 10px;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Title text */
.popup-title {
    font-size: 13px;
    font-weight: 600;
}

/* Window control buttons */
.popup-controls i {
    margin-left: 8px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.popup-controls i:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Body content area */
.popup-body {
    padding: 12px;
    background: #ffffff;
    max-height: 280px;
    overflow-y: auto;
}

.popup-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    overflow: hidden;
    font-size: 13px;
}

.popup-table th {
    background: linear-gradient(to right, #1e3c72, #2a5298);
    color: white;
    font-weight: 600;
    padding: 10px;
    text-align: left;
}

.popup-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.popup-table tr:last-child td {
    border-bottom: none;
}

/* Hover effect */
.popup-table tr:hover td {
    background: #f5f8ff;
}

/* Optional subtle shadow */
.popup-table {
    box-shadow: 0px 3px 18px rgba(0, 0, 0, 0.12);
}


/* ============ AI BOX ============ */

/* CHAT CONTAINER */
.ai-panel-body {
    display: flex;
    flex-direction: column;
    height: 150px;
    padding: 0 !important;
}

.ai-chat-box {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    background: #f7f9fc;
}

/* MESSAGE BUBBLES */
.ai-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.5;
}

.ai-message.user {
    background: #1e3c72;
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 3px;
}

.ai-message.bot {
    background: #e9eef6;
    color: #000;
    margin-right: auto;
    border-bottom-left-radius: 3px;
}

/* INPUT BAR */
.ai-input-wrap {
    display: flex;
    align-items: center;
    border-top: 1px solid #ddd;
    padding: 10px;
    background: #fff;
}

#ai-input {
    flex: 1;
    border-radius: 25px;
    border: 1px solid #d0d7e2;
    padding: 10px 14px;
    resize: none;
    max-height: 120px;
    outline: none;
    font-size: 13px;
}

/* SEND BUTTON */
#ai-send {
    background: linear-gradient(to right, #1e3c72, #2a5298);
    border: none;
    margin-left: 8px;
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    transition: .2s;
}

#ai-send:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}

/* ============ HEATMAP LEGEND ============ */
.heatmap-legend {
    position: absolute;
    bottom: 30px;
    right: 20px;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 12px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    font-size: 12px;
    width: 140px;
}

.heatmap-legend-title {
    font-weight: bold;
    margin-bottom: 6px;
    text-align: center;
}

.legend-gradient {
    height: 14px;
    border-radius: 10px;
    background: linear-gradient(to right,
            rgba(0, 255, 255, 0),
            blue,
            cyan,
            lime,
            yellow,
            orange,
            red,
            darkred);
    margin-bottom: 6px;
}

.legend-labels {
    display: flex;
    justify-content: space-between;
}

/* ============ PROFESSIONAL LAYER SWITCHER ============ */
.layer-switcher {
    position: absolute;
    top: 90px;
    right: 20px;
    z-index: 1000;
    width: 220px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    font-family: "Segoe UI", sans-serif;
    transition: all 0.3s ease;
}

.ls-header {
    background: linear-gradient(to right, #1e3c72, #2a5298);
    color: white;
    font-weight: 600;
    padding: 10px 14px;
    font-size: 13px;
}

.ls-header i {
    color: #ffcc00;
    margin-right: 6px;
}

/* Each option */
.ls-option {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: 0.2s;
}

.ls-option:last-child {
    border-bottom: none;
}

.ls-option:hover {
    background: #f5f7ff;
}

/* Hide default radio */
.ls-option input {
    display: none;
}

/* Custom radio button */
.ls-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #1e3c72;
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
    transition: .2s;
}

/* When checked */
.ls-option input:checked+.ls-custom {
    background: #1e3c72;
}

.ls-option input:checked+.ls-custom:after {
    content: "";
    width: 8px;
    height: 8px;
    background: #ffcc00;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
}

/* Text */
.ls-text {
    font-size: 13px;
    font-weight: 600;
    color: #1e3c72;
}

.ls-text i {
    margin-right: 6px;
    color: #2a5298;
}

/* Basemap switcher hide/show */
.layer-switcher.hidden {
    transform: translateX(120%);
    opacity: 0;
}

/* Floating toggle button */
.basemap-toggle {
    position: absolute;
    top: 90px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #1e3c72;
    color: white;
    border: none;
    border-radius: 50%;
    z-index: 1100;
    box-shadow: 0 4px 10px rgba(0,0,0,.3);
    cursor: pointer;
}