/* ============================================================
   GeoBase - Dark Professional Theme
   Inspired by florencioengenharia.com
   ============================================================ */

:root {
  --bg-primary: #0B0E14;
  --bg-secondary: #111827;
  --bg-card: #151a27;
  --bg-card-hover: #1c2236;
  --bg-elevated: #1a2035;
  --bg-input: #0f1420;
  --border-subtle: #1e293b;
  --border-default: #293548;
  --border-focus: #2dd4bf;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #2dd4bf;
  --accent-blue: #3b82f6;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --glass-bg: rgba(11, 14, 20, 0.75);
  --glass-border: rgba(255, 255, 255, 0.06);
}

/* ---- Animations ---- */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-2%, 2%) rotate(1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(45, 212, 191, 0.15); }
  50% { box-shadow: 0 0 40px rgba(45, 212, 191, 0.25); }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-slideIn { animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-slideOut { animation: slideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-fadeIn { animation: fadeIn 0.3s ease-out forwards; }
.animate-fadeInUp { animation: fadeInScale 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* ---- Dark Scrollbar ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #293548; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3b4d66; }

/* ---- Map Containment ---- */
#map-container { isolation: isolate; position: relative; z-index: 0; }
#map { position: relative; z-index: 0; }

/* ---- Leaflet Overrides ---- */
.geo-marker { background: none !important; border: none !important; }

.geo-tooltip {
  background: var(--bg-card);
  color: var(--accent);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
}
.geo-tooltip::before {
  border-top-color: var(--bg-card);
}

.geo-label {
  background: rgba(11, 14, 20, 0.9);
  color: var(--accent);
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  white-space: nowrap;
}
.geo-label::before {
  border-bottom-color: rgba(11, 14, 20, 0.9) !important;
}

.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
  padding: 4px !important;
}
.leaflet-popup-tip {
  background: var(--bg-card) !important;
  box-shadow: none !important;
}
.leaflet-popup-content {
  margin: 10px 14px !important;
  line-height: 1.6 !important;
  color: var(--text-primary) !important;
}
.leaflet-popup-close-button {
  color: var(--text-muted) !important;
}
.leaflet-popup-close-button:hover {
  color: var(--text-primary) !important;
}

/* Dark leaflet controls */
.leaflet-control-zoom a {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-subtle) !important;
}
.leaflet-control-zoom a:hover {
  background: var(--bg-card-hover) !important;
}
.leaflet-control-attribution {
  background: rgba(11, 14, 20, 0.7) !important;
  color: var(--text-muted) !important;
  font-size: 9px !important;
}
.leaflet-control-attribution a {
  color: var(--text-muted) !important;
}

/* ---- Login Screen ---- */
.login-bg {
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}
.login-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 20% 80%, rgba(45, 212, 191, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(45, 212, 191, 0.02) 0%, transparent 70%);
  animation: float 25s linear infinite;
}
.login-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(45, 212, 191, 0.03) 100%);
  pointer-events: none;
}

/* ---- Glass Card ---- */
.glass-card {
  background: rgba(21, 26, 39, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.03);
}

/* ---- Sidebar ---- */
#sidebar {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--bg-secondary);
  border-color: var(--border-subtle);
}

/* ---- Detail Panel ---- */
#detail-panel {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--bg-secondary);
  border-color: var(--border-subtle);
}

/* ---- Base List Items ---- */
.base-list-item {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}
.base-list-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-default);
  transform: translateX(3px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.base-list-item.active {
  border-color: var(--accent);
  background: rgba(45, 212, 191, 0.05);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(45, 212, 191, 0.1);
}

/* ---- Form Inputs (Dark) ---- */
.form-input {
  background: var(--bg-input) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1) !important;
  outline: none;
}
.form-input::placeholder {
  color: var(--text-muted) !important;
}
select.form-input option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ---- Modal Overlay ---- */
.modal-overlay {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease-out;
}

/* ---- Navbar ---- */
#navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 1px 12px rgba(0,0,0,0.3);
}

/* ---- Filter Checkboxes ---- */
.filter-status-label {
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 6px;
  color: var(--text-secondary);
}
.filter-status-label:hover {
  background: var(--bg-card-hover);
}

/* ---- Detail Tabs ---- */
.detail-tab {
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.detail-tab:hover {
  color: var(--text-secondary);
}
.detail-tab.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

/* ---- Photo Upload ---- */
.photo-upload-zone {
  border: 2px dashed var(--border-default);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg-input);
}
.photo-upload-zone:hover {
  border-color: var(--accent);
  background: rgba(45, 212, 191, 0.03);
}

/* ---- Admin Table ---- */
.admin-table {
  color: var(--text-primary);
}
.admin-table th {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1;
}
.admin-table td {
  border-bottom: 1px solid var(--border-subtle);
}
.admin-table tr:hover td {
  background: var(--bg-card-hover);
}

/* ---- FAB ---- */
.fab {
  box-shadow: 0 4px 20px rgba(45, 212, 191, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  background: linear-gradient(135deg, var(--accent), #14b8a6) !important;
}
.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(45, 212, 191, 0.4);
}
.fab:active {
  transform: scale(0.95);
}

/* ---- Stats Dot ---- */
.stat-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 2px;
  vertical-align: middle;
}

/* ---- Form Section Title ---- */
.form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
  margin-top: 20px;
}

/* ---- Buttons ---- */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #14b8a6);
  color: #0B0E14;
  font-weight: 600;
  border: none;
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(45, 212, 191, 0.2);
}
.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 4px 20px rgba(45, 212, 191, 0.3);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* ---- Card Hover ---- */
.card-hover {
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.card-hover:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transform: translateY(-1px);
  border-color: var(--border-default);
}

/* ---- Accent Glow ---- */
.accent-glow {
  animation: glow 3s ease-in-out infinite;
}

/* ---- Toast Dark ---- */
.toast-dark {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* ---- Print ---- */
@media print {
  #navbar, #sidebar, .fab, #toast-container { display: none !important; }
  #detail-panel { position: static !important; width: 100% !important; transform: none !important; }
  #map-container { display: none !important; }
}

/* Dark leaflet layer control */
.leaflet-control-layers {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}
.leaflet-control-layers-toggle {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 8px !important;
}
.leaflet-control-layers label {
  color: var(--text-secondary) !important;
}
.leaflet-control-layers-separator {
  border-top-color: var(--border-subtle) !important;
}
.leaflet-control-scale-line {
  background: rgba(11, 14, 20, 0.7) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border-default) !important;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .leaflet-control-layers { font-size: 12px; }
  .leaflet-popup-content-wrapper { max-width: 260px !important; }
}
