/** MWS Dynamic CSS File: CSS+Layout+Flexbox [Grupo: css] (ID: 2) */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-dark);
  background-color: var(--bg-main);
  margin: 0;
  line-height: 1.6;
}

/* Soporte estructural para el elemento personalizado */
mws-users {
  display: block;
}

/* 🚀 HEADER OPTIMIZADO: Alineación horizontal atómica de un solo viaje */
header {
  background-color: var(--primary);
  padding: 12px 24px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: space-between; /* Empuja el menú a la derecha del logo */
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   🚀 COMPONENTE HEADNAV: ESTILO PREMIUM RETO RETRO-ALINEADO
   ========================================================================== */

/* Contenedor principal de la barra de navegación */
header .headnav {
  display: flex;
  align-items: center;
  margin-left: auto; /* Empuja de forma elástica todo el menú a la derecha */
}

/* La lista contenedora que fuerza la hilera horizontal perfecta */
header .headnav ul {
  list-style: none;
  display: flex;
  align-items: center;
  padding: 0;
  margin: 0;
  gap: 32px; /* Espaciado premium simétrico idéntico a tu captura */
}

/* Elementos de la lista alineados en un solo hilo en la RAM */
header .headnav li {
  display: inline-flex;
  align-items: center;
  position: relative;
}

/* Los enlaces de texto con tipografía limpia y ergonomía visual */
header .headnav li a {
  text-decoration: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600; /* Grosor de letra intermedio idéntico a tu imagen */
  font-size: 14px;
  gap: 6px; /* Separación exacta entre el texto y la flecha o icono */
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Efecto Hover sutil y elegante al pasar el mouse */
header .headnav li a:hover {
  opacity: 0.85;
}

/* Soporte para las flechas indicadoras de menú desplegable (Drop-down caret) */
header .headnav li a::after {
  /* Si usas texto crudo como tu captura, puedes meter el carácter directo en el HTML, 
     o inyectarlo por CSS descomentando la línea de abajo: */
  /* content: "▾"; */
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  transition: transform 0.2s ease;
}

/* Estilo para el botón de acción final de la barra (ej: Cerrar Sesión / Login) */
header .headnav button {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  transition: background 0.3s ease, transform 0.1s ease;
  margin-left: 10px; /* Separación con respecto al último enlace */
}

header .headnav button:hover { 
  background: #c0392b; 
}


/* 🧬 LAYOUT CENTRAL EN FLEXBOX PURO RECONSTRUIDO */
section {
  display: flex;
  flex-direction: row;
  width: 100%;
  box-sizing: border-box;
  align-items: stretch; /* Fuerza a que nav, main y aside midan lo mismo de alto */
}

/* Menú de navegación lateral izquierdo */
nav {
  flex: 0 0 240px; /* Ancho fijo inmutable de 240px para la barra lateral */
  background-color: var(--bg-nav);
  padding: 25px 20px;
  border-right: 1px solid var(--border-color);
}

nav ul.navbar-nav-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px; /* Separación limpia entre pestañas */
}

nav .nav-link {
  text-decoration: none;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 14px;
  transition: color 0.2s ease;
}

nav .nav-link:hover {
  color: var(--primary);
}

/* Elemento principal de contenido */
main {
  flex: 3;
  background-color: var(--bg-card);
  padding: 30px 40px;
  box-sizing: border-box;
}

/* Barra lateral interactiva derecha */
aside {
  flex: 1.2;
  background-color: var(--bg-main);
  padding: 30px 20px;
  border-left: 1px solid var(--border-color);
  box-sizing: border-box;
}

/* Footer corporativo premium */
footer {
  background-color: var(--primary-dark);
  padding: 25px 20px;
  text-align: center;
  color: var(--text-light);
  width: 100%;
  box-sizing: border-box;
}

footer .name {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

footer .description {
  font-size: 11px;
  opacity: 0.8;
  white-space: pre-line;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.5;
}


/* Contenedor principal de la barra de navegación */
footer .bottnav {
  display: flex;
  align-items: center;
  margin-left: auto; /* Empuja de forma elástica todo el menú a la derecha */
}


/* Centra la lista completa dentro del contenedor */
footer .bottnav {
  display: flex;
  justify-content: center;
}

/* Limpia los estilos por defecto de la lista y alinea los elementos en fila */
footer .navbar-nav-list {
  display: flex;
  padding: 0;
  margin: 0;
  list-style: none;
  gap: 20px; /* Controla la separación horizontal entre cada botón */
}

/* Estilos opcionales para centrar el icono y el texto dentro de cada botón */
footer .bottnav .nav-link {
  display: flex;
  flex-direction: column; /* Icono arriba, texto abajo (estilo barra inferior) */
  align-items: center;
  text-decoration: none;
  color: #ccc; /* Cambia al color que prefieras */
}

/* La lista contenedora que fuerza la hilera horizontal perfecta */
footer .bottnav ul {
  list-style: none;
  display: flex;
  align-items: center;
  padding: 0;
  margin: 0;
  gap: 32px; /* Espaciado premium simétrico idéntico a tu captura */
}

/* Elementos de la lista alineados en un solo hilo en la RAM */
footer .bottnav li {
  display: inline-flex;
  align-items: center;
  position: relative;
}

/* Los enlaces de texto con tipografía limpia y ergonomía visual */
footer .bottnav li a {
  text-decoration: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600; /* Grosor de letra intermedio idéntico a tu imagen */
  font-size: 14px;
  gap: 6px; /* Separación exacta entre el texto y la flecha o icono */
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Efecto Hover sutil y elegante al pasar el mouse */
footer .bottnav li a:hover {
  opacity: 0.85;
}

/* Soporte para las flechas indicadoras de menú desplegable (Drop-down caret) */
footer .bottnav li a::after {
  /* Si usas texto crudo como tu captura, puedes meter el carácter directo en el HTML, 
     o inyectarlo por CSS descomentando la línea de abajo: */
  /* content: "▾"; */
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  transition: transform 0.2s ease;
}

/* Estilo para el botón de acción final de la barra (ej: Cerrar Sesión / Login) */
footer .bottnav button {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  transition: background 0.3s ease, transform 0.1s ease;
  margin-left: 10px; /* Separación con respecto al último enlace */
}

footer .bottnav button:hover { 
  background: #c0392b; 
}


/* ==========================================================================
   📱 RESPONSIVE DESIGN - MEDIA QUERIES PERFECTAS
   ========================================================================== */
@media (max-width: 1024px) {
  section {
    flex-direction: column;
  }
  
  nav, main, aside {
    width: 100%;
    flex: none;
    border-left: none;
    border-right: none;
  }
  
  nav {
    flex-direction: row;
    padding: 15px;
  }
  
  nav ul.navbar-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
  }
  
  header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
}

/* --- RESPONSIVO PARA SMARTPHONES --- */
@media (max-width: 768px) {
  /* 1. SECCIÓN DE SEGURIDAD: Evita que el contenedor padre fuerce la fila horizontal */
  header, 
  header .container, /* Si usas bootstrap o una clase contenedora */
  .bottnav { 
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow-x: hidden; /* Corta cualquier fuga visual hacia la derecha */
  }

  /* 2. AJUSTE DEL NAV: Cambia a columna y elimina el empuje elástico lateral */
  header .headnav {
    display: flex !important;
    flex-direction: column !important;
    margin-left: 0 !important; 
    margin-right: 0 !important;
    width: 100% !important;
    align-items: center !important; /* Centra la columna en el medio de la pantalla */
  }

  /* 3. AJUSTE DE LA LISTA: Fuerza el salto de línea vertical absoluto */
  header .headnav ul,
  .navbar-nav-list {
    display: flex !important;
    flex-direction: column !important;
    white-space: normal !important; /* Permite que el texto largo salte de línea si es necesario */
    gap: 16px !important; 
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    align-items: center !important; /* Centra los textos de la lista */
  }

  /* 4. ELEMENTOS INTERNOS: Ancho adaptable */
  header .headnav li {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
  }

  /* 5. ENLACES: Zona de clic optimizada y centrada */
  header .headnav li a,
  .nav-link {
    width: auto !important; /* Permite que el enlace use su propio tamaño centrado */
    justify-content: center !important;
    padding: 8px 0 !important;
  }

  /* 6. BOTÓN: Centrado y adaptado */
  header .headnav button {
    margin-left: 0 !important;
    margin-top: 16px !important; 
    width: 80% !important; /* Evita que un botón colapse toda la pantalla a lo ancho */
    max-width: 300px;
  }
}



/* --- REPRODUCTOR DE VIDEO --- */
.mws-video-player-frame {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 25px auto;
}

.mws-video-player-frame video {
  width: 100%;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  aspect-ratio: 16 / 9;
  display: block;
}

/* --- GRIDS DE VIDEOS E IMÁGENES --- */
.mws-video-grid, .mws-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  width: 100%;
}

.mws-video-card, .mws-image-card {
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease;
}

.mws-video-card:hover, .mws-image-card:hover {
  transform: translateY(-2px); /* Efecto sutil ergonómico al pasar el cursor */
}

.mws-card-poster, .mws-card-image-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1e1e1e;
  position: relative;
}

.mws-card-poster img, .mws-card-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mws-card-body {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.mws-card-body h5 {
  margin: 0;
  font-size: 13px;
  color: var(--text-dark);
  font-weight: 700;
}

.mws-card-body h5 a {
  color: inherit;
  text-decoration: none;
}

.mws-video-description, .mws-image-description {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* --- CONTENEDORES INTERNOS Y SISTEMA DE FILAS --- */
.mws-grid-container {
  width: 100%;
}

.mws-grid-rendered-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.mws-grid-row {
  display: flex;
  gap: 20px;
  width: 100%;
  flex-wrap: wrap;
}

.mws-grid-cell {
  flex: 1;
  min-width: 240px;
}

/* Texto de descripción o párrafos largos */
.mws-grid-cell p {
  margin: 0;
  text-align: justify;
  font-size: 14px;
  color: var(--text-dark);
}

/* --- SECCIÓN DE VOTACIÓN (Likes/Dislikes) --- */
.mws-voting-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.mws-voting-wrapper form {
  margin: 0;
}

.mws-voting-wrapper .button {
  color: var(--text-light);
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s ease;
}

.mws-voting-wrapper .button:hover {
  opacity: 0.9;
}

.mws-voting-wrapper button[name="dsh_like"] {
  background-color: var(--btn-success);
}

.mws-voting-wrapper button[name="dsh_dislike"] {
  background-color: var(--btn-danger);
}

/* Contenedor Búnker de la IA */
.mws-ai-container {
    background: rgba(14, 13, 33, 0.75);
    border: 1px solid rgba(0, 242, 254, 0.25);
    border-radius: 12px;
    padding: 24px;
    max-width: 600px;
    margin: 20px auto;
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.1), inset 0 0 15px rgba(79, 172, 254, 0.05);
    backdrop-filter: blur(10px);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    position: relative;
    overflow: hidden;
}

/* Decoración de esquina Sci-Fi (Línea de estado superior) */
.mws-ai-container::before {
    content: "MWS CORE CORE_AI_v2.06";
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    color: #0e0d21;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 2px 10px;
    border-bottom-left-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

/* Área de Texto Estilo Consola Cuántica */
.mws-ai-textarea {
    width: 100%;
    height: 120px;
    background: #090815;
    color: #00f2fe;
    border: 1px solid #1a1936;
    border-radius: 6px;
    padding: 14px;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    box-sizing: border-box;
    transition: all 0.3s ease;
    font-family: \'Consolas\', \'Courier New\\\', monospace;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Enfoque Neón Elástico del Textarea */
.mws-ai-textarea:focus {
    outline: none;
    border-color: #00f2fe;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3), inset 0 1px 5px rgba(0, 242, 254, 0.1);
    color: #ffffff;
}

/* Marcador de posición (Placeholder) */
.mws-ai-textarea::placeholder {
    color: #4a4968;
    font-style: italic;
}

/* Botón Reactor de Fusión de Voz */
.mws-btn-speak {
    width: 100%;
    margin-top: 16px;
    padding: 14px 20px;
    background: linear-gradient(45deg, #00f2fe 0%, #4facfe 100%);
    border: none;
    border-radius: 6px;
    color: #0e0d21;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
    position: relative;
}

/* Efecto de Brillo Flotante (Hover) */
.mws-btn-speak:hover {
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.6);
    transform: translateY(-2px);
}

/* Presión de botón por hardware */
.mws-btn-speak:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 242, 254, 0.4);
}

/* Estilo de Estado: Procesando / Hablando */
.mws-btn-speak.speaking {
    background: linear-gradient(45deg, #ff416c 0%, #ff4b2b 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 0 25px rgba(255, 75, 43, 0.6) !important;
    animation: mwsPulseGlow 1.5s infinite ease-in-out;
}

/* Animación de Ondas de Pulso para Simular Cómputo de la IA */
@keyframes mwsPulseGlow {
    0% { filter: drop-shadow(0 0 5px rgba(255, 75, 43, 0.4)); }
    50% { filter: drop-shadow(0 0 20px rgba(255, 75, 43, 0.8)); }
    100% { filter: drop-shadow(0 0 5px rgba(255, 75, 43, 0.4)); }
}

/* 🚀 EFECTO EN CALIENTE: Animación de desvanecimiento y empuje vertical */
@keyframes mwsFadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Clase maestra que hereda la aceleración por hardware de la GPU */
.mws-animated-viewport {
    animation: mwsFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    will-change: transform, opacity;
}

/* 🎉 EFECTO HOVER PREMIUM: Escalado elástico para tus 4 tarjetas en PC */
.mws-card-portfolio:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    border-color: #3498db !important;
}

/* 🛡️ ESTADO OCULTO GENERAL: Invisible y desplazado 30px hacia abajo */
.mws-reveal-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    /* Fuerza al navegador a preparar los Chunks visuales en la tarjeta gráfica */
    will-change: transform, opacity; 
}

/* 🚀 ESTADO VISIBLE: Activador de entrada suave inmutable */
.mws-reveal-show {
    opacity: 1;
    transform: translateY(0) !important;
}

/* 🧠 EFECTO CASCADA: Delays estratégicos para los elementos superiores fijos */
header.mws-reveal-hidden {
    transition-delay: 0.0s;
}
nav.mws-reveal-hidden {
    transition-delay: 0.15s;
}
main.mws-reveal-hidden {
    transition-delay: 0.25s;
}




/* 🚀 SISTEMA TIPOGRÁFICO Y CANDADOS DE CAJA */
.mws-document-root {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #2c3e50;
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* 🎭 TEXTO DE INTRODUCCIÓN COHESIVO (Página 1) */
.mws-intro-box {
    font-size: 15px;
    text-align: justify;
    color: #34495e;
    margin-bottom: 35px;
    border-left: 4px solid #27ae60;
    padding-left: 20px;
    background: rgba(255, 255, 255, 0.02);
}

.mws-intro-box p {
    margin-bottom: 12px;
}

/* 🛠️ CONTENEDOR DE LA SUITE DE INGENIERÍA (Páginas 1 y 2) */
.mws-suite-container {
    background: #fafbfc;
    border: 1px solid #e1e4e6;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.01);
}

.mws-suite-container h2 {
    color: #111;
    font-size: 20px;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 15px;
    letter-spacing: -0.3px;
}

/* LISTADO MODULAR EN FILAS COMPACTAS (Página 2) */
.mws-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mws-feature-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px 20px;
    font-size: 13px;
    text-align: justify;
    color: #555;
    border-left: 3px solid #2980b9;
}

/* 🖼️ REJILLA DE PORTAFOLIO PREMIUM CENTRADA (Páginas 3, 4 y 5) */
mws-portfolio-grid.mws-animated-viewport {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    gap: 24px !important;
    width: 100% !important;
    max-width: 1200px !important;
    box-sizing: border-box !important;
    margin: 40px auto !important;
    padding: 0 !important;
}

.mws-card-portfolio {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* 🕹️ EFECTO HOVER ELÁSTICO PARA TUS 4 CARDS EN PC */
.mws-card-portfolio:hover {
    transform: translateY(-5px) scale(1.02) !important;
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.08) !important;
    border-color: #3498db !important;
}

/* 🔮 CIERRE CIBER-PUNK (Página 5) */
.mws-future-banner {
    background: #0f0e1e;
    border: 1px solid rgba(0, 242, 254, 0.2);
    border-radius: 8px;
    padding: 30px;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(0,242,254,0.05);
}

.mws-future-banner h2 {
    color: #00f2fe;
    font-size: 22px;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.mws-future-banner p {
    font-size: 13px;
    color: #94a3b8;
    text-align: justify;
    margin-bottom: 12px;
    line-height: 1.6;
}

@keyframes mwsDocReveal {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.mws-animated-viewport {
    animation: mwsDocReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
    will-change: transform, opacity;
}

.mws-card-portfolio {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease !important;
}

.mws-card-portfolio:hover {
    transform: translateY(-5px) scale(1.02) !important;
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.08) !important;
    border-color: #3498db !important;
}