:root {
  --color-bg: #000;
  --color-surface: #111;
  --color-card: #1a1a1a;
  --color-accent: #0056ff;
  --color-accent-hover: #003ecb;
  --color-text: #f3f3f3;
  --color-muted: #a0a0a0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

/* Overlay oscuro */
#cookie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9998;
  display: none;
}
#cookie-overlay.show {
  display: block;
}

/* Banner principal */
#cookie-banner {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface);
  border-radius: 16px;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  max-width: 90%;
  width: 500px;
  z-index: 9999;
  display: none;
  animation: fadeIn 0.5s ease-out;
}
#cookie-banner.show {
  display: block;
}

.cookie-header h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.cookie-text p {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 1rem;
}

.cookie-text a {
  color: var(--color-accent);
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.cookie-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.cookie-btn-configure {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}

.cookie-btn-configure:hover {
  background: rgba(0, 86, 255, 0.1);
}

.cookie-btn-accept {
  background: var(--color-accent);
  color: #fff;
}

.cookie-btn-accept:hover {
  background: var(--color-accent-hover);
}

/* Modal de configuración */
#cookie-settings-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 95%;
  max-width: 900px;
  height: 90%;
  max-height: 600px;
  background: var(--color-surface);
  border-radius: 16px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  overflow: hidden;
  animation: scaleIn 0.5s ease-out;
}
#cookie-settings-modal.show {
  display: flex;
}

.settings-container {
  display: flex;
  height: 100%;
}

/* Sidebar */
.settings-sidebar {
  width: 30%;
  min-width: 250px;
  background: var(--color-card);
  padding: 2rem;
  border-right: 1px solid #222;
  display: flex;
  flex-direction: column;
}

.settings-sidebar .logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-accent);
  margin-bottom: 2rem;
}

.settings-sidebar h2 {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--color-text);
}

.sidebar-menu {
  list-style: none;
  padding: 0;
}

.sidebar-menu li {
  margin-bottom: 0.5rem;
}

.menu-item {
  width: 100%;
  padding: 0.7rem 1rem;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--color-muted);
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}

.menu-item:hover,
.menu-item.active {
  background: rgba(0, 86, 255, 0.1);
  color: var(--color-text);
}

.menu-item.active {
  font-weight: bold;
  border-left: 3px solid var(--color-accent);
}

/* Contenido */
.settings-content {
  flex-grow: 1;
  padding: 2rem;
  position: relative;
  overflow-y: auto;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  color: var(--color-muted);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  transition: 0.3s;
}
.close-modal:hover {
  color: var(--color-accent);
}

.content-section {
  display: none;
}
.content-section.active {
  display: block;
}

.content-section h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.content-section p {
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

.content-section .update-date {
  font-size: 0.8rem;
  margin-bottom: 2rem;
}

/* Categoría de cookie */
.cookie-category {
  background: #222;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 2rem;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.category-header h4 {
  font-size: 1rem;
  color: var(--color-text);
}

.required-badge {
  font-size: 0.7rem;
  background: var(--color-accent);
  color: #fff;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 10px;
}

.category-description {
  font-size: 0.85rem;
  margin-bottom: 0 !important;
}

/* Switch (Toggle) */
.switch {
  position: relative;
  display: inline-block;
  width: 45px;
  height: 22px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #444;
  border-radius: 34px;
  transition: 0.3s;
}
.slider:before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}
input:checked + .slider {
  background: var(--color-accent);
}
input:checked + .slider:before {
  transform: translateX(22px);
}

/* Botones generales */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #222;
  padding-top: 1rem;
  margin-top: 1rem;
}
.btn-primary,
.btn-secondary {
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  font-weight: bold;
  cursor: pointer;
  margin: 5px;
  transition: 0.3s;
}
.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-accent-hover);
}
.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}
.btn-secondary:hover {
  background: rgba(0, 86, 255, 0.1);
}

/* Botón flotante de configuración */
#cookie-config-btn {
  position: fixed;
  bottom: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  border: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 9997;
  display: none;
  transition: 0.3s;
}
#cookie-config-btn.show {
  display: block;
}
#cookie-config-btn:hover {
  background: var(--color-accent-hover);
  transform: scale(1.05);
}
#cookie-config-btn svg {
  fill: currentColor;
  width: 24px;
  height: 24px;
  display: block;
  margin: 10px auto;
}

/* Animaciones */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Responsividad */
@media (max-width: 768px) {
  #cookie-banner {
    bottom: 10px;
    padding: 1rem;
  }
  .cookie-buttons {
    flex-direction: column;
    gap: 5px;
  }
  .cookie-btn {
    width: 100%;
  }

  #cookie-settings-modal {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
  .settings-container {
    flex-direction: column;
  }
  .settings-sidebar {
    width: 100%;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid #222;
    padding: 1.5rem;
  }
  .settings-content {
    padding: 1.5rem;
  }
  .sidebar-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
  .sidebar-menu li {
    flex: 1 1 auto;
    margin: 0;
  }
  .menu-item {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    text-align: center;
  }
  .modal-actions {
    flex-direction: column;
  }
}