/* Color Palette */
:root {
  --primary-dark: #0f172a;
  /* Deep Navy Blue */
  --secondary-dark: #1e293b;
  /* Dark Slate Blue */
  --accent-blue: #3b82f6;
  /* Bright Blue */
  --highlight-blue: #60a5fa;
  /* Lighter Blue */
  --text-light: #f8f9fa;
  --text-dark: #343a40;

  /* Mappings for backwards compatibility during migration if needed, 
     but we will update usages directly */
  --medium-blue: #2563eb;
  --light-blue: #93c5fd;

  --sidebar-width: 280px;
  /* Default sidebar width */
  --sidebar-collapsed-width: 80px;
}

/* General */
html,
body {
  height: 100%;
  /* Ensure full height for layout */
}

body {
  background-color: var(--primary-dark);
  /* Dark background for overall page */
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
}

/* Botones */
.btn {
  background-color: var(--primary-dark);
  color: var(--text-light);
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s;
  width: fit-content;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.btn:hover {
  background-color: var(--secondary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.12);
}

/* Google Maps InfoWindow Customization - Dark Theme */
.gm-style-iw {
  background-color: #1a1c23 !important;
  color: #e0e0e0 !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
  padding: 0 !important;
}

.gm-style-iw-c {
  background-color: #1a1c23 !important;
  padding: 0 !important;
}

.gm-style-iw-d {
  overflow: hidden !important;
  background-color: #1a1c23 !important;
  color: #e0e0e0 !important;
}

/* Arrow/Tail color */
.gm-style-iw-t::after {
  background: linear-gradient(45deg, #1a1c23 50%, rgba(255, 255, 255, 0) 51%, rgba(255, 255, 255, 0) 100%) !important;
  box-shadow: -2px 2px 2px 0 rgba(0, 0, 0, 0.4);
}

/* Close button */
.gm-ui-hover-effect {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-radius: 50% !important;
  top: 5px !important;
  right: 5px !important;
  width: 24px !important;
  height: 24px !important;
}

.gm-ui-hover-effect>img {
  filter: invert(1) !important;
  /* Make X white */
  width: 14px !important;
  height: 14px !important;
  margin: 5px !important;
}

/* Custom Content Classes */
.map-info-window {
  padding: 15px;
  min-width: 250px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.map-info-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.map-info-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ef4444;
  /* Red for alerts */
}

.map-info-img.user-marker {
  border-color: #3b82f6;
  /* Blue for users */
}

.map-info-title h5 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #f8fafc;
}

.map-info-title span {
  font-size: 0.85rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.map-info-body {
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.map-info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.map-info-label {
  color: #64748b;
  font-weight: 500;
}

.danger-high {
  color: #ef4444;
  font-weight: bold;
}

.danger-medium {
  color: #f59e0b;
  font-weight: bold;
}

.danger-low {
  color: #10b981;
  font-weight: bold;
}

/* Glassmorphism Modal Styles */
.modal-glass .modal-content {
  background: rgba(21, 27, 46, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5) !important;
  color: #e2e8f0 !important;
  border-radius: 16px !important;
}

.modal-glass .modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.modal-glass .modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.modal-glass .modal-title {
  color: #fff !important;
  font-weight: 600;
}

.modal-glass .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.8;
}

/* Glass Table Styles for Modals */
.modal-glass .table {
  --bs-table-bg: transparent !important;
  --bs-table-color: #e2e8f0 !important;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03) !important;
  --bs-table-hover-bg: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e2e8f0 !important;
}

.modal-glass .table th,
.modal-glass .table td {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.modal-glass .table thead th {
  color: #94a3b8;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  border-bottom-width: 1px;
}

/* Explicit Glass Card Style */
.glass-card {
  background: rgba(21, 27, 46, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5) !important;
  color: #e2e8f0 !important;
  border-radius: 16px !important;
}

/* Global Content Layout - Respects Sidebar */
.main-content {
  background-color: var(--primary-dark);
  min-height: 100vh;
  margin-left: 280px;
  /* Fallback */
  margin-left: var(--sidebar-width, 280px);
  width: calc(100% - 280px);
  /* Fallback */
  width: calc(100% - var(--sidebar-width, 280px));
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-collapsed .main-content {
  margin-left: 80px;
  /* Fallback */
  margin-left: var(--sidebar-collapsed-width, 80px);
  width: calc(100% - 80px);
  /* Fallback */
  width: calc(100% - var(--sidebar-collapsed-width, 80px));
}

@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
    width: 100%;
  }
}