.museo-virtual-content {
  text-align: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(46, 107, 66, 0.22);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 10px 30px rgba(31, 90, 58, 0.14);
}

.museo-virtual-content h2 {
  color: #1f5a3a;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin-bottom: 1rem;
}

.museo-virtual-content p {
  color: #2f6042;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

#virtual-tour-viewer {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  height: min(70vh, 620px);
  border-radius: var(--border-radius-lg);
  border: 3px solid rgba(56, 125, 78, 0.35);
  box-shadow: 0 10px 24px rgba(27, 78, 49, 0.2);
  background: linear-gradient(135deg, #1f5a3a, #397e52);
}

@keyframes pulse-white {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.custom-node {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: pulse-white 2s infinite;
  transition: all 0.3s ease;
}

.custom-node:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.2);
}

.custom-node i {
  color: white;
  font-size: 14px;
}

@media (max-width: 768px) {
  .custom-node {
    width: 24px;
    height: 24px;
    border-width: 1.5px;
  }
  .custom-node i {
    font-size: 10px;
  }
}

.mobile-orientation-hint {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(46, 107, 66, 0.08);
  border: 1px dashed rgba(46, 107, 66, 0.4);
  border-radius: 12px;
  padding: 12px 20px;
  margin-bottom: 25px;
  color: #1f5a3a;
  font-size: 0.95rem;
  line-height: 1.4;
}

.mobile-orientation-hint i {
  font-size: 1.2rem;
  animation: rotate-hint 2s infinite ease-in-out;
}

@keyframes rotate-hint {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(90deg); }
  50% { transform: rotate(90deg); }
  75% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

@media (max-width: 768px) and (orientation: portrait) {
  .mobile-orientation-hint {
    display: flex;
  }
}

@media (max-width: 1024px), (max-height: 500px) {
  .psv-markers-button,
  .psv-markers-list-button,
  .psv-download-button {
    display: none !important;
  }
}

.psv-navbar {
  background: transparent !important;
}

.psv-fullscreen-button {
  background: rgba(61, 61, 61, .5) !important;
  border-radius: 4px;
}

/* Asegurar que los tooltips de PSV sean visibles */
.psv-tooltip {
  background-color: rgba(31, 90, 58, 0.9) !important;
  backdrop-filter: blur(4px);
  color: white !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-family: inherit !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  line-height: 1.5;
}

/* Tutorial del Modo Secreto (Estilo coincidente con el aviso móvil) */
.secret-mode-tutorial {
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  padding: 0 20px;
  margin: 0 0 0 0;
  border: none;
  background: rgba(46, 107, 66, 0.08);
  border-radius: 12px;
  color: #1f5a3a;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.secret-mode-tutorial.show {
  opacity: 1;
  visibility: visible;
  max-height: 500px;
  padding: 20px;
  margin: 20px 0 25px 0;
  border: 1px dashed rgba(46, 107, 66, 0.4);
}

.secret-mode-tutorial h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1f5a3a;
  border-bottom: 1px solid rgba(46, 107, 66, 0.2);
  padding-bottom: 10px;
}

.secret-mode-tutorial p {
  margin-top: 0;
  margin-bottom: 15px;
  font-weight: 600;
}

.tutorial-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.tutorial-step i {
  font-size: 1.3rem;
  color: #397e52;
  margin-top: 2px;
  min-width: 25px;
  text-align: center;
}

.tutorial-steps {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

@media (min-width: 768px) {
  .tutorial-steps {
    flex-direction: row;
    justify-content: space-between;
  }
  .tutorial-step {
    flex: 1;
  }
}

/* Estilos de la Función Secreta */
.museum-feature-wrapper {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
}

#virtual-tour-viewer {
  position: relative;
  overflow: hidden;
}

/* Superposición de barra lateral dentro del visor */
.captured-plants-section {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  width: 320px !important;
  max-width: calc(100vw - 20px) !important;
  height: auto !important;
  max-height: 40vh !important; /* Cap height to less than half the screen */
  background: rgba(255, 255, 255, 0.85) !important; /* Transparent background */
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border-radius: 12px !important;
  border: 2px solid #1f5a3a !important;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.4) !important;
  z-index: 2147483646 !important; /* Max minus one */
  display: flex !important;
  flex-direction: column !important;
  padding: 1rem !important;
  pointer-events: auto !important;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
  overflow: visible !important; /* Crucial para que el botón de alternancia no se corte */
}

/* Estado minimizado para ocultarla parcialmente */
.captured-plants-section.minimized {
  transform: translateX(calc(100% - 70px)) !important;
  right: 10px !important;
}

/* Botón de alternancia de la barra lateral en la cabecera */
.toggle-sidebar-btn {
  position: absolute !important;
  top: 12px !important;
  left: 12px !important; 
  width: 32px !important;
  height: 32px !important;
  background: #eef7ed !important;
  color: #1f5a3a !important;
  border: 1px solid #1f5a3a !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.2s, transform 0.3s !important;
  padding: 0 !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
  z-index: 10 !important;
}

.toggle-sidebar-btn:hover {
  background: #d4e8d2 !important;
}

.captured-plants-section.minimized .toggle-sidebar-btn i {
  transform: rotate(180deg) !important;
}

/* Mejoras en la cabecera de la sección y el botón de exportación */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 2px solid #eef7ed;
  padding-bottom: 0.8rem;
  padding-left: 45px; /* Espacio para el botón de alternancia */
}

.section-header h3 {
  margin: 0;
  color: #1f5a3a;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
}

.btn-export {
  background: #1f5a3a;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.btn-export:hover {
  background: #2d7a4a;
}

.captured-plants-list {
  flex: 1 !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.8rem !important;
  padding-right: 5px !important;
  min-height: 0 !important;
  scrollbar-width: thin;
  scrollbar-color: #397e52 #f0fdf4;
}

.captured-plants-list::-webkit-scrollbar {
  width: 5px;
}

.captured-plants-list::-webkit-scrollbar-track {
  background: transparent;
}

.captured-plants-list::-webkit-scrollbar-thumb {
  background: #397e52;
  border-radius: 10px;
}

.plant-card {
  background: #f9fff8;
  border: 1px solid #e2f0e0;
  border-radius: 8px;
  padding: 0.8rem;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.plant-card:hover {
  background: #eef7ed;
  border-color: #397e52;
  transform: translateY(-2px);
}

.plant-card img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #d4e8d2;
}

.plant-card-info {
  flex: 1;
}

.plant-card-info h4 {
  margin: 0 0 0.2rem 0;
  color: #1f5a3a;
  font-size: 0.95rem;
}

.plant-card-info p {
  margin: 0;
  font-size: 0.75rem;
  color: #666;
}

.delete-plant-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  padding: 4px;
  font-size: 0.8rem;
  z-index: 2;
}

.delete-plant-btn:hover {
  color: #ff4d4d;
}

.empty-list-msg {
  text-align: center;
  color: #888;
  padding: 1rem 0;
  font-style: italic;
  font-size: 0.9rem;
}

/* Animaciones para el Feedback del Modo Secreto en el Logo */
@keyframes flash-success {
  0% { filter: drop-shadow(0 0 0 rgba(57, 126, 82, 0)); }
  50% { filter: drop-shadow(0 0 15px rgba(57, 126, 82, 1)); }
  100% { filter: drop-shadow(0 0 0 rgba(57, 126, 82, 0)); }
}

@keyframes flash-error {
  0% { filter: drop-shadow(0 0 0 rgba(255, 77, 77, 0)); }
  50% { filter: drop-shadow(0 0 15px rgba(255, 77, 77, 1)); }
  100% { filter: drop-shadow(0 0 0 rgba(255, 77, 77, 0)); }
}

.flash-success {
  animation: flash-success 1s ease-out;
}

.flash-error {
  animation: flash-error 1s ease-out;
}

/* Modal dentro de la superposición del visor */
.modal-overlay {
  position: absolute !important;
  top: auto !important;
  bottom: 20px !important;
  left: 20px !important;
  width: auto !important;
  height: auto !important;
  background: transparent !important; /* Fondo transparente para ver la planta */
  display: flex !important; /* Se mantiene en el DOM, solo invisible */
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(20px) !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  z-index: 2147483647 !important;
  pointer-events: none !important;
}

.modal-overlay.show {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: auto !important; /* Se vuelve clicable */
}

.modal-content {

  pointer-events: auto !important;
  background: white !important;
  border-radius: 12px !important;
  width: 320px !important;
  max-width: calc(100vw - 40px) !important;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5) !important;
  border: 1px solid #1f5a3a !important;
  overflow: hidden !important;
  animation: modal-appear 0.3s ease-out !important;
}

@keyframes modal-appear {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  background: #1f5a3a;
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 15px; /* Aumentar significativamente el área de clic */
  margin: -15px; /* Compensar el padding para mantener la alineación visual */
}

.modal-body {
  padding: 1.5rem;
}

.fragment-preview {
  margin: 1rem 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#fragment-canvas {
  border: 4px solid #f0fdf4;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(31, 90, 58, 0.1);
  background: #eee;
}

.preview-label {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-group {
  margin-top: 1.5rem;
}

#plant-name-input {
  box-sizing: border-box;
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e2f0e0;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}

#plant-name-input:focus {
  border-color: #397e52;
}

.coords-info {
  margin-top: 0.8rem;
  font-size: 0.8rem;
  color: #888;
  display: flex;
  justify-content: space-between;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: #f9fff8;
  text-align: right;
  border-top: 1px solid #eef7ed;
}

.btn-save {
  background: #397e52;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s;
}

.btn-save:hover {
  background: #2d7a4a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(57, 126, 82, 0.3);
}

/* Responsividad Móvil */
@media (max-width: 600px) {
  .captured-plants-section {
    width: 260px !important;
    max-width: 85vw !important;
    max-height: 25vh !important; /* Altura reducida a la mitad para móvil */
    padding: 0.8rem !important;
    top: 5px !important;
  }
  
  .toggle-sidebar-btn {
    left: 8px !important; 
    top: 10px !important;
    width: 36px !important;
    height: 36px !important;
    font-size: 1.2rem !important;
  }

  
  .modal-overlay {
    bottom: 5px !important;
    left: 5px !important;
    padding: 10px !important;
  }
  
  .modal-content {
    width: 90vw !important; /* Asegurar que quepa en la pantalla completamente */
    max-width: 320px !important;
  }
}

.plant-marker-label {
  position: relative;
  background: rgba(31, 90, 58, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  color: rgba(255, 255, 255, 0.9);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  pointer-events: auto; /* IMPORTANTE: requerido para clics en PSV */
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
}

/* Área de toque invisible expandida para móviles */
.plant-marker-label::after {
  content: '';
  position: absolute;
  top: -15px;
  right: -15px;
  bottom: -15px;
  left: -15px;
  z-index: 10;
}

