/**
 * Estilos del sistema de cookies - WHANGA Media
 * Compatible con el diseño oscuro del sitio
 */

/* ============================================================================
   BANNER DE COOKIES (Primera capa)
   ============================================================================ */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: #0f0f0f;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}

.cookie-banner--visible {
  transform: translateY(0);
}

.cookie-banner__container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .cookie-banner__container {
    flex-direction: row;
    align-items: center;
    padding: 1.5rem 3rem;
  }
}

.cookie-banner__content {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex: 1;
}

.cookie-banner__icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background-color: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-banner__icon-svg {
  width: 1.5rem;
  height: 1.5rem;
  color: #f59e0b;
}

.cookie-banner__text {
  flex: 1;
}

.cookie-banner__title {
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 0.5rem 0;
}

.cookie-banner__description {
  color: #d4d4d8;
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
}

.cookie-banner__link {
  color: #818cf8;
  text-decoration: underline;
  transition: color 0.2s;
}

.cookie-banner__link:hover {
  color: #a5b4fc;
}

.cookie-banner__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

@media (min-width: 640px) {
  .cookie-banner__actions {
    flex-direction: row;
  }
}

@media (min-width: 1024px) {
  .cookie-banner__actions {
    width: auto;
    flex-shrink: 0;
  }
}

.cookie-banner__btn {
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  white-space: nowrap;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.cookie-banner__btn--primary {
  background-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.cookie-banner__btn--primary:hover {
  background-color: #5558e6;
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

.cookie-banner__btn--secondary {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-banner__btn--secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================================================
   PANEL DE CONFIGURACIÓN (Segunda capa)
   ============================================================================ */

.cookie-panel {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}

.cookie-panel--visible {
  opacity: 1;
  pointer-events: auto;
}

.cookie-panel__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.cookie-panel__dialog {
  position: relative;
  background-color: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
  max-width: 42rem;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s ease-in-out;
}

.cookie-panel--visible .cookie-panel__dialog {
  transform: scale(1);
}

/* Header */
.cookie-panel__header {
  position: sticky;
  top: 0;
  background-color: #0f0f0f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 1rem 1rem 0 0;
}

.cookie-panel__title {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0;
}

.cookie-panel__close {
  background: none;
  border: none;
  color: #a1a1aa;
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s;
}

.cookie-panel__close:hover {
  color: #ffffff;
}

.cookie-panel__close svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Body */
.cookie-panel__body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.cookie-panel__intro {
  color: #d4d4d8;
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0 0 1.5rem 0;
}

.cookie-panel__link {
  color: #818cf8;
  text-decoration: underline;
  transition: color 0.2s;
}

.cookie-panel__link:hover {
  color: #a5b4fc;
}

.cookie-panel__categories {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Categorías */
.cookie-panel__category {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.cookie-panel__category--necessary {
  background-color: rgba(34, 197, 94, 0.05);
  border-color: rgba(34, 197, 94, 0.2);
}

.cookie-panel__category-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-panel__category-info {
  flex: 1;
}

.cookie-panel__category-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.cookie-panel__category-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.cookie-panel__category-icon--necessary {
  color: #4ade80;
}

.cookie-panel__category-icon--analytics {
  color: #60a5fa;
}

.cookie-panel__category-icon--marketing {
  color: #c084fc;
}

.cookie-panel__category-title {
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
}

.cookie-panel__category-description {
  color: #a1a1aa;
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
}

.cookie-panel__badge {
  padding: 0.25rem 0.75rem;
  background-color: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #4ade80;
  font-weight: 500;
  white-space: nowrap;
}

/* Toggle Switch */
.cookie-panel__toggle {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  flex-shrink: 0;
}

.cookie-panel__toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-panel__toggle-slider {
  position: relative;
  display: block;
  width: 2.75rem;
  height: 1.5rem;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  transition: background-color 0.2s;
}

.cookie-panel__toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.cookie-panel__toggle-input:checked + .cookie-panel__toggle-slider {
  background-color: #6366f1;
}

.cookie-panel__toggle-input:checked + .cookie-panel__toggle-slider::after {
  transform: translateX(1.25rem);
}

.cookie-panel__toggle-input:focus-visible + .cookie-panel__toggle-slider {
  outline: 2px solid #818cf8;
  outline-offset: 2px;
}

/* Footer */
.cookie-panel__footer {
  position: sticky;
  bottom: 0;
  background-color: #0f0f0f;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-radius: 0 0 1rem 1rem;
}

@media (min-width: 640px) {
  .cookie-panel__footer {
    flex-direction: row;
  }
}

.cookie-panel__btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.cookie-panel__btn--primary {
  background-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.cookie-panel__btn--primary:hover {
  background-color: #5558e6;
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

.cookie-panel__btn--secondary {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-panel__btn--secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================================================
   ACCESIBILIDAD
   ============================================================================ */

/* Focus visible para teclado */
.cookie-banner__btn:focus-visible,
.cookie-panel__btn:focus-visible,
.cookie-panel__close:focus-visible {
  outline: 2px solid #818cf8;
  outline-offset: 2px;
}

/* Reducir movimiento para usuarios con preferencias */
@media (prefers-reduced-motion: reduce) {
  .cookie-banner,
  .cookie-panel,
  .cookie-panel__dialog,
  .cookie-panel__toggle-slider::after {
    transition: none;
  }
}
