/* ====================================
   DisasterWatch GIS - Main Stylesheet
   Modern, Elegant, dan Responsive
   ==================================== */

/* Import Font Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* Root Variables */
:root {
    --primary: #dc3545;
    --secondary: #0066cc;
    --danger: #ff4444;
    --warning: #ffc107;
    --success: #28a745;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #2c3e50;
    --gray: #6c757d;
    --shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    letter-spacing: -0.5px;
}

h1 {
    font-size: 2.5rem;
    color: #2c3e50;
}

h2 {
    font-size: 2rem;
    color: #2c3e50;
}

h3 {
    font-size: 1.5rem;
    color: #2c3e50;
}

p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.8;
}

a {
    transition: all 0.3s ease;
}

a:hover {
    text-decoration: none;
}

/* Buttons */
.btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #c82333 0%, #b01828 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003d7a 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: white;
}

.btn-outline-primary {
    border: 2px solid #dc3545;
    color: #dc3545;
}

.btn-outline-primary:hover {
    background-color: #dc3545;
    color: white;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    background: white;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    border-radius: 12px 12px 0 0;
    padding: 20px;
}

.card-body {
    padding: 25px;
}

/* Stat Card */
.stat-card {
    border-radius: 12px;
    padding: 30px;
    background: white;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    text-align: center;
    border-left: 5px solid #dc3545;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.stat-card.danger {
    border-left-color: #dc3545;
}

.stat-card.warning {
    border-left-color: #ffc107;
}

.stat-card.success {
    border-left-color: #28a745;
}

.stat-card.info {
    border-left-color: #17a2b8;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #dc3545;
    margin: 10px 0;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -100px;
    right: -100px;
}

.hero::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    bottom: -50px;
    left: -50px;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 40px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.hero-cta {
    display: inline-flex;
    gap: 20px;
}

/* Badge */
.badge-custom {
    display: inline-block;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #dc3545;
    margin: 0 5px;
}

.badge-danger {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.badge-warning {
    background: rgba(255, 193, 7, 0.15);
    color: #856404;
}

.badge-success {
    background: rgba(40, 167, 69, 0.15);
    color: #155724;
}

.badge-info {
    background: rgba(23, 162, 184, 0.15);
    color: #0c5460;
}

/* Badge Status */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-normal {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.status-waspada {
    background: rgba(255, 193, 7, 0.2);
    color: #ff9800;
}

.status-siaga {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

/* Input Groups */
.form-control, .form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 15px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Search Bar */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 40px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* Table Styling */
.table {
    border-collapse: collapse;
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    padding: 15px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody td {
    border: 1px solid #f0f0f0;
    padding: 15px;
    vertical-align: middle;
    font-size: 0.95rem;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
}

/* Filter & Sidebar */
.filter-sidebar {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 80px;
}

.filter-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #dc3545;
}

.filter-option label {
    cursor: pointer;
    margin-bottom: 0;
    font-size: 0.95rem;
    color: #555;
}

.filter-option:hover label {
    color: #dc3545;
    font-weight: 600;
}

/* Map Container */
#map {
    width: 100%;
    height: 600px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.leaflet-popup-content {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    #map {
        height: 400px;
    }

    .stat-card {
        margin-bottom: 20px;
    }

    .filter-sidebar {
        margin-bottom: 30px;
        position: static;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .table {
        font-size: 0.85rem;
    }

    .table thead th,
    .table tbody td {
        padding: 10px;
    }
}

/* Utility Classes */
.text-primary {
    color: #dc3545 !important;
}

.text-secondary {
    color: #0066cc !important;
}

.bg-light-primary {
    background-color: rgba(220, 53, 69, 0.1);
}

.border-primary {
    border: 2px solid #dc3545 !important;
}

.section-padding {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.section-title p {
    font-size: 1.1rem;
    color: #6c757d;
}

.divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #dc3545 0%, #f093fb 100%);
    margin: 0 auto 30px;
    border-radius: 2px;
}

/* Scroll Smooth */
html {
    scroll-behavior: smooth;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #dc3545;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #c82333;
}

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #dc3545;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Toast Alert */
.alert {
    border: none;
    border-radius: 8px;
    border-left: 4px solid;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-left-color: #dc3545;
    color: #721c24;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
    color: #856404;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-left-color: #28a745;
    color: #155724;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    border-left-color: #17a2b8;
    color: #0c5460;
}

/* Print Styles */
@media print {
    .navbar, .footer, .btn, .btn-group {
        display: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
