/* CSS inline para evitar errores de archivos externos */
:root {
  /* Colores principales del logo GraffRoute */
  --primary-black: #1a1a1a;
  --accent-cyan: #00ffdd;
  --accent-cyan-dark: #00d4b8;
  --accent-cyan-light: #66fff0;

  /* Colores de apoyo */
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --medium-gray: #6c757d;
  --border-gray: #e9ecef;
  --dark-gray: #343a40;

  /* Colores semánticos */
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #17a2b8;

  /* Efectos */
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-cyan: 0 4px 20px rgba(0, 255, 221, 0.2);
  --transition: all 0.3s ease;

  /* Gradientes */
  --gradient-primary: linear-gradient(
    135deg,
    var(--primary-black),
    var(--dark-gray)
  );
  --gradient-accent: linear-gradient(
    135deg,
    var(--accent-cyan),
    var(--accent-cyan-light)
  );
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  color: var(--primary-black);
}

.header {
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 1rem 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  border-bottom: 2px solid var(--accent-cyan);
}

.main-content {
  margin-top: 80px;
  height: calc(100vh - 80px);
}

.map-container {
  display: flex;
  height: 100%;
}

#map {
  flex: 1;
  height: 100%;
  border-radius: 0;
}

.mural-item {
  padding: 1rem;
  border: 1px solid var(--border-gray);
  border-radius: 12px;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
  border-left: 3px solid transparent;
}

.mural-item:hover {
  box-shadow: var(--shadow-cyan);
  transform: translateY(-2px);
  border-left-color: var(--accent-cyan);
  background: rgba(0, 255, 221, 0.02);
}

.mural-item.active {
  border-color: var(--accent-cyan);
  border-left-color: var(--accent-cyan);
  background: rgba(0, 255, 221, 0.05);
  box-shadow: var(--shadow-cyan);
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-weight: 500;
  transition: var(--transition);
}

.btn-primary {
  background: var(--gradient-accent);
  color: var(--primary-black);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-cyan-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-cyan);
}

.btn-warning {
  background: var(--warning);
  color: var(--primary-black);
}

.btn-warning:hover {
  background: #e0a800;
  transform: translateY(-1px);
}

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--medium-gray);
}

.error {
  background: #f8d7da;
  color: #721c24;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  border-left: 4px solid var(--danger);
}

/* Sidebar */
.map-sidebar {
  width: 350px;
  background: var(--white);
  border-right: 2px solid var(--accent-cyan);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: 2px 0 10px rgba(0, 255, 221, 0.1);
}

.map-sidebar.hidden {
  margin-left: -350px;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-gray);
  background: var(--gradient-primary);
  color: var(--white);
  position: relative;
}

.sidebar-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-accent);
}

.sidebar-header h4 {
  margin: 0;
  color: var(--white);
  font-weight: 600;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: var(--light-gray);
}

/* Search Form */
.search-form .input-group {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 255, 221, 0.1);
}

.search-form .form-control {
  border-right: none;
  border: 2px solid var(--border-gray);
  padding: 0.75rem 1rem;
}

.search-form .form-control:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 0.2rem rgba(0, 255, 221, 0.15);
  outline: none;
}

.search-form .btn {
  border-left: none;
  border: 2px solid var(--accent-cyan);
  border-left: none;
  background: var(--gradient-accent);
  color: var(--primary-black);
}

/* Filters */
.filters {
  border: 1px solid var(--accent-cyan);
  border-radius: 12px;
  padding: 1rem;
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0, 255, 221, 0.1);
}

.filter-group {
  margin-bottom: 1rem;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group label {
  font-weight: 600;
  color: var(--primary-black);
  margin-bottom: 0.5rem;
  display: block;
}

.filter-group select,
.filter-group input {
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  padding: 0.5rem;
  width: 100%;
  transition: var(--transition);
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 0.2rem rgba(0, 255, 221, 0.15);
  outline: none;
}

/* Murals List */
.murals-list {
  max-height: 500px;
  overflow-y: auto;
  padding: 0.5rem;
}

.mural-item-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 0.5rem;
}

.mural-item-title {
  font-weight: 600;
  color: var(--primary-black);
  margin: 0;
  font-size: 1rem;
}

.mural-item-distance {
  font-size: 0.875rem;
  color: var(--accent-cyan-dark);
  font-weight: 600;
  background: rgba(0, 255, 221, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
}

.mural-item-artist {
  color: var(--medium-gray);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.mural-item-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--medium-gray);
}

.mural-item-stats span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Main Map */
.map-main {
  flex: 1;
  position: relative;
}

/* Map Controls */
.map-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-controls .btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-cyan);
  background: var(--white);
  border: 2px solid var(--accent-cyan);
  color: var(--accent-cyan-dark);
  font-size: 1.1rem;
}

.map-controls .btn:hover {
  background: var(--gradient-accent);
  color: var(--primary-black);
  transform: scale(1.1);
}

/* Map Legend */
.map-legend {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: var(--white);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow-cyan);
  z-index: 1000;
  border: 1px solid var(--accent-cyan);
}

.map-legend h6 {
  margin: 0 0 0.5rem 0;
  color: var(--primary-black);
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--primary-black);
}

.legend-item:last-child {
  margin-bottom: 0;
}

.legend-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-right: 0.5rem;
  display: inline-block;
  border: 2px solid var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.legend-marker.active {
  background: var(--accent-cyan);
}

.legend-marker.visited {
  background: var(--warning);
}

.legend-marker.route {
  background: var(--success);
}

.legend-marker.user {
  background: var(--info);
}

/* Custom Marker Styles para Google Maps */
.custom-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--white);
  box-shadow: var(--shadow-cyan);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: bold;
  font-size: 14px;
}

.custom-marker:hover {
  transform: scale(1.2);
  box-shadow: 0 6px 20px rgba(0, 255, 221, 0.4);
}

.custom-marker.active {
  background: var(--accent-cyan);
  color: var(--primary-black);
  border-color: var(--accent-cyan-dark);
}

.custom-marker.visited {
  background: var(--warning);
  color: var(--primary-black);
}

.custom-marker.route {
  background: var(--success);
}

.custom-marker.user {
  background: var(--info);
  width: 28px;
  height: 28px;
  font-size: 12px;
}

/* Popup personalizado para Google Maps */
.gm-info-window {
  border-radius: 12px;
  box-shadow: var(--shadow-cyan);
}

.gm-info-window .gm-style-iw {
  border-radius: 12px;
  border: 1px solid var(--accent-cyan);
}

.popup-content {
  min-width: 250px;
  padding: 0.5rem;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-gray);
}

.popup-title {
  font-weight: 600;
  color: var(--primary-black);
  margin: 0;
  font-size: 1.1rem;
}

.popup-artist {
  color: var(--medium-gray);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.popup-description {
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--primary-black);
}

.popup-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-gray);
}

.popup-actions .btn {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  flex: 1;
}

.popup-actions .btn-primary {
  background: var(--gradient-accent);
  color: var(--primary-black);
}

.popup-actions .btn-secondary {
  background: var(--medium-gray);
  color: var(--white);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 26, 26, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.loading-overlay.hidden {
  display: none;
}

.loading-overlay p {
  margin-top: 1rem;
  color: var(--white);
  font-weight: 500;
}

.loading-overlay .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 255, 221, 0.3);
  border-top: 4px solid var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .map-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    z-index: 1001;
    box-shadow: var(--shadow-cyan);
  }

  .map-sidebar.hidden {
    margin-left: -350px;
  }

  .map-controls {
    top: 70px;
    right: 10px;
  }

  .map-controls .btn {
    width: 40px;
    height: 40px;
  }

  .map-legend {
    bottom: 10px;
    left: 10px;
    padding: 0.75rem;
  }

  .popup-content {
    min-width: 200px;
  }
}

@media (max-width: 480px) {
  .map-sidebar {
    width: 300px;
  }

  .map-sidebar.hidden {
    margin-left: -300px;
  }

  .sidebar-content {
    padding: 0.75rem;
  }

  .mural-item {
    padding: 0.75rem;
  }

  .map-controls {
    top: 60px;
    right: 5px;
  }

  .map-legend {
    bottom: 5px;
    left: 5px;
    padding: 0.5rem;
  }
}

/* Animation for markers */
@keyframes markerBounce {
  0%,
  20%,
  60%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  80% {
    transform: translateY(-5px);
  }
}

.marker-bounce {
  animation: markerBounce 1s ease-out;
}

@keyframes markerPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.marker-pulse {
  animation: markerPulse 2s ease-in-out infinite;
}

/* Scrollbar personalizado para sidebar */
.sidebar-content::-webkit-scrollbar,
.murals-list::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track,
.murals-list::-webkit-scrollbar-track {
  background: var(--light-gray);
}

.sidebar-content::-webkit-scrollbar-thumb,
.murals-list::-webkit-scrollbar-thumb {
  background: var(--accent-cyan);
  border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover,
.murals-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan-dark);
}

/* Toggle button para sidebar */
.sidebar-toggle {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 1002;
  background: var(--white);
  border: 2px solid var(--accent-cyan);
  color: var(--accent-cyan-dark);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-cyan);
  transition: var(--transition);
}

.sidebar-toggle:hover {
  background: var(--gradient-accent);
  color: var(--primary-black);
  transform: scale(1.1);
}

/* Efectos especiales para GraffRoute */
.map-sidebar:hover {
  box-shadow: 4px 0 15px rgba(0, 255, 221, 0.2);
}

.mural-item:hover .mural-item-title {
  color: var(--accent-cyan-dark);
}

/* Estados de carga mejorados */
.loading-mural {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 255, 221, 0.1),
    transparent
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

:root {
  --primary-gray: #4a4a4a;
  --accent-yellow: #ffd700;
  --accent-blue: #2196f3;
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --border-gray: #e9ecef;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
}

.main-content {
  margin-top: 80px;
  height: calc(100vh - 80px);
  position: relative;
}

.map-container {
  display: flex;
  height: calc(100% - 200px);
}

.map-sidebar {
  width: 350px;
  background: var(--white);
  border-right: 1px solid var(--border-gray);
  overflow-y: auto;
  padding: 1rem;
  height: calc(100vh - 80px);
}

#map {
  flex: 1;
  height: 100%;
}

/* Galería en la parte inferior */
.gallery-section {
  position: absolute;
  bottom: 0;
  left: 350px;
  right: 0;
  height: 200px;
  background: var(--white);
  border-top: 2px solid var(--border-gray);
  padding: 1rem;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 1000;
}

.gallery-section.active {
  transform: translateY(0);
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.gallery-close-btn {
  display: inline-block;
}

.gallery-container {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  height: 120px;
  padding-bottom: 10px;
}

.gallery-item {
  flex-shrink: 0;
  width: 150px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.gallery-item:hover {
  border-color: var(--accent-blue);
  transform: scale(1.05);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mural-item {
  padding: 1rem;
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mural-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.mural-item.active {
  border-color: var(--accent-blue);
  background: rgba(33, 150, 243, 0.05);
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--accent-blue);
  color: white;
}

.btn-warning {
  background: var(--accent-yellow);
  color: var(--primary-gray);
}

.loading {
  text-align: center;
  padding: 2rem;
}

.error {
  background: #f8d7da;
  color: #721c24;
  padding: 1rem;
  border-radius: 6px;
  margin: 1rem 0;
}

/* Modal para imagen ampliada */
.image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.image-modal img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

/* Estilos para marcadores personalizados */
.custom-marker {
  position: relative;
  background: #f8f9fa;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.custom-marker:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

.custom-marker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  transition: opacity 0.3s ease;
}

.custom-marker .fas {
  color: #2196f3;
  transition: font-size 0.3s ease;
}

/* Pulso sutil para marcadores activos */
.custom-marker.active {
  animation: markerPulse 2s infinite;
}

@keyframes markerPulse {
  0% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  50% {
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.6);
  }

  100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
}

/* Responsive para marcadores en móvil */
@media (max-width: 768px) {
  .custom-marker {
    border-width: 2px;
  }

  .custom-marker:hover {
    transform: scale(1.05);
  }
}

/* Desktop: ocultar botón de cerrar galería */
@media (min-width: 769px) {
  .gallery-close-btn {
    display: none;
  }

  .gallery-section {
    transform: translateY(0) !important;
  }
}

.mobile-toggle {
  display: none;
  position: fixed;
  top: 90px;
  left: 10px;
  z-index: 1002;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.2rem;
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
  }

  .map-container {
    height: calc(100% - 150px);
  }

  .map-sidebar {
    position: fixed;
    top: 80px;
    left: -350px;
    height: calc(100vh - 80px);
    z-index: 1001;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
  }

  .map-sidebar.show {
    left: 0;
  }

  .gallery-section {
    height: 150px;
    left: 0;
  }

  .gallery-container {
    height: 80px;
  }

  .gallery-item {
    width: 120px;
    height: 60px;
  }

  .gallery-close-btn {
    display: inline-block;
  }
}
