/**
 * GDPR Cookie Consent - Estils
 * Sistema de consentiment de cookies GDPR-compliant
 */

/* Bloquejar scroll quan el banner està visible */
body.gdpr-no-scroll {
  overflow: hidden;
}

/* ==================== COOKIE BANNER ==================== */

/* Overlay bloquejant */
#gdpr-banner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 9998;
  display: none;
}

#gdpr-banner-overlay.show {
  display: block;
}

#gdpr-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #8b0a2e 0%, #a50634 100%);
  color: #ffffff;
  padding: 1.5rem;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  display: none;
  animation: slideUp 0.4s ease-out;
}

#gdpr-cookie-banner.show {
  display: block;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.gdpr-banner-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gdpr-banner-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gdpr-banner-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.gdpr-banner-message {
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
  opacity: 0.95;
}

.gdpr-banner-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.gdpr-btn {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.gdpr-btn-primary {
  background-color: #10b981;
  color: #ffffff;
}

.gdpr-btn-primary:hover {
  background-color: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.gdpr-btn-secondary {
  background-color: #ef4444;
  color: #ffffff;
}

.gdpr-btn-secondary:hover {
  background-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.gdpr-btn-tertiary {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.gdpr-btn-tertiary:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.gdpr-banner-link {
  color: #ffffff;
  text-decoration: underline;
  font-size: 0.875rem;
  opacity: 0.9;
  margin-left: auto;
}

.gdpr-banner-link:hover {
  opacity: 1;
  text-decoration: none;
}

/* ==================== COOKIE SETTINGS MODAL ==================== */

.gdpr-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.gdpr-modal {
  background: #ffffff;
  border-radius: 0.75rem;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.gdpr-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gdpr-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.gdpr-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
}

.gdpr-modal-close:hover {
  background-color: #f3f4f6;
  color: #1f2937;
}

.gdpr-modal-body {
  padding: 1.5rem;
}

.gdpr-modal-description {
  color: #6b7280;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.gdpr-category {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.gdpr-category:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.gdpr-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.gdpr-category-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.gdpr-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.gdpr-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.gdpr-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: 0.3s;
  border-radius: 24px;
}

.gdpr-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.gdpr-toggle input:checked + .gdpr-toggle-slider {
  background-color: #3b82f6;
}

.gdpr-toggle input:checked + .gdpr-toggle-slider:before {
  transform: translateX(24px);
}

.gdpr-toggle input:disabled + .gdpr-toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.gdpr-category-description {
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.gdpr-category-cookies {
  font-size: 0.8rem;
  color: #9ca3af;
  font-style: italic;
}

.gdpr-modal-footer {
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.gdpr-btn-modal {
  padding: 0.625rem 1.5rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gdpr-btn-modal-primary {
  background-color: #3b82f6;
  color: #ffffff;
}

.gdpr-btn-modal-primary:hover {
  background-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* ==================== FOOTER LINK ==================== */

.gdpr-footer-link {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.gdpr-footer-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ==================== RESPONSIVE ==================== */

@media (min-width: 768px) {
  .gdpr-banner-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .gdpr-banner-content {
    flex: 1;
    margin-right: 1rem;
  }

  .gdpr-banner-actions {
    flex-shrink: 0;
  }

  .gdpr-banner-link {
    margin-left: 0;
  }
}

@media (max-width: 767px) {
  #gdpr-cookie-banner {
    padding: 1rem;
  }

  .gdpr-banner-title {
    font-size: 1.1rem;
  }

  .gdpr-banner-message {
    font-size: 0.875rem;
  }

  .gdpr-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .gdpr-modal {
    width: 95%;
    max-height: 90vh;
  }

  .gdpr-modal-header,
  .gdpr-modal-body,
  .gdpr-modal-footer {
    padding: 1rem;
  }

  .gdpr-modal-title {
    font-size: 1.25rem;
  }
}
