/* css/realisAtions.css */
:root {
  --primary-blue: #0b60a9;
  --secondary-green: #005511;
  --dark-bg: #0b2336;
  --light-bg: #f7f9fb;
  --card-bg: #ffffff;
  --accent-orange: #ff6b35;
  --accent-purple: #8a2be2;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #0a1929 0%, #0b2336 100%);
  color: white;
  height: 100vh;
}

#globe-container {
  width: 100vw;
  height: 100dvh;
  position: relative;
  cursor: grab;
}

#globe-container:active {
  cursor: grabbing;
}

/* Tooltip mejorado */
#tooltip {
  position: absolute;
  padding: 12px 16px;
  background: rgba(11, 35, 54, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  pointer-events: none;
  display: none;
  font-size: 14px;
  z-index: 10;
  max-width: 250px;
  box-shadow: var(--shadow-lg);
  transition: opacity 0.2s;
  color: #fff;
}

#tooltip::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid rgba(11, 35, 54, 0.95);
}

.tooltip-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tooltip-image {
  width: 100%;
  max-height: 100px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Panel lateral profesional */
#info-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100%;
  background: linear-gradient(145deg, #0f2a44 0%, #0b2336 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0;
  transition: right 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  overflow-y: auto;
  color: white;
  z-index: 20;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
}

#info-panel.open {
  right: 0;
}

.panel-header {
  padding: 24px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: white;
  margin: 0;
}

#close-info {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.2rem;
  transition: color 0.3s;
  background: rgba(255, 255, 255, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#close-info:hover {
  color: white;
  background: rgba(255, 255, 255, 0.2);
}

.panel-content {
  padding: 24px;
}

.project-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

.info-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
  border-radius: 6px;
  border-left: 3px solid var(--primary-blue);
}

.info-item .label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
}

.info-item .value {
  font-size: 1rem;
  font-weight: 500;
}

.project-description {
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 20px;
}

/* Filtros mejorados */
#filter-container {
  position: absolute;
  top: 100px;
  left: 20px;
  z-index: 10;
  background: rgba(11, 35, 54, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 280px;
}

.filter-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-title i {
  color: var(--primary-blue);
}

.filter-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-btn {
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  transform: translateX(5px);
}

.filter-btn.active {
  background: var(--primary-blue);
  color: white;
  box-shadow: 0 5px 15px rgba(11, 96, 169, 0.3);
}

.filter-btn .count {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.8rem;
}

/* Estadísticas en tiempo real */
#stats-panel {
  position: absolute;
  bottom: 30px;
  right: 30px;
  z-index: 10;
  background: rgba(11, 35, 54, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 280px;
}

.stats-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-title i {
  color: var(--primary-blue);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.stat-item {
  text-align: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-blue);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Controles del globo */
#globe-controls {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
  background: rgba(11, 35, 54, 0.85);
  backdrop-filter: blur(10px);
  padding: 10px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.control-btn:hover {
  background: var(--primary-blue);
  transform: scale(1.1);
}

.control-btn.active {
  background: var(--primary-blue);
  box-shadow: 0 0 15px rgba(11, 96, 169, 0.5);
}

/* Título de la página */
#page-title {
  position: relative;
  text-align: center;
  z-index: 5;
  background: rgba(11, 35, 54, 0.7);
  backdrop-filter: blur(10px);
  padding: 15px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
}

#page-title h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: white;
}

#page-title p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  max-width: 600px;
}

/* Animación de carga */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--dark-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.5s, visibility 0.5s;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Estilos para los puntos personalizados */
.custom-point {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

/* Anillo externo para puntos importantes */
.point-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid;
  opacity: 0.6;
  animation: pulse-ring 2s infinite;
}

/* Punto central */
.point-core {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

/* Efecto de pulso para puntos importantes */
@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }

  50% {
    transform: scale(1.2);
    opacity: 0.3;
  }

  100% {
    transform: scale(1);
    opacity: 0.6;
  }
}

/* Efecto de brillo para hover */
@keyframes point-glow {
  0% {
    filter: drop-shadow(0 0 5px currentColor);
  }

  50% {
    filter: drop-shadow(0 0 20px currentColor);
  }

  100% {
    filter: drop-shadow(0 0 5px currentColor);
  }
}

/* Animación de flotación */
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* RESPONSIVE GENERAL */
@media (max-width: 768px) {
  body {
    overflow: auto;
  }

  #globe-container {
    height: 100dvh;
  }

  /* Filtros */

  #filter-container,
  #info-panel {
    display: none; /* Oculta completamente los filtros */
  }

  .filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .filter-btn {
    flex: 1 1 calc(50% - 10px);
  }

  /* Panel de estadísticas */
  #stats-panel {
    width: 190px;
    padding: 12px;
    bottom: 15px;
    right: 15px;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  /* Info panel ocupa toda la pantalla */
  #info-panel {
    width: 100%;
    height: auto;
    max-height: 75vh;
    bottom: 0;
    right: 0;
    border-radius: 12px 12px 0 0;
  }

  /* Título */
  #page-title {
    padding: 10px 15px;
    margin: 0 auto;
    max-width: 92%;
    top: 60px;
  }

  #page-title h1 {
    font-size: 1.2rem;
  }

  #page-title p {
    font-size: 0.9rem;
  }

  /* Tooltip más pequeño */
  #tooltip {
    max-width: 250px;
    padding: 12px;
    border-radius: 10px;
    font-size: 0.9rem;
  }

  .tooltip-image {
    max-height: 80px;
  }

  /* Grids del panel lateral */
  .info-grid {
    grid-template-columns: 1fr;
  }

  /* Controles del globo */
  #globe-controls {
    bottom: 20px;
    right: 20px;
    transform: scale(0.85);
  }

  .control-btn {
    width: 38px;
    height: 38px;
  }
}

/* RESPONSIVE EXTREMO (móviles muy pequeños) */
@media (max-width: 480px) {
  #filter-container,
  #stats-panel {
    display: none;
  }

  .filter-btn {
    font-size: 12px;
    padding: 8px 10px;
    flex: 1 1 100%;
  }

  #tooltip {
    max-width: 180px;
    font-size: 0.8rem;
  }

  #page-title h1 {
    font-size: 1rem;
  }
}
