/** MWS Dynamic CSS File: CSS+Layout+Flexbox [Grupo: css] (ID: 2) */
* {
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text-dark);
  background-color: var(--bg-main);
  margin: 0;
  line-height: 1.6; /* Mejora la lectura del texto continuo */
}

/* Soporte para el elemento personalizado */
mws-users {
  display: block;
}

/* Style the header */
header {
  background-color: var(--primary);
  padding: 10px;
  text-align: center;
  color: var(--text-light);
}

header h1 {
  margin: 0;
  font-size: 20px;
}

header .headnav {
    width: 100%;
    list-style: none;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
}

header .headnav li a {
    text-decoration: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    font-weight: 500;
}

/*header .headnav li:last-child { margin-left: auto; }*/

header .headnav button {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.3s;
}

header .headnav button:hover { background: #c0392b; }

/* Container for flexboxes y layout principal */
section {
  display: -webkit-flex;
  display: flex;
  flex-wrap: wrap; /* Permite un quiebre limpio en pantallas pequeñas */
}

/* Style the navigation menu */
nav {
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
  min-width: 200px;
  background-color: var(--bg-nav);
  padding: 20px;
}

/* Style the list inside the menu */
nav ul.navbar-nav-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

nav .nav-link {
  text-decoration: none;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
}

/* El elemento principal (Reemplaza a article en tu nuevo HTML) */
main {
  -webkit-flex: 3;
  -ms-flex: 3;
  flex: 3;
  min-width: 300px;
  background-color: var(--bg-card);
  padding: 25px;
}

/* Barra lateral interactiva */
aside {
  -webkit-flex: 1.5;
  -ms-flex: 1.5;
  flex: 1.5;
  min-width: 260px;
  background-color: var(--bg-main);
  padding: 20px;
  border-left: 1px solid var(--border-color);
}

/* --- 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);
}

/* Style the footer */
footer {
  background-color: var(--primary-dark);
  padding: 20px;
  text-align: center;
  color: var(--text-light);
}

footer .name {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 5px;
}

footer .description {
  font-size: 11px;
  opacity: 0.8;
  white-space: pre-line; /* Mantiene los saltos de línea del perfil */
}

/* Responsive layout */
@media (max-width: 800px) {
  section {
    flex-direction: column;
  }
  
  nav, main, aside {
    width: 100%;
    flex: none;
    border-left: none;
  }
}

    /* 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)); }
    }