:root {
  --neon-cyan: #00f3ff;
  --neon-orange: #ff9900;
  --neon-pink: #ff00cc;
  --neon-green: #00ff88;
  --accent-color: #00f3ff; /* Color por defecto (Cian) */
  --cian: #00F3FF;
  --gold: #FFD700;
  --dark: #050505;
}

/* =========================================
   🌑 BLINDAJE DE COLOR (Dark Mode Protection)
   ========================================= */

html, body {
  /* Cambiamos el transparente por un negro profundo de seguridad */
  background-color: transparent !important; 
  margin: 0;
  padding: 0;
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  overflow: hidden;
}

#particleCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -3; /* detrás de todo */
  pointer-events: none;
  background: radial-gradient(circle at center, #0a0a0a 0%, #000000 100%);
  background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.4)), url('../assets/UniverseBackground.jpg');
  background-size: cover;
  background-position: center;
}

/* Navbar con Blur (Estilo Nuevo Integrado) */
.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 10px 30px;
    background: rgba(5, 5, 5, 0.3); /* Más transparente para ver partículas */
    backdrop-filter: blur(5px);
    z-index: 9999;
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar { display: flex; justify-content: space-between; align-items: center; width: 100%; }
#nav-logo { height: 45px; transition: transform 0.3s ease; }
#nav-logo:hover { transform: scale(1.05); }

/* Título Dinámico (No estático) */
.dynamic-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--cian);
    text-align: right;
    animation: titlePulse 4s infinite ease-in-out;
}

.nave-panel {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
}

@keyframes titlePulse {
    0%, 100% { text-shadow: 0 0 10px rgba(0, 243, 255, 0.3); opacity: 0.9; }
    50% { text-shadow: 0 0 30px rgba(0, 243, 255, 0.8); opacity: 1; }
}

.holo-card {
  position: absolute;
  width: 160px;
  height: 160px;
  padding: 10px;
  background: rgba(255,255,255,0.06);
  border: 2px solid currentColor;
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  transition: transform 0.2s ease;
}

.holo-card:hover {
  animation: bounce 0.6s ease, glow 1.2s infinite alternate;
  background: rgba(255,255,255,0.08);
  z-index: 10;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes glow {
  0% { box-shadow: 0 0 6px currentColor; }
  50% { box-shadow: 0 0 18px currentColor; }
  100% { box-shadow: 0 0 6px currentColor; }
}

/* Posiciones de los módulos */
.card-dntal { color: #00f3ff; top: 100px;  left: 120px; }
.card-odonto { color: #00ff88; top: 90px;  right: 210px;}
.card-biomech { color: #ff9900; bottom: 120px; left: 80px; }
.card-design { color: #ff00cc; bottom: 120px; left: 50%; transform: translateX(-50%); }
.card-ia { color: #ffffff; bottom: 120px; right: 280px; }

.system-footer {
  position: absolute;
  bottom: 10px;
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: #888;
}

/* =========================================
   💠 INTERFAZ DE MÓDULOS INTERNOS (DNTAL/ODONTO)
   ========================================= */

.internal-dashboard {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
  padding: 40px;
  box-sizing: border-box;
}

/* Clase específica para los fondos de Dntal */
.bg-dntal {
  background: radial-gradient(circle at center, #0a0a0a 0%, #000000 100%);
}

/* Fondo específico para Odonto Clinic */
.bg-odonto {
  background: radial-gradient(circle at center, #051a10 0%, #000000 100%); /* Verde muy oscuro */
}

/* Aseguramos que el panel de cristal no se pierda */
.glass-panel {
  background: rgba(0, 0, 0, 0.8) !important; /* Más opaco para evitar fatiga visual */
  backdrop-filter: blur(15px);
  border: 1px solid rgba(0, 243, 255, 0.2);
  border-radius: 20px;
  padding: 40px;
  max-width: 1000px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 30px rgba(0, 243, 255, 0.1);
  position: relative;
  z-index: 5;
}

.muelita-logo {
  width: 160px; /* AUMENTADO: De 80px a 160px para mayor presencia */
  margin-bottom: 25px;
  /* Intensificamos el brillo para que coincida con el nuevo tamaño */
  filter: drop-shadow(0 0 20px #00f3ff);
  transition: transform 0.3s ease;
}

/* Efecto extra: un pequeño "latido" al pasar el mouse */
.muelita-logo:hover {
  transform: scale(1.05);
}

.btn-back-nexo {
  position: absolute;
  top: 20px;
  left: 20px;
  color: #00f3ff;
  text-decoration: none;
  font-size: 14px;
  border: 1px solid #00f3ff;
  padding: 5px 15px;
  border-radius: 5px;
  transition: 0.3s;
}

.btn-back-nexo:hover {
  background: #00f3ff;
  color: #000;
}

.services-grid-internal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.service-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 12px;
  text-decoration: none;
  color: #fff;
  transition: 0.4s;
}

.service-card:hover {
  border-color: #00f3ff;
  background: rgba(0, 243, 255, 0.05);
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.service-title {
  color: #00f3ff;
  margin: 0 0 10px 0;
  font-size: 18px;
}

.service-desc {
  font-size: 12px;
  color: #ccc;
  line-height: 1.4;
}

/* Ajuste de color dinámico para los hover de Odonto Clinic */
.bg-odonto .service-card:hover {
  border-color: #00ff88;
  background: rgba(0, 255, 136, 0.05);
}

/* Forzar que el canvas sea siempre el fondo base */
#particleCanvas {
  z-index: -1; /* Ajuste para asegurar que esté detrás del glass-panel */
}

/* 🛠️ ESTABILIZADOR DE HOLOGRAMAS */

.holo-frame {
    position: relative;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    overflow: hidden;
    
    /* DEFINIMOS TAMAÑO FIJO PARA EVITAR SALTOS */
    width: 100%;
    height: 450px; /* Ajusta según tu preferencia visual */
    background: rgba(0, 0, 0, 0.4); /* Fondo de seguridad mientras carga */
    
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.tech-img {
    width: 100%;
    height: 100%;
    
    /* 🛡️ CLAVE: Ajusta la imagen al contenedor sin saltos */
    object-fit: contain; /* Cambia a 'cover' si prefieres que llene todo el marco */
    object-position: center;
    
    transition: opacity 0.3s ease-in-out; /* Transición suave para la rotación */
}

/* ⚡ TECNO-SKELETON PULSE */

@keyframes pulse-bg {
  0% { background-color: rgba(0, 243, 255, 0.03); }
  50% { background-color: rgba(0, 243, 255, 0.08); }
  100% { background-color: rgba(0, 243, 255, 0.03); }
}

.skeleton {
  animation: pulse-bg 1.5s infinite ease-in-out;
  position: relative;
  overflow: hidden;
}

/* Ocultar la imagen mientras carga para que no se vea el "salto" */
.tech-img.loading {
  opacity: 0;
}

.dntal-lore-bg {
    /* 1. Inyectamos la imagen de Biodental Lore */
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), 
                url('../assets/Gemini_Generated_Image_pk9ecwpk9ecwpk9e.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Efecto de profundidad al hacer scroll */
}

/* 2. Refuerzo de legibilidad para el panel de cristal */
.dntal-lore-bg .glass-panel {
    background: rgba(0, 0, 0, 0.85) !important; /* Más oscuro para que el texto resalte */
    border: 1px solid var(--neon-cyan);
    backdrop-filter: blur(20px); /* Desenfoque fuerte para separar el UI del fondo */
}

/* Fondo específico para el Hub de Dntal Lab */
.bg-dntal-hub {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), 
                url('assets/Dntalab.png');
    background-size: cover;
    background-position: center;
    height: 100vh;
}

/* Distribución optimizada de botones */
.dntal-grid-layout {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    padding-top: 100px;
}

/* Estilos para el Slider de Comparación */
.comparison-slider {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.img-after, .img-before {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
}
.img-before {
    width: 50%; /* Valor inicial */
    border-right: 2px solid var(--neon-cyan);
}
.slider-laser {
    position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
    width: 80%; cursor: pointer; z-index: 10;
}

/* 🚀 EXPANSIÓN DE PANEL Y BOTÓN TOP-RIGHT */
.internal-dashboard .glass-panel {
    max-width: 1800px !important; /* Ventana general más grande */
    min-height: 85vh;
}

/* Fondo específico para el Hub Dntal */
.bg-dntal-hub {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), 
                url('assets/Dntalab.png') no-repeat center center fixed;
    background-size: cover;
    background-color: #050505;
}

/* Botón Galería Semi-transparente Brillant */
.btn-gallery-top {
    position: absolute;
    top: 30px;
    right: 40px;
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 10px 20px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: 0.3s;
    text-shadow: 0 0 10px var(--accent-color); /* Letras brillantes */
    backdrop-filter: blur(5px);
}

.btn-gallery-top:hover {
    background: rgba(0, 243, 255, 0.2);
    box-shadow: 0 0 20px var(--neon-cyan);
}

/* 🌑 ESTILOS DEL MODAL */
.modal-overlay {
    display: none; position: fixed; z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.95);
    backdrop-filter: blur(15px); /* Desenfoque de fondo */
}

.modal-content {
    margin: auto; display: block; width: 80%; max-width: 900px;
    position: relative; top: 50%; transform: translateY(-50%);
}

.modal-content img {
    width: 100%; border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.3);
}

.close-modal {
    position: absolute; top: 30px; right: 50px;
    color: #fff; font-size: 50px; font-weight: bold; cursor: pointer;
}

.modal-nav {
    display: flex; justify-content: space-between;
    position: absolute; top: 50%; width: 100%; transform: translateY(-50%);
}

.modal-nav button {
    background: rgba(0,243,255,0.1); border: 1px solid var(--neon-cyan);
    color: white; padding: 20px; cursor: pointer; font-size: 24px;
}

/* 🚀 BOTÓN GALERÍA CON EFECTO DE BRILLO */
.btn-gallery-glow {
    padding: 12px 25px;
    background: transparent;
    color: var(--neon-cyan);
    border: 2px solid var(--neon-cyan);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    border-radius: 4px;
    margin-top: 20px;
}

/* Efecto de Brillo al pasar el Mouse (Hover) */
.btn-gallery-glow:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 15px var(--neon-cyan), 
                0 0 30px rgba(0, 243, 255, 0.4);
    text-shadow: 0 0 10px var(--neon-cyan);
    transform: translateY(-2px);
}

/* Pequeño destello interior al hacer clic */
.btn-gallery-glow:active {
    transform: scale(0.95);
    box-shadow: 0 0 5px var(--neon-cyan);
}

/* ✨ ANIMACIÓN DE PARPADEO NEÓN */
@keyframes neon-flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-cyan);
        opacity: 1;
    }
    20%, 24%, 55% {
        text-shadow: none;
        opacity: 0.5;
    }
}

.panel-title-flicker {
    font-size: 50px;
    color: var(--accent-color);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 5px;
    /* Aplicamos el efecto */
    animation: neon-flicker 4s infinite alternate;
}
