/**
 * Dashboard Enhanced CSS
 * Styling untuk semua komponen dashboard MBG Papua
 */

/* ===================================
   KPI Cards
   =================================== */
.kpi-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--kpi-color-1), var(--kpi-color-2));
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.kpi-card.kpi-primary {
    --kpi-color-1: #667eea;
    --kpi-color-2: #764ba2;
}

.kpi-card.kpi-success {
    --kpi-color-1: #2ecc71;
    --kpi-color-2: #27ae60;
}

.kpi-card.kpi-info {
    --kpi-color-1: #3498db;
    --kpi-color-2: #2980b9;
}

.kpi-card.kpi-warning {
    --kpi-color-1: #f39c12;
    --kpi-color-2: #e67e22;
}

.kpi-card.kpi-danger {
    --kpi-color-1: #e74c3c;
    --kpi-color-2: #c0392b;
}

.kpi-card.kpi-purple {
    --kpi-color-1: #9b59b6;
    --kpi-color-2: #8e44ad;
}

.kpi-card.kpi-orange {
    --kpi-color-1: #ff6b6b;
    --kpi-color-2: #ee5a6f;
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--kpi-color-1), var(--kpi-color-2));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kpi-icon i {
    font-size: 1.5rem;
    color: #fff;
}

.kpi-content {
    flex: 1;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.875rem;
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===================================
   Map Markers
   =================================== */
.custom-marker {
    background: transparent;
    border: none;
}

.marker-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border: 3px solid #fff;
    transition: all 0.3s ease;
}

.marker-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.marker-sekolah {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.marker-sppg {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.marker-supplier {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.marker-klb {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    animation: pulse-klb 2s infinite;
}

@keyframes pulse-klb {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(231, 76, 60, 0.8);
    }
}

.marker-popup {
    min-width: 200px;
}

.marker-popup h6 {
    margin-bottom: 0.75rem;
    color: #2c3e50;
    font-weight: 600;
    font-size: 1rem;
}

.marker-popup p {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #7f8c8d;
}

.marker-popup p:last-child {
    margin-bottom: 0;
}

.marker-popup strong {
    color: #34495e;
    font-weight: 600;
}

/* Marker Clusters */
.marker-cluster-custom {
    background: transparent;
    border: none;
}

.marker-cluster {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border: 3px solid #fff;
}

.marker-cluster-sekolah {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.marker-cluster-sppg {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.marker-cluster-supplier {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.marker-cluster-klb {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* ===================================
   Alert Panel
   =================================== */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.alert-danger {
    background: linear-gradient(135deg, #fff5f5, #ffe5e5);
    color: #c0392b;
    border-left: 4px solid #e74c3c;
}

.alert-warning {
    background: linear-gradient(135deg, #fffbf0, #fff3cd);
    color: #d68910;
    border-left: 4px solid #f39c12;
}

.alert-success {
    background: linear-gradient(135deg, #f0fff4, #d4edda);
    color: #27ae60;
    border-left: 4px solid #2ecc71;
}

.alert-info {
    background: linear-gradient(135deg, #f0f9ff, #d1ecf1);
    color: #2980b9;
    border-left: 4px solid #3498db;
}

.alert i {
    font-size: 1.25rem;
}

.alert strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.alert p {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.alert small {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ===================================
   Timeline (Agenda)
   =================================== */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #e0e0e0, #f5f5f5);
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 3px solid #fff;
    z-index: 1;
}

.timeline-success .timeline-marker {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.timeline-primary .timeline-marker {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.timeline-warning .timeline-marker {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.timeline-default .timeline-marker {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.timeline-content {
    background: #fff;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-left: 1.5rem;
}

.timeline-time {
    font-size: 0.75rem;
    color: #7f8c8d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.timeline-description {
    font-size: 0.875rem;
    color: #7f8c8d;
    margin-bottom: 0;
}

/* ===================================
   Cards
   =================================== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2c3e50;
}

.card-title i {
    margin-right: 0.5rem;
    color: #667eea;
}

.card-body {
    padding: 1.5rem;
}

/* ===================================
   Page Header
   =================================== */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: 0;
}

/* ===================================
   Map Container
   =================================== */
#map {
    border-radius: 0 0 12px 12px;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-tip {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===================================
   Chart Containers
   =================================== */
canvas {
    max-height: 300px;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 768px) {
    .kpi-value {
        font-size: 1.5rem;
    }
    
    .kpi-icon {
        width: 50px;
        height: 50px;
    }
    
    .kpi-icon i {
        font-size: 1.25rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .timeline-content {
        margin-left: 1rem;
    }
}

/* ===================================
   Loading States
   =================================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================================
   Utilities
   =================================== */
.text-muted {
    color: #7f8c8d !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.g-4 {
    gap: 1.5rem;
}
