/* FIREUP - Custom Styles */

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

:root {
  --fire-red: #ff0000;
  --fire-yellow: #fdcf58;
  --fire-gradient: linear-gradient(135deg, #ff0000 0%, #fdcf58 100%);
  --fire-gradient-r: linear-gradient(135deg, #fdcf58 0%, #ff0000 100%);
  --sidebar-bg: #1e1e2e;
  --sidebar-hover: #2d2d45;
  --sidebar-active: rgba(255,0,0,0.15);
}

* { box-sizing: border-box; }

body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background-color: #f1f5f9;
  color: #1e293b;
}

/* ===================== GRADIENT UTILITIES ===================== */
.fire-gradient            { background: var(--fire-gradient); }
.fire-gradient-r          { background: var(--fire-gradient-r); }
.fire-gradient-text       { background: var(--fire-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.fire-btn {
  background: var(--fire-gradient);
  color: #fff;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
}
.fire-btn:hover  { opacity: .9; }
.fire-btn:active { transform: scale(.97); }

/* ===================== SIDEBAR ===================== */
.sidebar {
  background: var(--sidebar-bg);
  width: 260px;
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform .3s ease;
}
.sidebar-logo {
  background: var(--fire-gradient);
  padding: 1.25rem 1.5rem;
  display: flex; align-items: center; gap: .75rem;
}
.sidebar-logo-text { font-size: 1.25rem; font-weight: 800; color: #fff; letter-spacing: .05em; }
.sidebar-logo-sub  { font-size: .65rem; color: rgba(255,255,255,.8); font-weight: 400; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 1rem 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.sidebar-section-label {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.35);
  padding: .75rem 1.5rem .25rem;
}

.sidebar-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1.5rem;
  color: rgba(255,255,255,.65);
  font-size: .875rem; font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all .2s;
  margin: .1rem 0;
}
.sidebar-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-link.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left-color: var(--fire-red);
}
.sidebar-link .icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ===================== TOPBAR ===================== */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  height: 64px;
  display: flex; align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky; top: 0; z-index: 40;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.topbar-brand  { display: flex; align-items: center; gap: .6rem; }

/* ===================== MOBILE HEADER ===================== */
.mobile-header {
  background: var(--fire-gradient);
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem;
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  box-shadow: 0 2px 8px rgba(255,0,0,.3);
}
.mobile-header-title { color: #fff; font-weight: 700; font-size: 1.125rem; }

/* ===================== BOTTOM NAV ===================== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  height: 64px;
  display: flex; align-items: stretch;
  z-index: 50;
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
}
.bottom-nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .2rem;
  text-decoration: none;
  color: #94a3b8;
  font-size: .65rem; font-weight: 500;
  transition: color .2s;
  position: relative;
}
.bottom-nav-item.active { color: var(--fire-red); }
.bottom-nav-item.active::before {
  content: '';
  position: absolute; top: 0; left: 25%; right: 25%;
  height: 2.5px;
  background: var(--fire-gradient);
  border-radius: 0 0 3px 3px;
}
.bottom-nav-item .icon { width: 1.375rem; height: 1.375rem; }

/* ===================== LAYOUT WRAPPERS ===================== */
.desktop-layout { display: flex; min-height: 100vh; }
.desktop-content { margin-left: 260px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.desktop-main { flex: 1; padding: 1.5rem; }

.mobile-layout { display: flex; flex-direction: column; min-height: 100vh; }
.mobile-main { flex: 1; padding: 1rem; margin-top: 60px; margin-bottom: 64px; }

/* ===================== CARDS ===================== */
.card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  overflow: hidden;
}
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  font-weight: 600; font-size: 1rem;
  display: flex; align-items: center; justify-content: space-between;
}

/* ===================== STAT CARDS ===================== */
.stat-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  display: flex; align-items: flex-start; gap: 1rem;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.stat-icon {
  width: 3rem; height: 3rem; border-radius: .75rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .8rem; color: #64748b; font-weight: 500; margin-top: .2rem; }

/* ===================== INCIDENT CARDS (MOBILE) ===================== */
.incident-card {
  background: #fff;
  border-radius: .875rem;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  border-left: 4px solid transparent;
  transition: box-shadow .2s;
  margin-bottom: .75rem;
}
.incident-card.reported     { border-left-color: #3b82f6; }
.incident-card.acknowledged { border-left-color: #f59e0b; }
.incident-card.in_progress  { border-left-color: #f97316; }
.incident-card.resolved     { border-left-color: #22c55e; }

/* ===================== FORMS ===================== */
.form-input {
  width: 100%; padding: .7rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: .625rem;
  font-size: .9rem; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  background: #fff; color: #1e293b;
  outline: none;
}
.form-input:focus {
  border-color: var(--fire-red);
  box-shadow: 0 0 0 3px rgba(255,0,0,.1);
}
.form-label {
  display: block; font-size: .8rem; font-weight: 600;
  color: #475569; margin-bottom: .35rem;
}
.form-error { font-size: .75rem; color: #ef4444; margin-top: .25rem; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.25rem;
  border-radius: .625rem;
  font-size: .875rem; font-weight: 600; font-family: inherit;
  border: none; cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.btn-primary   { background: var(--fire-gradient); color: #fff; }
.btn-primary:hover { opacity: .9; box-shadow: 0 4px 12px rgba(255,0,0,.3); }
.btn-secondary { background: #f1f5f9; color: #475569; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger    { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }
.btn-success   { background: #dcfce7; color: #16a34a; }
.btn-success:hover { background: #bbf7d0; }
.btn-sm { padding: .4rem .875rem; font-size: .8rem; border-radius: .5rem; }
.btn-lg { padding: .875rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ===================== TABLE ===================== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: #64748b; padding: .875rem 1rem;
  background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.data-table td { padding: .875rem 1rem; border-bottom: 1px solid #f1f5f9; font-size: .875rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafafa; }

/* ===================== MAP ===================== */
#incident-map, #nav-map, #admin-map, .leaflet-map {
  height: 300px;
  border-radius: .875rem;
  overflow: hidden;
  z-index: 0;
}
.leaflet-container { font-family: 'Poppins', sans-serif; }

/* ===================== NOTIFICATIONS ===================== */
.notif-dot {
  position: absolute; top: -2px; right: -2px;
  width: 8px; height: 8px;
  background: var(--fire-red);
  border-radius: 50%;
  border: 2px solid #fff;
}

/* ===================== AVATAR ===================== */
.avatar {
  border-radius: 50%; object-fit: cover;
  background: var(--fire-gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 1rem;
  flex-shrink: 0;
}

/* ===================== ANIMATIONS ===================== */
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,0,0,.4); }
  50%       { box-shadow: 0 0 0 8px rgba(255,0,0,0); }
}
.pulse-danger { animation: pulse-red 1.5s infinite; }

@keyframes slide-in-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.slide-in-up { animation: slide-in-up .35s ease forwards; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.fade-in { animation: fadeIn .3s ease; }

/* ===================== TOAST ===================== */
#toast-container {
  position: fixed; bottom: 80px; right: 1rem;
  z-index: 9999; display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  min-width: 260px; max-width: 340px;
  padding: .875rem 1.25rem;
  border-radius: .75rem;
  background: #1e293b; color: #fff;
  font-size: .85rem; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  display: flex; align-items: center; gap: .75rem;
  animation: slide-in-up .3s ease;
}
.toast.success { border-left: 4px solid #22c55e; }
.toast.error   { border-left: 4px solid #ef4444; }
.toast.warning { border-left: 4px solid #f59e0b; }
.toast.info    { border-left: 4px solid #3b82f6; }

/* ===================== FILTER TABS ===================== */
.filter-tabs {
  display: flex; gap: .375rem; overflow-x: auto;
  padding-bottom: .25rem; scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
  padding: .45rem .875rem; border-radius: 2rem;
  font-size: .8rem; font-weight: 500; white-space: nowrap;
  border: 1.5px solid #e2e8f0; color: #64748b;
  background: #fff; cursor: pointer;
  transition: all .2s; text-decoration: none;
}
.filter-tab.active, .filter-tab:hover {
  background: var(--fire-gradient); color: #fff; border-color: transparent;
}

/* ===================== BADGE ===================== */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.25rem; height: 1.25rem;
  padding: 0 .35rem;
  border-radius: 9999px;
  font-size: .65rem; font-weight: 700;
  background: var(--fire-red); color: #fff;
}

/* ===================== LOADING ===================== */
.spinner {
  width: 1.5rem; height: 1.5rem;
  border: 2.5px solid #e2e8f0;
  border-top-color: var(--fire-red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== PHOTO UPLOAD ===================== */
.upload-area {
  border: 2px dashed #e2e8f0;
  border-radius: .875rem;
  padding: 2rem 1rem;
  text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--fire-red);
  background: rgba(255,0,0,.03);
}

/* ===================== SIREN ANIMATION ===================== */
.siren-ring {
  animation: siren-pulse 1s ease-in-out infinite;
}
@keyframes siren-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.1); opacity: .8; }
}

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===================== MOBILE RESPONSIVE ===================== */
@media (max-width: 768px) {
  .desktop-layout .sidebar { display: none; }
  .desktop-content { margin-left: 0; }
  .desktop-main { padding: 1rem; margin-bottom: 64px; }

  #toast-container { bottom: 80px; left: 1rem; right: 1rem; }
  .toast { min-width: unset; max-width: 100%; }

  .data-table { font-size: .8rem; }
  .data-table th, .data-table td { padding: .6rem .75rem; }
}

@media (min-width: 769px) {
  .mobile-layout { flex-direction: row; }
  .mobile-main   { margin-top: 0; }
}
