/** 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;
  }
}
