/* ==========================================================================
   Open Mirzachul - Modern Glassmorphism & UI Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700;800&display=swap');

:root {
    /* Color Palette */
    --bg-main: #0b132b;
    --bg-secondary: #1c2541;
    --bg-card: rgba(28, 37, 65, 0.65);
    --bg-card-hover: rgba(42, 54, 88, 0.85);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-glow: rgba(6, 182, 212, 0.15);
    
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: #00f2fe;
    --accent-blue: #3b82f6;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #ef4444;
    --accent-purple: #8b5cf6;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(6, 182, 212, 0.3);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Overrides */
[data-theme="light"] {
    --bg-main: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(241, 245, 249, 0.95);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-glow: rgba(6, 182, 212, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-main);
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    background: radial-gradient(circle at 15% 15%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 85% 75%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
                var(--bg-main);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-secondary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* Glassmorphism Card Utility */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}
.glass-card:hover {
    border-color: rgba(6, 182, 212, 0.3);
}

/* Header & Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 2rem;
    background: rgba(11, 19, 43, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-badge {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.brand-text h2 {
    font-size: 1.3rem;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff, var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-link:hover, .nav-link.active {
    color: var(--accent-cyan);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn {
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: #fff;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.6);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
}

.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.theme-toggle:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

/* Hero Section */
.hero-section {
    padding: 9rem 2rem 5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: center;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--accent-cyan);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 3.2rem;
    letter-spacing: -1px;
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-title span {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-card {
    padding: 1.2rem;
    text-align: center;
}
.stat-card .stat-val {
    font-size: 1.8rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: var(--accent-cyan);
}
.stat-card .stat-lbl {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.hero-map-preview {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-glow);
}
.hero-map-preview img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    display: block;
    filter: brightness(0.9) contrast(1.1);
    transition: var(--transition);
}
.hero-map-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(0deg, rgba(11, 19, 43, 0.95), transparent);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

/* Main Section Layout */
.section {
    padding: 5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3.5rem auto;
}

.section-subtitle {
    color: var(--accent-cyan);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* GIS Map Container & Controls */
.gis-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    height: 650px;
}

.gis-sidebar {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    overflow-y: auto;
}

.gis-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gis-filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-select, .form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(11, 19, 43, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}
.form-select:focus, .form-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.status-pills {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-pill {
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.status-pill:hover, .status-pill.active {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--accent-cyan);
    color: #fff;
}
.status-pill .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
}
.dot-red { background: var(--accent-rose); box-shadow: 0 0 8px var(--accent-rose); }
.dot-yellow { background: var(--accent-amber); box-shadow: 0 0 8px var(--accent-amber); }
.dot-green { background: var(--accent-emerald); box-shadow: 0 0 8px var(--accent-emerald); }

.map-wrapper {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

#leaflet-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Custom Leaflet Marker Pulse */
.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    position: relative;
}
.marker-red { background: var(--accent-rose); }
.marker-yellow { background: var(--accent-amber); }
.marker-green { background: var(--accent-emerald); }

/* Dashboard Charts Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.chart-card {
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.15rem;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Open Data Tables & Lists */
.tabs-container {
    margin-top: 2rem;
}

.tab-buttons {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}
.tab-btn:hover, .tab-btn.active {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

.table-responsive {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.custom-table th {
    background: rgba(11, 19, 43, 0.8);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.custom-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--accent-rose); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-info { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.3); }

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    transform: translateY(20px);
    transition: var(--transition);
}
.modal-backdrop.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: var(--transition);
}
.modal-close:hover {
    color: var(--accent-rose);
}

.modal-body {
    padding: 1.5rem;
}

/* Timeline Component */
.timeline {
    position: relative;
    padding-left: 2rem;
    margin: 1.5rem 0;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--glass-border);
}
.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 3px solid var(--text-muted);
}
.timeline-item.completed::before {
    border-color: var(--accent-emerald);
    background: var(--accent-emerald);
}
.timeline-item.active::before {
    border-color: var(--accent-cyan);
    background: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
}

/* Star Rating */
.star-rating {
    display: flex;
    gap: 0.4rem;
    color: var(--accent-amber);
    font-size: 1.2rem;
}

/* Footer */
.footer {
    background: rgba(11, 19, 43, 0.95);
    border-top: 1px solid var(--glass-border);
    padding: 4rem 2rem 2rem 2rem;
    margin-top: 5rem;
}

.footer-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 1rem;
    max-width: 320px;
}

.footer-col h4 {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    color: #fff;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
}
.footer-links a:hover {
    color: var(--accent-cyan);
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.toast {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .hero-section { grid-template-columns: 1fr; padding-top: 7rem; }
    .gis-container { grid-template-columns: 1fr; height: auto; }
    .map-wrapper { height: 450px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero-title { font-size: 2.2rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}
