/* ========================================================
   1. FUENTES
======================================================== */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap');

/* ========================================================
   2. RESET GENERAL
======================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


/* ========================================================
   4. LAYOUT GENERAL
======================================================== */
.layout {
  display: flex;
  gap: 40px;
  margin: 40px auto;
  max-width: 1200px;
  align-items: flex-start;
  justify-content: center;
}

/* ========================================================
   5. FORMULARIO DE OPINIÓN
======================================================== */
.izquierda {
  flex: 0 0 400px;
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
}

.izquierda h3 {
  font-size: 1.4em;
  margin-bottom: 20px;
}

.izquierda form label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
}

.izquierda input[type="text"] {
  width: 100%;
  height: 45px;
  font-size: 1.1em;
  padding: 8px 10px;
  margin-bottom: 15px;
  box-sizing: border-box;
}

.izquierda textarea {
  width: 100%;
  height: 140px;
  font-size: 1.1em;
  padding: 10px;
  margin-bottom: 20px;
  box-sizing: border-box;
  resize: vertical;
}

.izquierda input[type="radio"] {
  display: block;
  margin: 6px 0;
}

.izquierda button {
  padding: 10px 20px;
  background: #4a90e2;
  color: white;
  border: none;
  font-size: 1em;
  border-radius: 4px;
  cursor: pointer;
}

.izquierda button:hover {
  background-color: #357ac8;
}

/* ========================================================
   6. CONTENIDO PRINCIPAL - OPINIONES
======================================================== */
main.contenido {
  flex: 0 0 500px;
  max-height: 600px;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

main.contenido h2 {
  text-align: center;
  margin-bottom: 30px;
}

/* Opinión individual */
.opinion {
  cursor: pointer;
  padding: 15px;
  border-radius: 6px;
  background: #fff;
  margin-bottom: 20px;
  box-shadow: 0 0 5px rgba(0,0,0,0.05);
  transition: background-color 0.2s ease;
}

.opinion:hover {
  background-color: #e8f0fe;
}

/* Respuesta administrador */
.respuesta-admin {
  margin-top: 10px;
  padding: 8px;
  background: #f0f4ff;
  border-left: 3px solid #4a90e2;
  font-style: italic;
  font-size: 0.9em;
}

/* ========================================================
   7. POPUP
======================================================== */
#popup-opinion {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#popup-opinion.active {
  display: flex;
}

#popup-opinion .contenido-popup {
  background: white;
  max-width: 500px;
  padding: 20px;
  border-radius: 8px;
  overflow-y: auto;
  max-height: 80vh;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  position: relative;
}

/* Botón cerrar */
#popup-opinion .cerrar-popup {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 20px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #333;
}

/* ========================================================
   8. aside derecho
======================================================== */

.derecha {
  flex: 0 0 280px; /* un poco más ancho para espacio */
  background: #f0f0f0;
  padding: 20px 15px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.12);
  font-family: 'Oswald', sans-serif;
  color: #333;
}

/* Título del apartado */
.derecha h3 {
  text-align: center;
  font-weight: 700;
  margin-bottom: 20px;
  font-size: 1.25em;
  color: #4a90e2;
  text-transform: uppercase;
  letter-spacing: 1.1px;
}

/* Lista de estadísticas - aunque la quitamos, si quieres usarla en otro sitio */
.estadisticas-estrellas {
  list-style: none;
  padding: 0;
  margin: 0 0 15px 0;
}

.estadisticas-estrellas li {
  padding: 6px 0;
  font-size: 1.05em;
  border-bottom: 1px solid #ddd;
}

/* Estilo para el canvas del gráfico */
.derecha canvas#graficoEstrellas {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.25);
  padding: 12px;
}

/* ========================================================
   9. FORMULARIO DE RESPUESTA DEL ADMINISTRADOR
======================================================== */

.respuesta-form {
  margin-top: 12px;
  padding: 12px;
  background-color: #f9fafb;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-family: 'Oswald', sans-serif;
  color: #334155;
}

.respuesta-form textarea {
  width: 100%;
  min-height: 90px;
  font-size: 1em;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #94a3b8;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.respuesta-form textarea:focus {
  border-color: #4a90e2;
  outline: none;
  background-color: #ffffff;
}

.respuesta-form button {
  margin-top: 10px;
  padding: 10px 22px;
  background-color: #4a90e2;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 1em;
}

.respuesta-form button:hover {
  background-color: #357abd;
}

.respuesta-mensaje {
  margin-top: 8px;
  font-size: 0.9em;
  color: #22c55e; /* verde para éxito */
}

.respuesta-mensaje.error {
  color: #ef4444; /* rojo para error */
}

/* ========================================================
   10. estrellas en fila horizontal 
======================================================== */
.estrellas {
  display: flex;
  gap: 4px;
  font-size: 1.5em;
  cursor: pointer;
  margin-top: 0.5em;
  perspective: 300px;
}

.estrella {
  color: #ccc; /* gris por defecto */
  transition: color 0.2s ease, transform 0.3s ease, text-shadow 0.3s ease;
  user-select: none;
  transform-origin: center bottom;
  text-shadow: 1px 1px 2px #999;
}

/* Estrellas pintadas en amarillo (seleccionadas o hover) */
.estrella.pintada {
  color: #ffc107; /* amarillo */
  transform: rotateX(20deg) scale(1.2);
  text-shadow:
    0 0 8px #ffd54f,
    0 0 15px #ffb300;
}


/* ========================================================
   11 Panel de administración de comentarios
   Añadido a css/opiniones.css
======================================================== */

body {
    font-family: Arial, sans-serif;
    margin: 30px;
    /*background: #f7f9fc;*/
}

h1 {
    color: #4a90e2;
    text-align: center;
    margin-bottom: 40px;
}

.comentario {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 25px;
}

.comentario p {
    margin: 8px 0;
}

.comentario strong {
    color: #333;
}

.comentario small {
    color: #666;
}

form {
    margin-top: 15px;
}

textarea {
    width: 100%;
    resize: vertical;
    min-height: 70px;
    font-family: Arial, sans-serif;
    font-size: 1em;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

button {
    margin-top: 8px;
    background: #4a90e2;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s ease;
}

button:hover {
    background: #357ac8;
}



/* ========================================================
   12. RESPONSIVE DESIGN
======================================================== */
@media (max-width: 992px) {
  .layout {
    flex-direction: column;
    align-items: stretch; /* que tome todo el ancho disponible */
    padding: 10px 15px;
  }

  .izquierda,
  main.contenido,
  .derecha {
    flex: 1 1 100%;
    max-width: 100%;
    margin: 0 0 25px 0; /* espacio vertical entre bloques */
  }

  .izquierda {
    margin-bottom: 25px;
  }

  main.contenido {
    max-height: none;
    overflow-y: visible;
  }

  .derecha {
    padding: 15px;
    box-shadow: none; /* para evitar sombras raras en móvil */
    border-radius: 0;
    background: #fafafa;
  }
}

@media (max-width: 576px) {
  /* Ajustes para inputs y textarea más cómodos */
  .izquierda input[type="text"],
  .izquierda textarea {
    font-size: 1em;
  }

  /* Botón ocupa todo el ancho para mejor usabilidad táctil */
  .izquierda button {
    width: 100%;
    font-size: 1em;
  }

  /* Popup ancho casi completo */
  #popup-opinion .contenido-popup {
    width: 90%;
    padding: 15px;
  }

  /* Reducir padding general para más espacio en pantalla chica */
  .izquierda,
  main.contenido,
  .derecha {
    padding-left: 10px;
    padding-right: 10px;
  }
}




/* ========================================================
   fin de css, creado por FELIX OLIVAN MAYORAL
======================================================== */