/*
|--------------------------------------------------------------------------
| Sistem Informasi Jalan Gunung Kidul - Custom Styles
|--------------------------------------------------------------------------
*/

:root {
    /* Color Palette - Gunung Kidul Natural Theme */
    --primary: #1e7e34;
    --primary-dark: #155724;
    --primary-light: #28a745;
    --secondary: #2c5aa0;
    --secondary-dark: #1e3d6b;
    --accent: #17a2b8;
    
    /* Kondisi Colors */
    --kondisi-baik: #28a745;
    --kondisi-sedang: #ffc107;
    --kondisi-rusak-ringan: #fd7e14;
    --kondisi-rusak-berat: #dc3545;
    
    /* Neutral Colors */
    --dark: #1a1a2e;
    --gray-900: #212529;
    --gray-800: #343a40;
    --gray-700: #495057;
    --gray-600: #6c757d;
    --gray-500: #adb5bd;
    --gray-400: #ced4da;
    --gray-300: #dee2e6;
    --gray-200: #e9ecef;
    --gray-100: #f8f9fa;
    --white: #ffffff;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #1e7e34 0%, #28a745 100%);
    --gradient-secondary: linear-gradient(135deg, #2c5aa0 0%, #4a90d9 100%);
    --gradient-hero: linear-gradient(135deg, rgba(30, 126, 52, 0.95) 0%, rgba(44, 90, 160, 0.95) 100%);
    
    /* Typography */
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Spacing */
    --header-height: 70px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.15);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-100);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   HEADER STYLES
   ============================================ */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--white);
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 46px;
    height: 46px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 22px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--gray-600);
    font-weight: 500;
}

.main-nav {
    display: flex;
    align-items: center;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-700);
    cursor: pointer;
    padding: 8px;
}

.nav-list {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--gray-700);
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.nav-link.active {
    background: var(--gradient-primary);
    color: var(--white);
}

.nav-link i {
    font-size: 18px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-top: var(--header-height);
    flex: 1;
    min-height: calc(100vh - var(--header-height) - 200px);
}

/* Page Container */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--gray-600);
    font-size: 15px;
}

/* ============================================
   HERO SECTION (Beranda)
   ============================================ */
.hero-section {
    background: var(--gradient-hero), url('/images/gunungkidul-bg.jpg') center/cover;
    padding: 80px 24px;
    color: var(--white);
    text-align: center;
    position: relative;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 32px;
    line-height: 1.7;
}

/* ============================================
   STAT CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: var(--white);
}

.stat-icon.primary { background: var(--gradient-primary); }
.stat-icon.secondary { background: var(--gradient-secondary); }
.stat-icon.baik { background: var(--kondisi-baik); }
.stat-icon.sedang { background: var(--kondisi-sedang); }
.stat-icon.rusak-ringan { background: var(--kondisi-rusak-ringan); }
.stat-icon.rusak-berat { background: var(--kondisi-rusak-berat); }

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   MAP STYLES
   ============================================ */
.map-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.map-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.map-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 10px;
}

.map-title i {
    color: var(--primary);
}

.map-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-family);
    color: var(--gray-700);
    background: var(--white);
    min-width: 180px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

#map {
    height: 500px;
    width: 100%;
}

#map-full {
    height: calc(100vh - var(--header-height) - 80px);
    width: 100%;
}

.map-legend {
    padding: 16px 24px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-700);
}

.legend-color {
    width: 20px;
    height: 4px;
    border-radius: 2px;
}

.legend-color.baik { background: var(--kondisi-baik); }
.legend-color.sedang { background: var(--kondisi-sedang); }
.legend-color.rusak-ringan { background: var(--kondisi-rusak-ringan); }
.legend-color.rusak-berat { background: var(--kondisi-rusak-berat); }

/* Leaflet Custom Styles */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
    margin: 16px;
    font-family: var(--font-family);
}

.popup-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
}

.popup-info {
    font-size: 13px;
    color: var(--gray-700);
}

.popup-info p {
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.popup-info strong {
    color: var(--gray-900);
}

/* ============================================
   TABLE STYLES
   ============================================ */
.table-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.table-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-title i {
    color: var(--primary);
}

.table-body {
    padding: 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    background: var(--gray-100);
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
}

.data-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 14px;
    color: var(--gray-800);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

/* DataTables Override */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 14px;
    font-family: var(--font-family);
}

.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: var(--primary);
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-family: var(--font-family);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--radius-sm) !important;
    margin: 0 3px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: var(--white) !important;
}

/* ============================================
   CHART STYLES
   ============================================ */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.chart-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.chart-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.chart-body {
    padding: 24px;
}

.chart-body canvas {
    max-height: 350px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-info {
    background: var(--accent);
    color: var(--white);
}

/* ============================================
   FOOTER
   ============================================ */
.main-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 48px 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-logo {
    width: 46px;
    height: 46px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--white);
}

.footer-brand h4 {
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
}

.footer-brand p {
    font-size: 13px;
}

.footer-desc {
    font-size: 14px;
    line-height: 1.7;
    max-width: 400px;
}

.footer-links h5,
.footer-contact h5 {
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links ul li a {
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-links ul li a:hover {
    color: var(--primary-light);
}

.footer-contact ul li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 14px;
}

.footer-contact ul li i {
    color: var(--primary-light);
    margin-top: 2px;
}

.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding: 20px 24px;
    text-align: center;
    font-size: 13px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-list {
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 16px;
        box-shadow: var(--shadow-lg);
        display: none;
    }
    
    .nav-list.show {
        display: flex;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .map-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .map-filters {
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
    }
    
    #map, #map-full {
        height: 400px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
