/* 
 * Andijon viloyati oshxona va yashirin iqtisodiyot monitoring tizimi
 * Premium Dizayn Tizimi
 */

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

:root {
  /* Asosiy ranglar palitrasi */
  --bg-main: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f8fafc;
  --bg-sidebar: #090d16;
  --bg-sidebar-hover: #161f30;
  --bg-sidebar-active: #1d4ed8;
  
  /* Matn ranglari */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-on-dark: #f8fafc;
  --text-on-dark-muted: #94a3b8;
  
  /* Brend va Urg'u */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  --secondary: #0f766e;
  --secondary-light: #f0fdfa;
  
  /* Xavf ko'rsatkichlari */
  --risk-high: #e11d48;
  --risk-high-bg: #fff1f2;
  --risk-high-border: #fecdd3;
  --risk-high-text: #9f1239;
  
  --risk-med: #d97706;
  --risk-med-bg: #fffbeb;
  --risk-med-border: #fde68a;
  --risk-med-text: #92400e;
  
  --risk-low: #059669;
  --risk-low-bg: #ecfdf5;
  --risk-low-border: #a7f3d0;
  --risk-low-text: #065f46;
  
  /* Chegaralar va soyalar */
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.1), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 24px 48px -12px rgba(15, 23, 42, 0.18);
  
  /* O'lchamlar va radiuslar */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  --sidebar-width: 260px;
  --sidebar-total-space: 292px;
  --header-height: 70px;
  
  /* Animatsiyalar */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

#app {
  display: flex;
  width: 100vw;
  min-height: 100vh;
  position: relative;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-total-space);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
  transition: margin-left var(--transition-normal);
  max-width: calc(100vw - var(--sidebar-total-space));
}

/* Top App Header */
.app-header {
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: pointer;
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
  background-color: var(--border-color);
}

@media (max-width: 1024px) {
  .main-content {
    margin-left: 0;
    max-width: 100vw;
  }
  .mobile-menu-btn {
    display: flex;
  }
}

/* Kreativ Jonli HUD Ticker */
.hud-live-ticker {
  background: #090d16;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.78rem;
  color: #94a3b8;
  overflow: hidden;
}

.ticker-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(225, 29, 72, 0.2);
  color: #fb7185;
  border: 1px solid rgba(225, 29, 72, 0.35);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.7rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #f43f5e;
  box-shadow: 0 0 6px #f43f5e;
  animation: pulse-dot 1.5s infinite;
}

.ticker-track {
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
}

.ticker-content {
  display: inline-flex;
  gap: 16px;
  align-items: center;
}

.ticker-item {
  color: #e2e8f0;
  font-weight: 500;
}

.ticker-sep {
  color: #475569;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.header-breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.content-container {
  flex: 1;
  padding: 28px 32px 48px;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
}

/* Tugmalar (Buttons) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  outline: none;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  flex-shrink: 0;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-subtle);
  color: var(--text-primary);
  border-color: #cbd5e1;
}

.btn-success {
  background-color: var(--risk-low);
  color: #ffffff;
}

.btn-success:hover {
  background-color: #047857;
}

.btn-danger {
  background-color: var(--risk-high);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #be123c;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Xavf nishonlari (Risk Badges) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-high {
  background-color: var(--risk-high-bg);
  color: var(--risk-high-text);
  border: 1px solid var(--risk-high-border);
}
.badge-high::before {
  background-color: var(--risk-high);
}

.badge-medium {
  background-color: var(--risk-med-bg);
  color: var(--risk-med-text);
  border: 1px solid var(--risk-med-border);
}
.badge-medium::before {
  background-color: var(--risk-med);
}

.badge-low {
  background-color: var(--risk-low-bg);
  color: var(--risk-low-text);
  border: 1px solid var(--risk-low-border);
}
.badge-low::before {
  background-color: var(--risk-low);
}

.badge-info {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}
.badge-info::before {
  background-color: var(--primary);
}

/* Kartochkalar (Cards) */
.card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: box-shadow var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

/* Modal oynalar */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(5px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background-color: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

.modal-backdrop.active .modal-container {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background-color: var(--bg-surface);
  z-index: 2;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: var(--bg-surface-subtle);
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

/* Scrollbar dizayni */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsivlik */
@media (max-width: 1024px) {
  .main-content {
    margin-left: 0;
    max-width: 100vw;
  }
}

/* ==========================================================================
   Tizimga kirish (Authentication Gate) stillari
   ========================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, #0f172a 0%, #020617 100%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-color);
  padding: 36px 32px;
  animation: auth-card-appear 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes auth-card-appear {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-error {
  background-color: var(--risk-high-bg);
  border: 1px solid var(--risk-high-border);
  color: var(--risk-high-text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.auth-field {
  margin-bottom: 18px;
}

.auth-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap svg {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.auth-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.auth-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  font-size: 0.8rem;
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}

.auth-demo-hint {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.auth-demo-hint code {
  background: #f1f5f9;
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--primary);
  font-weight: 600;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* User profile & Logout button in sidebar */
.user-profile-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #0f766e);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  display: block;
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-on-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  display: block;
  font-size: 0.7rem;
  color: var(--text-on-dark-muted);
}

.btn-logout-icon {
  background: transparent;
  border: none;
  color: var(--text-on-dark-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-logout-icon:hover {
  background: rgba(225, 29, 72, 0.2);
  color: #fda4af;
}

/* Leaflet Map Customizations */
#leaflet-district-map {
  width: 100%;
  height: 540px;
  border-radius: var(--radius-lg);
  z-index: 1;
}

.leaflet-popup-content-wrapper {
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
  margin: 0;
  line-height: 1.5;
}

.district-custom-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.district-custom-pin:hover {
  transform: scale(1.15);
}

.pin-bubble {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.pin-bubble.high {
  background: #e11d48;
}

.pin-bubble.med {
  background: #d97706;
}

.pin-bubble.low {
  background: #059669;
}

