/* Styling untuk halaman home dengan grafik */

/* Dashboard Grafik */
.summary-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.summary-card .card-title {
    color: #2c3e50;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Filter Waktu */
.time-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.time-filter .btn {
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.time-filter .btn.active {
    background-color: #3498db;
    border-color: #3498db;
    color: white;
}

.time-filter .btn:hover:not(.active) {
    background-color: #e3f2fd;
    border-color: #3498db;
}

.last-update {
    font-size: 0.9rem;
}

/* Kartu Grafik */
.chart-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.chart-title {
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Warna untuk grafik */
.chart-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

/* Peta dan Kontrol */
.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eaeaea;
}

.map-controls {
    display: flex;
    gap: 10px;
}

#map {
    border-radius: 0 0 10px 10px;
}

/* Popup Kustom */
.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
    margin: 0;
    width: 320px !important;
}

.location-popup .carousel-item img {
    border-radius: 8px 8px 0 0;
    height: 180px;
    object-fit: cover;
}

.location-popup .card-body {
    padding: 15px;
}

.location-popup .card-title {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.data-item {
    text-align: center;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.data-label {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-bottom: 3px;
}

.data-value {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-remote {
    background-color: #2ecc71;
}

.status-local {
    background-color: #e74c3c;
}

/* Footer */
.footer {
    background-color: #f8f9fa;
    padding: 15px 0;
    margin-top: 20px;
}

#last-update-time {
    font-size: 0.85rem;
    color: #95a5a6;
}

/* Animasi */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Loading State */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #7f8c8d;
}

.chart-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsif */
@media (max-width: 768px) {
    .time-filter {
        justify-content: center;
        margin-bottom: 15px;
    }
    
    .last-update {
        text-align: center;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .map-controls {
        flex-direction: column;
        width: 100%;
        margin-top: 10px;
    }
    
    .map-controls .btn {
        width: 100%;
    }
    
    .leaflet-popup-content {
        width: 280px !important;
    }
    
    .data-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .chart-card {
        padding: 15px;
    }
    
    .chart-container {
        height: 220px;
    }
}

/* Popup Minimalis */
.minimal-popup {
    width: 260px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eaeaea;
}

.popup-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.popup-time {
    font-size: 0.75rem;
    color: #95a5a6;
}

/* Carousel Minimalis */
.minimal-carousel {
    margin-bottom: 12px;
}

.minimal-carousel .carousel-inner {
    border-radius: 6px;
    overflow: hidden;
    height: 120px;
}

.minimal-carousel .carousel-item img {
    height: 120px;
    object-fit: cover;
}

.minimal-carousel .carousel-indicators {
    margin-bottom: 5px;
}

.minimal-carousel .carousel-indicators button {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin: 0 2px;
}

.minimal-carousel .carousel-control-prev,
.minimal-carousel .carousel-control-next {
    width: 25px;
    height: 25px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.3);
    border-radius: 50%;
}

.minimal-carousel .carousel-control-prev {
    left: 5px;
}

.minimal-carousel .carousel-control-next {
    right: 5px;
}

.minimal-carousel .carousel-control-prev-icon,
.minimal-carousel .carousel-control-next-icon {
    width: 12px;
    height: 12px;
}

/* Data Grid Minimalis */
.popup-data {
    font-size: 0.85rem;
}

.data-row {
    display: flex;
    margin-bottom: 6px;
}

.data-item {
    flex: 1;
    padding: 4px 6px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin: 0 2px;
    text-align: center;
}

.data-item.full-width {
    flex: 0 0 100%;
    margin: 0;
}

.data-label {
    font-size: 0.7rem;
    color: #7f8c8d;
    margin-bottom: 2px;
}

.data-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: #2c3e50;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.status-remote {
    background-color: #2ecc71;
}

.status-local {
    background-color: #e74c3c;
}

/* Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    padding: 0;
}

.leaflet-popup-content {
    margin: 12px;
    width: auto !important;
    line-height: 1.4;
}

.leaflet-popup-tip {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Styling untuk container gambar CCTV */
.cctv-image-container {
    position: relative;
    cursor: pointer;
}

.cctv-image {
    transition: opacity 0.3s ease;
}

.cctv-image:hover {
    opacity: 0.8;
}

.cctv-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cctv-image-container:hover .cctv-overlay {
    opacity: 1;
}

.cctv-view-btn {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    background: rgba(255, 255, 255, 0.9);
    border: none;
}

.cctv-view-btn:hover {
    background: white;
}

.cctv-view-btn i {
    margin-right: 3px;
}

/* Modal Styling */
#cctv-image-modal .modal-content {
    border-radius: 10px;
}

#cctv-image-modal .modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

#cctv-image-modal .modal-title {
    font-weight: 600;
    color: #2c3e50;
}

#modal-cctv-image {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Popup Minimalis */
.minimal-popup {
    width: 260px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eaeaea;
}

.popup-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.popup-time {
    font-size: 0.75rem;
    color: #95a5a6;
}

/* Carousel Minimalis */
.minimal-carousel {
    margin-bottom: 12px;
}

.minimal-carousel .carousel-inner {
    border-radius: 6px;
    overflow: hidden;
    height: 120px;
}

.minimal-carousel .carousel-item img {
    height: 120px;
    object-fit: cover;
}

.minimal-carousel .carousel-indicators {
    margin-bottom: 5px;
}

.minimal-carousel .carousel-indicators button {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin: 0 2px;
}

.minimal-carousel .carousel-control-prev,
.minimal-carousel .carousel-control-next {
    width: 25px;
    height: 25px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.3);
    border-radius: 50%;
}

.minimal-carousel .carousel-control-prev {
    left: 5px;
}

.minimal-carousel .carousel-control-next {
    right: 5px;
}

.minimal-carousel .carousel-control-prev-icon,
.minimal-carousel .carousel-control-next-icon {
    width: 12px;
    height: 12px;
}

/* Data Grid Minimalis */
.popup-data {
    font-size: 0.85rem;
}

.data-row {
    display: flex;
    margin-bottom: 6px;
}

.data-item {
    flex: 1;
    padding: 4px 6px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin: 0 2px;
    text-align: center;
}

.data-item.full-width {
    flex: 0 0 100%;
    margin: 0;
}

.data-label {
    font-size: 0.7rem;
    color: #7f8c8d;
    margin-bottom: 2px;
}

.data-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: #2c3e50;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.status-remote {
    background-color: #2ecc71;
}

.status-local {
    background-color: #e74c3c;
}

/* Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    padding: 0;
}

.leaflet-popup-content {
    margin: 12px;
    width: auto !important;
    line-height: 1.4;
}

.leaflet-popup-tip {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
/* Tambahkan di home.css */
.custom-marker.offline {
    background: #95a5a6;
    opacity: 0.7;
}

.popup-time.text-danger {
    color: #e74c3c !important;
    font-weight: 600;
}