@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    overflow: hidden;
    display: flex;
}

.sidebar {
    width: 350px;
    height: 100vh;
    background-color: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    z-index: 1001;
    flex-shrink: 0;
    transition: margin-left 0.3s ease;
}

.sidebar-header {
    flex-shrink: 0;
    z-index: 10;
}

.search-container {
    padding: 15px;
    background-color: #2c3e50;
    border-bottom: 1px solid #34495e;
}

#search-box {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #4a627a;
    border-radius: 5px;
    box-sizing: border-box;
    background-color: #34495e;
    color: #ecf0f1;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
}

#search-box::placeholder {
  color: #bdc3c7;
}

.status-summary {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 15px;
    font-size: 14px;
    background-color: #2c3e50;
    border-bottom: 1px solid #34495e;
}

.status-summary span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-summary strong {
    font-weight: 600;
    font-size: 16px;
}

#cctv-list-container {
    flex-grow: 1;
    overflow-y: auto;
    min-height: 0;
}

.area-header {
    background-color: #3498db;
    color: white;
    padding: 10px 15px;
    font-weight: 600;
    margin: 10px 10px 0 10px;
    border-radius: 4px;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 5;
}

.cctv-item {
    padding: 12px 15px;
    margin: 0 10px;
    cursor: pointer;
    border-bottom: 1px solid #34495e;
    transition: background-color 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cctv-item:hover {
    background-color: #34495e;
}

.status-led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}

.led-grey {
    background-color: #6c757d;
}

.led-green {
    background-color: #28a745;
}

.led-red {
    background-color: #dc3545;
}

.main-container {
    flex-grow: 1;
    height: 100vh;
    position: relative;
    transition: margin-left 0.3s ease;
}

#map {
    width: 100%;
    height: 100%;
}

.logo-container {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

.logo-container img {
    width: 150px;
    height: auto;
}

#cctv-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

/* PERUBAHAN CSS DI SINI */
.modal-content {
    background-color: #fefefe;
    padding: 20px;
    border-radius: 8px;
    position: relative;
    /* Menghapus width dan max-width agar bisa diatur JS */
    max-width: 90vw; /* Batas aman lebar viewport */
    max-height: 90vh; /* Batas aman tinggi viewport */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: center;
    /* Menambahkan transisi agar perubahan ukuran lebih mulus */
    transition: max-width 0.3s ease-in-out;
}

/* PERUBAHAN CSS DI SINI */
#cctv-feed {
    width: 100%;
    height: auto;
    max-height: 80vh; /* Batas tinggi video agar tidak memenuhi layar */
    display: block;
    margin-top: 15px;
    /* Menghapus background-color untuk menghilangkan pilar hitam */
}

#modal-cctv-title { color: #333; margin-top: 0; }

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #aaa;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover, .close:focus { color: #333; text-decoration: none; }

.loading-text { display: none; }

.leaflet-popup-content { text-align: center; }
.popup-content h4 { margin: 0 0 10px 0; font-size: 16px; }
.popup-button { padding: 6px 12px; font-size: 14px; background-color: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer; }
.popup-button:hover { background-color: #0056b3; }

#sidebar-toggle {
    position: absolute;
    top: 80px;
    left: 10px;
    z-index: 1001;
    background-color: white;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    font-size: 20px;
    line-height: 1;
    transition: left 0.3s ease;
}

.sidebar.collapsed {
    margin-left: -350px;
}

.modal-coords {
    font-size: 14px;
    font-weight: 400;
    color: #6c757d;
    margin-top: 5px;
    margin-bottom: 0;
}
