body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: Arial, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
}

/* Modal styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-container {
    background-color: #1e1e1e;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    width: 95%;
    max-width: 1200px;
    max-height: 90%;
    overflow-y: auto;
    padding: 0;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    background-color: #212121;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.4em;
    color: #e0e0e0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-content {
    padding: 15px;
}

.modal-open {
    overflow: hidden;
}

/* Two-column layout for modal */
.modal-body {
    display: flex;
    height: calc(100% - 56px); /* Header height */
}

.modal-left-column {
    flex: 3;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
    overflow-y: auto;
}

.modal-right-column {
    flex: 1;
    min-width: 320px;
    max-width: 380px;
    display: flex;
    flex-direction: column;
}

/* Charts section */
.modal-charts {
    padding: 0 15px 15px 15px;
}

.chart-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.chart-tab {
    padding: 8px 16px;
    background-color: #333;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #e0e0e0;
}

.chart-tab.active {
    background-color: #119dae;
    color: white;
}

.ai-efficiency-toggle {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    background-color: #2a2a2a;
    padding: 10px 12px;
    border-radius: 4px;
    border: 1px solid #444;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

.ai-efficiency-toggle:hover {
    background-color: #333;
}

.ai-efficiency-toggle.active {
    background-color: #2a2a2a;
    border-color: #fac31c;
    box-shadow: 0 1px 3px rgba(250, 195, 28, 0.3);
}

.ai-efficiency-toggle .toggle-label {
    font-size: 0.9em;
    color: #e0e0e0;
    font-weight: 500;
    margin-left: 10px;
    flex-grow: 1;
}

/* Toggle Switch Styling */
.ai-efficiency-toggle .switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 10px;
}

.ai-efficiency-toggle .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ai-efficiency-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: .4s;
    border-radius: 24px;
}

.ai-efficiency-toggle .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.ai-efficiency-toggle input:checked + .slider {
    background-color: #fac31c;
}

.ai-efficiency-toggle input:focus + .slider {
    box-shadow: 0 0 1px #fac31c;
}

.ai-efficiency-toggle input:checked + .slider:before {
    transform: translateX(26px);
}

.chart-container {
    width: 100%;
    height: 280px;
    position: relative;
}

/* Modal chat section */
.modal-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.modal-chat-header {
    padding: 10px 15px;
    background-color: #212121;
    border-bottom: 1px solid #333;
}

.modal-chat-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #e0e0e0;
    display: flex;
    align-items: center;
}

.modal-chat-header h3 i {
    margin-right: 8px;
    color: #119dae;
}

.modal-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    background-color: #242424;
}

.modal-chat-input {
    display: flex;
    padding: 10px;
    background-color: #212121;
    border-top: 1px solid #333;
}

#modal-user-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #444;
    border-radius: 20px;
    outline: none;
    margin-right: 10px;
    background-color: #333;
    color: #e0e0e0;
}

#modal-send-button {
    background-color: #e32553;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-send-button:hover {
    background-color: #c01f46;
}

/* Detailed mosque info in modal */
.mosque-details {
    font-family: Arial, sans-serif;
}

/* Card-based layout for details */
.detail-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.detail-card {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 12px;
    flex: 1;
    min-width: 120px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-card h3 {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    color: #ccc;
    font-weight: 600;
}

.rating-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.occupancy-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #119dae;
    margin-bottom: 8px;
}

.key-stat {
    font-size: 0.85em;
    color: #bbb;
    margin-top: auto;
    white-space: nowrap;
}

.key-stat i {
    margin-right: 5px;
    color: #119dae;
}

/* Mosque popup styling */
.mosque-popup {
    font-family: Arial, sans-serif;
    min-width: 250px;
    background-color: #1e1e1e;
    color: #e0e0e0;
}

.mosque-popup h3 {
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #444;
}

.mosque-popup .details-button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin-top: 10px;
    background-color: #119dae;
    color: white;
    border: none;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mosque-popup .details-button:hover {
    background-color: #0e8491;
}

.mosque-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat {
    display: flex;
    flex-direction: column;
    padding-left: 24px;
    position: relative;
}

.stat i {
    position: absolute;
    left: 0;
    top: 2px;
    color: #119dae;
}

.stat span {
    margin-bottom: 2px;
}

.correlation-note {
    margin-top: 8px;
    padding: 6px 8px;
    background-color: #2a2a2a;
    border-radius: 4px;
    border-left: 3px solid #fac31c;
    font-size: 0.9em;
    display: flex;
    align-items: center;
}

.correlation-note i {
    color: #fac31c;
    margin-right: 8px;
}

/* Override default popup styles */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    padding: 0;
    background-color: #1e1e1e;
}

.leaflet-popup-content {
    margin: 12px;
    color: #e0e0e0;
}

.leaflet-popup-close-button {
    top: 15px !important;
    right: 8px !important;
    color: #999 !important;
}

.leaflet-popup-tip {
    background-color: #1e1e1e;
}

.leaflet-layer,
.leaflet-control-zoom-in,
.leaflet-control-zoom-out,
.leaflet-control-attribution {
  filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(70%);
}

/* Custom mosque marker styling */
.custom-mosque-marker {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    transition: transform 0.2s;
}

.custom-mosque-marker:hover {
    transform: scale(1.1);
    z-index: 1000 !important;
}

.sparkle {
    position: absolute;
    top: -5px;
    right: -5px;
    animation: sparkle-animation 1.5s infinite;
    filter: drop-shadow(0 0 2px rgb(255, 255, 255));
}

@keyframes sparkle-animation {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* Add a legend for the map */
.efficiency-legend {
    background: #212121;
    color: #e0e0e0;
    padding: 8px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    line-height: 1.3;
    max-width: 280px;
    font-size: 0.9em;
}

.container {
    display: flex;
    width: 100%;
    height: 100vh;
}

#map {
    flex: 3;
    height: 100%;
}

#chatbot-container {
    flex: 1;
    height: 100%;
    min-width: 300px;
    max-width: 400px;
    border-left: 1px solid #333;
    background-color: #1e1e1e;
    display: flex;
    flex-direction: column;
}

.chat-header {
    background-color: #e32553;
    color: white;
    padding: 15px;
    font-weight: bold;
    font-size: 18px;
    border-bottom: 1px solid #c01f46;
    display: flex;
    align-items: center;
}

.chat-header i:not(.settings-icon) {
    margin-right: 8px;
}

.settings-icon {
    margin-left: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.settings-icon:hover {
    transform: rotate(90deg);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    background-color: #242424;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.bot-message {
    background-color: #1a353a;
    border: 1px solid #119dae;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    color: #e0e0e0;
}

.user-message {
    background-color: #3a1a24;
    border: 1px solid #e32553;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    color: #e0e0e0;
}

.chat-input {
    display: flex;
    padding: 10px;
    background-color: #212121;
    border-top: 1px solid #333;
}

#user-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #444;
    border-radius: 20px;
    outline: none;
    margin-right: 10px;
    background-color: #333;
    color: #e0e0e0;
}

#send-button {
    background-color: #e32553;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

#send-button:hover {
    background-color: #c01f46;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    #map {
        flex: 1;
        height: 60vh;
    }
    
    #chatbot-container {
        flex: 1;
        width: 100%;
        max-width: 100%;
        height: 40vh;
        border-left: none;
        border-top: 1px solid #333;
    }
}