/* ============================================================
   BARRIO SEGURO - ESTILOS GLOBALES
   ============================================================ */

:root {
  --bg-primary: #080818;
  --bg-secondary: #0d0d1a;
  --bg-card: #111128;
  --border-color: #1e1e3a;
  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --accent-red: #dc2626;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
}

* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

/* Safe area support for iOS */
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: #111;
}
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 2px;
}

/* Alert button animation */
#alert-btn {
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  position: relative;
}

#alert-btn:active {
  transform: scale(0.97);
}

/* Notification badge animation */
@keyframes pulseBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

#notif-badge:not(.hidden) {
  animation: pulseBadge 2s infinite;
}

/* Card hover effects */
.alert-card:hover {
  border-color: #374151;
  transform: translateY(-1px);
  transition: all 0.15s ease;
}

/* Loading spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* View transitions */
.view {
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Slide up modal */
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.animate-slide-up {
  animation: slideUp 0.3s ease-out;
}

/* Bottom nav active state */
.nav-btn {
  position: relative;
  color: #4b5563;
  transition: color 0.15s ease;
}

.nav-btn.active {
  color: #3b82f6;
}

.nav-btn.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 2px;
  background: #3b82f6;
  border-radius: 0 0 2px 2px;
}

/* Filter buttons */
.filter-btn {
  transition: all 0.15s ease;
}

/* Leaflet dark theme adjustments */
.leaflet-container {
  background: #111122;
}

.leaflet-tile {
  filter: brightness(0.85) saturate(0.8);
}

/* PWA standalone adjustments */
@media (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
  }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .max-w-lg {
    max-width: 100%;
  }
}

/* Line clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Admin sidebar mobile */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  #sidebar.show-mobile {
    transform: translateX(0);
  }
}

/* Status indicator pulse */
.status-pulse {
  position: relative;
}

.status-pulse::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  opacity: 0.4;
  animation: ripple 2s ease-out infinite;
}

@keyframes ripple {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* Pulse alert glow effect */
.pulse-alert {
  animation: alertGlow 1s ease-in-out infinite;
}

@keyframes alertGlow {
  0%, 100% { box-shadow: 0 0 30px rgba(220, 38, 38, 0.5), 0 0 60px rgba(220, 38, 38, 0.3); }
  50% { box-shadow: 0 0 60px rgba(220, 38, 38, 0.9), 0 0 100px rgba(220, 38, 38, 0.5); }
}
