/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* Contenedor principal */
.idea-product-reviewer-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
}

/* Grid de productos */
.idea-products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .idea-products-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Tarjeta de producto */
.idea-product-card {
  display: flex;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

/* Imagen del producto */
.idea-product-image {
  width: 33.33%;
  min-width: 160px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3%;
}

.idea-product-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 4px;
  transition: transform 0.3s ease;
}

/* Contenido del producto */
.idea-product-content {
  padding: 20px;
  width: 66.67%;
}

.idea-product-title {
  margin: 0 0 10px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.idea-product-description {
  color: #666;
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.idea-product-description.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.idea-toggle-description {
  background: none;
  border: none;
  color: #14baa6;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: underline;
  padding: 0;
  margin-bottom: 12px;
  display: none;
}

.idea-toggle-description:hover {
  color: #1c796e;
}

.idea-toggle-description:focus-visible {
  border: none;
}

.idea-product-url {
  display: inline-block;
  text-decoration: none;
  font-size: 16px;
}

/* Enlace del producto */
.idea-product-link {
  margin-bottom: 15px;
}

/* Sistema de valoración */
.idea-product-rating {
  border-top: none;
  padding-top: 0;
  margin-top: 12px;
}

/* Formulario de valoración */
.idea-review-form {
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.idea-rating-input {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.idea-rating-input label {
  margin-bottom: 0;
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
  white-space: nowrap;
}

.idea-comment-input {
  margin-bottom: 12px;
}

.idea-comment-input label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
}

/* Estrellas interactivas */
.idea-stars-input {
  display: flex;
  gap: 2px;
  margin-bottom: 0;
  transform: scale(2);
  transform-origin: left;
}

.idea-star-input {
  font-size: 1.5rem;
  color: #ddd;
  cursor: pointer;
  transition:
    color 0.2s ease,
    transform 0.1s ease;
}

.idea-star-input:hover,
.idea-star-input.selected {
  color: #ffb300;
  transform: scale(1.1);
}

/* Campo de comentario */
.idea-comment {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.idea-comment:focus {
  outline: none;
  border-color: #001e42;
}

/* Botón de enviar valoración */
.idea-submit-review {
  display: inline-block;
  padding: 10px 10px;
  border: none;
  border-radius: 4px;
  font-size: 16px !important;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
  background: #14baa6;
  color: #fff;
}

.idea-submit-review:hover {
  background: #1c796e;
}

.idea-submit-review:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Mensaje de gracias */
.idea-review-thanks {
  font-size: 0.85rem;
  color: #999;
  font-weight: 400;
}

/* Paginación */
.idea-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.idea-page-number {
  display: inline-block;
  padding: 10px 14px;
  background: #fff;
  color: #001e42;
  text-decoration: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.idea-page-number:hover {
  background: #f0f8ff;
  border-color: #001e42;
}

.idea-page-number.current {
  background: #001e42;
  color: #fff;
  border-color: #001e42;
}

/* Estados de carga y mensajes */
.idea-loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.idea-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #001e42;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Mensajes de éxito/error */
.idea-message {
  padding: 12px 16px;
  border-radius: 4px;
  margin-top: 10px;
  font-weight: 500;
  display: none;
}

.idea-message.success {
  background: #e8f5e8;
  color: #2e7d32;
  border: 1px solid #c3e6c3;
}

.idea-message.error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* Responsive */
@media (max-width: 768px) {
  .idea-product-reviewer-container {
    padding: 10px;
  }

  .idea-products-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .idea-product-card {
    flex-direction: column;
  }

  .idea-product-image {
    width: 100%;
    min-width: unset;
    padding: 10px;
  }

  .idea-product-image img {
    height: 180px;
    width: auto;
  }

  .idea-product-content {
    padding: 15px;
    width: 100%;
  }

  .idea-product-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
  }

  .idea-product-description {
    font-size: 0.9rem;
    margin-bottom: 10px;
  }

  .idea-product-url {
    font-size: 0.9rem;
  }

  .idea-rating-input label {
    font-size: 0.85rem;
  }

  .idea-stars-input {
    transform: scale(1.5);
    transform-origin: left;
  }

  .idea-comment-input label {
    font-size: 0.85rem;
  }

  .idea-comment {
    font-size: 0.85rem;
    padding: 8px;
  }

  .idea-submit-review {
    font-size: 0.9rem !important;
    padding: 8px 12px;
  }

  .idea-toggle-description {
    font-size: 0.85rem;
    margin-bottom: 10px;
  }

  .idea-pagination {
    gap: 4px;
    margin-top: 20px;
  }

  .idea-page-number {
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  .idea-message {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .idea-product-reviewer-container {
    padding: 5px;
  }

  .idea-products-grid {
    gap: 10px;
  }

  .idea-product-image {
    padding: 5px;
  }

  .idea-product-image img {
    height: 160px;
    width: auto;
  }

  .idea-product-content {
    padding: 10px;
  }

  .idea-product-title {
    font-size: 1rem;
  }

  .idea-product-description {
    font-size: 0.85rem;
  }

  .idea-product-url {
    font-size: 0.85rem;
  }

  .idea-rating-input label {
    font-size: 0.8rem;
  }

  .idea-stars-input {
    transform: scale(1.2);
  }

  .idea-comment-input label {
    font-size: 0.8rem;
  }

  .idea-comment {
    font-size: 0.8rem;
    padding: 6px;
  }

  .idea-submit-review {
    font-size: 0.85rem !important;
    padding: 6px 10px;
  }

  .idea-toggle-description {
    font-size: 0.8rem;
    margin-bottom: 8px;
  }

  .idea-pagination {
    gap: 2px;
  }

  .idea-page-number {
    padding: 6px 8px;
    font-size: 0.8rem;
  }

  .idea-message {
    padding: 8px 10px;
    font-size: 0.8rem;
  }
}

/* Animaciones */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.idea-product-card {
  animation: fadeIn 0.3s ease-out;
}

.idea-product-card:nth-child(1) {
  animation-delay: 0.1s;
}
.idea-product-card:nth-child(2) {
  animation-delay: 0.2s;
}
.idea-product-card:nth-child(3) {
  animation-delay: 0.3s;
}
.idea-product-card:nth-child(4) {
  animation-delay: 0.4s;
}
.idea-product-card:nth-child(5) {
  animation-delay: 0.5s;
}
.idea-product-card:nth-child(6) {
  animation-delay: 0.6s;
}
