/**
 * @file
 * CSS for Consent Mode v3 cookie banner.
 * 
 * Responsive, accessible, and customizable cookie consent banner.
 */

/* ==================================================
   BANNER BASE STYLES
   ================================================== */

.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 999999;
  background: #2c3e50;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* Posicionamiento */
.consent-banner--top {
  top: 0;
  transform: translateY(-100%);
}

.consent-banner--top.consent-banner--visible {
  transform: translateY(0);
}

.consent-banner--bottom {
  bottom: 0;
  transform: translateY(100%);
}

.consent-banner--bottom.consent-banner--visible {
  transform: translateY(0);
}

/* Estados de visibilidad */
.consent-banner--visible {
  opacity: 1;
}

.consent-banner--hidden {
  opacity: 0;
  pointer-events: none;
}

/* ==================================================
   CONTAINER Y LAYOUT
   ================================================== */

.consent-banner__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.consent-banner__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.consent-banner__message {
  flex: 1;
  min-width: 250px;
  margin-bottom: 0;
}

.consent-banner__message p {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
}

.consent-banner__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==================================================
   BOTONES
   ================================================== */

.consent-banner__button {
  background: #3498db;
  color: #ffffff;
  border: 2px solid #3498db;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 100px;
  text-align: center;
  display: inline-block;
  box-sizing: border-box;
}

.consent-banner__button:hover,
.consent-banner__button:focus {
  background: #2980b9;
  border-color: #2980b9;
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.consent-banner__button:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Botón de aceptar */
.consent-banner__button--accept {
  background: #27ae60;
  border-color: #27ae60;
}

.consent-banner__button--accept:hover,
.consent-banner__button--accept:focus {
  background: #219a52;
  border-color: #219a52;
}

/* Botón de rechazar */
.consent-banner__button--reject {
  background: transparent;
  color: #ffffff;
  border-color: #ffffff;
}

.consent-banner__button--reject:hover,
.consent-banner__button--reject:focus {
  background: #ffffff;
  color: #2c3e50;
  border-color: #ffffff;
}

/* ==================================================
   ENLACES
   ================================================== */

.consent-banner__link {
  color: #ecf0f1;
  text-decoration: underline;
  font-size: 13px;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.consent-banner__link:hover,
.consent-banner__link:focus {
  color: #bdc3c7;
  text-decoration: underline;
}

/* ==================================================
   RESPONSIVE DESIGN
   ================================================== */

@media (max-width: 768px) {
  .consent-banner__container {
    padding: 16px;
  }
  
  .consent-banner__content {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .consent-banner__message {
    font-size: 13px;
    min-width: auto;
  }
  
  .consent-banner__actions {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }
  
  .consent-banner__button {
    flex: 1;
    font-size: 13px;
    padding: 12px 16px;
    min-width: auto;
  }
  
  .consent-banner__link {
    width: 100%;
    text-align: center;
    margin-top: 8px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .consent-banner__container {
    padding: 12px;
  }
  
  .consent-banner__content {
    gap: 12px;
  }
  
  .consent-banner__actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .consent-banner__button {
    width: 100%;
    font-size: 14px;
    padding: 14px 20px;
  }
  
  .consent-banner__message {
    font-size: 12px;
  }
}

/* ==================================================
   ACCESIBILIDAD
   ================================================== */

/* Focus visible para usuarios de teclado */
.consent-banner__button:focus,
.consent-banner__link:focus {
  outline: 2px solid #f39c12;
  outline-offset: 2px;
}

/* Reducir movimiento para usuarios con preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .consent-banner {
    transition: opacity 0.3s ease;
  }
  
  .consent-banner--top,
  .consent-banner--bottom {
    transform: none;
  }
  
  .consent-banner__button:hover {
    transform: none;
  }
}

/* Alto contraste */
@media (prefers-contrast: high) {
  .consent-banner {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
  }
  
  .consent-banner__button {
    border-width: 3px;
  }
  
  .consent-banner__button--reject {
    border-color: #ffffff;
    background: #000000;
  }
}

/* ==================================================
   TEMAS ALTERNATIVOS
   ================================================== */

/* Tema claro */
.consent-banner--light {
  background: #ffffff;
  color: #2c3e50;
  border-top: 1px solid #ecf0f1;
}

.consent-banner--light .consent-banner__button--reject {
  color: #2c3e50;
  border-color: #2c3e50;
}

.consent-banner--light .consent-banner__button--reject:hover,
.consent-banner--light .consent-banner__button--reject:focus {
  background: #2c3e50;
  color: #ffffff;
}

.consent-banner--light .consent-banner__link {
  color: #34495e;
}

/* Tema compacto */
.consent-banner--compact .consent-banner__container {
  padding: 12px 20px;
}

.consent-banner--compact .consent-banner__button {
  padding: 8px 16px;
  font-size: 13px;
}

.consent-banner--compact .consent-banner__message {
  font-size: 13px;
}

/* ==================================================
   ESTADOS DE CARGA Y ERROR
   ================================================== */

.consent-banner--loading .consent-banner__button {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
}

.consent-banner--error {
  background: #e74c3c;
}

.consent-banner--success {
  background: #27ae60;
}

/* ==================================================
   ANIMACIONES DE ENTRADA
   ================================================== */

@keyframes slideInFromTop {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slideInFromBottom {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.consent-banner--animated.consent-banner--top.consent-banner--visible {
  animation: slideInFromTop 0.3s ease-out;
}

.consent-banner--animated.consent-banner--bottom.consent-banner--visible {
  animation: slideInFromBottom 0.3s ease-out;
}

.consent-banner--fade-in {
  animation: fadeIn 0.3s ease-out;
}
