/**
 * Etalase Dynamic Dataset - Styles
 * Comprehensive styling for statistics, maps, and charts
 */

/* ============================================
   STATISTICS CARDS STYLE
   ============================================ */

.etalase-stats-wrapper {
    margin: 40px 0;
}

.stats-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
}

.stat-card {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, #FFD700 0%, #FFA500 100%);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.stat-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.stat-icon svg {
    width: 30px;
    height: 30px;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 36px;
    font-weight: 900;
    color: #1a1a1a;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Specific card colors */
.stat-card.umkm-premium::before {
    background: linear-gradient(180deg, #FF6B6B 0%, #EE5A6F 100%);
}

.stat-card.umkm-premium .stat-icon {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%);
}

.stat-card.berita-total::before {
    background: linear-gradient(180deg, #4ECDC4 0%, #44A08D 100%);
}

.stat-card.berita-total .stat-icon {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
}

.stat-card.kategori-total::before {
    background: linear-gradient(180deg, #9370DB 0%, #6A5ACD 100%);
}

.stat-card.kategori-total .stat-icon {
    background: linear-gradient(135deg, #9370DB 0%, #6A5ACD 100%);
}

.stat-card.lokasi-total::before {
    background: linear-gradient(180deg, #20B2AA 0%, #008B8B 100%);
}

.stat-card.lokasi-total .stat-icon {
    background: linear-gradient(135deg, #20B2AA 0%, #008B8B 100%);
}

.stat-card.last-update::before {
    background: linear-gradient(180deg, #778899 0%, #696969 100%);
}

.stat-card.last-update .stat-icon {
    background: linear-gradient(135deg, #778899 0%, #696969 100%);
}

/* ============================================
   STATISTICS MINIMAL STYLE
   ============================================ */

.stats-minimal {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 30px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    flex-wrap: wrap;
}

.stat-minimal-item {
    text-align: center;
}

.stat-minimal-value {
    display: block;
    font-size: 42px;
    font-weight: 900;
    color: #FFD700;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-minimal-label {
    display: block;
    font-size: 13px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
}

.stat-minimal-divider {
    width: 2px;
    height: 60px;
    background: #e0e0e0;
}

/* ============================================
   STATISTICS DETAILED STYLE
   ============================================ */

.stats-detailed {
    background: #fff;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.stats-detailed-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #FFD700;
}

.stats-detailed-header h3 {
    font-size: 28px;
    font-weight: 900;
    color: #1a1a1a;
    margin: 0 0 10px;
}

.stats-detailed-header p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.stats-detailed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.stat-detailed-item {
    display: flex;
    gap: 20px;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stat-detailed-item:hover {
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.stat-detailed-icon {
    font-size: 48px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.stat-detailed-icon.umkm {
    background: rgba(255, 215, 0, 0.2);
}

.stat-detailed-icon.premium {
    background: rgba(255, 107, 107, 0.2);
}

.stat-detailed-icon.berita {
    background: rgba(78, 205, 196, 0.2);
}

.stat-detailed-icon.kategori {
    background: rgba(147, 112, 219, 0.2);
}

.stat-detailed-info {
    flex: 1;
}

.stat-detailed-value {
    font-size: 36px;
    font-weight: 900;
    color: #1a1a1a;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-detailed-label {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-detailed-desc {
    font-size: 13px;
    color: #999;
    line-height: 1.4;
}

.stats-detailed-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    color: #666;
    font-size: 14px;
}

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

.etalase-map-wrapper {
    margin: 40px 0;
}

.map-filters {
    background: #fff;
    padding: 25px;
    border-radius: 15px 15px 0 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.map-filter-header h4 {
    margin: 0 0 15px;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.map-filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.map-filter-btn {
    padding: 10px 20px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-filter-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.map-filter-btn.active {
    background: #FFD700;
    border-color: #FFA500;
    color: #333;
}

.map-filter-btn.premium-filter.active {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%);
    color: #fff;
}

.filter-count {
    font-size: 12px;
    opacity: 0.7;
}

.map-stats-bar {
    background: #f9f9f9;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #FFD700;
}

.map-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-stat-icon {
    font-size: 20px;
}

.map-stat-value {
    font-size: 22px;
    font-weight: 900;
    color: #FFD700;
}

.map-stat-label {
    font-size: 13px;
    color: #666;
}

.map-controls {
    display: flex;
    gap: 10px;
}

.map-control-btn {
    width: 40px;
    height: 40px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-control-btn:hover {
    background: #FFD700;
    border-color: #FFD700;
    transform: scale(1.1);
}

.map-control-btn svg {
    width: 20px;
    height: 20px;
}

.etalase-map {
    position: relative;
    background: #f0f0f0;
    border-radius: 0 0 15px 15px;
    overflow: hidden;
}

.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
}

.map-loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.map-legend {
    background: #fff;
    padding: 15px 25px;
    border-radius: 0 0 15px 15px;
    display: flex;
    gap: 20px;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.map-legend-title {
    font-weight: 700;
    color: #333;
    font-size: 14px;
}

.map-legend-items {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.map-legend-marker {
    font-size: 18px;
}

/* Custom Leaflet Marker Styles */
.custom-marker {
    background: none !important;
    border: none !important;
}

.marker-icon {
    font-size: 32px;
    display: block;
    text-align: center;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Custom Popup Styles */
.custom-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
}

.marker-popup {
    width: 280px;
}

.popup-image {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-premium-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 107, 107, 0.95);
    color: #fff;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 700;
}

.popup-content {
    padding: 15px;
}

.popup-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px;
}

.popup-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin: 0 0 12px;
}

.popup-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.popup-category,
.popup-location {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    background: #f0f0f0;
    color: #666;
}

.popup-category {
    background: #FFD700;
    color: #333;
    font-weight: 600;
}

.popup-actions {
    display: flex;
    gap: 8px;
}

.popup-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.view-btn {
    background: #333;
    color: #fff;
}

.view-btn:hover {
    background: #000;
}

.wa-btn {
    background: #25D366;
    color: #fff;
}

.wa-btn:hover {
    background: #1fb855;
}

/* ============================================
   CHART STYLES
   ============================================ */

.etalase-charts-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 40px;
    margin: 40px 0;
}

.chart-container {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.chart-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 3px solid #FFD700;
}

.chart-title {
    font-size: 22px;
    font-weight: 900;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.chart-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.chart-canvas-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.chart-footer {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.chart-toggle-btn {
    padding: 6px 12px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 6;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-toggle-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.chart-toggle-btn.active {
    background: #FFD700;
    border-color: #FFA500;
    color: #333;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .stats-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 20px;
    }
    
    .etalase-charts-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .stats-detailed-grid {
        grid-template-columns: 1fr;
    }
    
    .map-stats-bar {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .etalase-map {
        height: 400px !important;
    }
    
    .chart-container {
        padding: 20px;
    }
    
    .etalase-charts-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .map-filter-buttons {
        flex-direction: column;
    }
    
    .map-filter-btn {
        width: 100%;
        text-align: center;
    }
    
    .stats-minimal {
        flex-direction: column;
    }
    
    .stat-minimal-divider {
        width: 100px;
        height: 2px;
    }
}
