/* ============================================
   🍪 COOKIE CONSENT BANNER - GROW ACADEMY
   ============================================ */

/* Overlay backdrop */
.cookie-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 999998;
  animation: fadeIn 0.3s ease;
}

.cookie-overlay.show {
  display: block;
}

/* Cookie banner container */
.cookie-consent-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  color: white;
  padding: 24px;
  box-shadow: 0 -8px 32px rgba(124, 58, 237, 0.4);
  z-index: 999999;
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 3px solid rgba(255, 255, 255, 0.2);
}

.cookie-consent-banner.show {
  display: block;
}

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

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

/* Content wrapper */
.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* Icon */
.cookie-icon {
  font-size: 48px;
  flex-shrink: 0;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Text content */
.cookie-text {
  flex: 1;
  min-width: 280px;
}

.cookie-text h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
}

.cookie-text p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.95;
}

.cookie-text .cookie-required {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #fca5a5;
}

/* Buttons container */
.cookie-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cookie-btn {
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cookie-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Accept button */
.cookie-btn-accept {
  background: white;
  color: #7c3aed;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cookie-btn-accept:hover:not(:disabled) {
  background: #f3f4f6;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Reject button */
.cookie-btn-reject {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.cookie-btn-reject:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Settings button */
.cookie-btn-settings {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.cookie-btn-settings:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Modal de configuración */
.cookie-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  color: #1f2937;
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 1000000;
  animation: modalAppear 0.3s ease;
}

.cookie-modal.show {
  display: block;
}

@keyframes modalAppear {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.cookie-modal-header {
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: white;
  border-radius: 16px 16px 0 0;
}

.cookie-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
}

.cookie-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.cookie-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.cookie-modal-body {
  padding: 24px;
}

.cookie-category {
  margin-bottom: 20px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cookie-category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: #1f2937;
}

.cookie-category-icon {
  font-size: 18px;
  color: #7c3aed;
}

.cookie-category-desc {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

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

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

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

.cookie-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
}

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

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

.cookie-required-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cookie-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  background: #f9fafb;
  border-radius: 0 0 16px 16px;
}

/* Warning message cuando se rechaza */
.cookie-warning {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  color: #1f2937;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 1000001;
  text-align: center;
  animation: modalAppear 0.3s ease;
}

.cookie-warning.show {
  display: block;
}

.cookie-warning-icon {
  font-size: 64px;
  color: #ef4444;
  margin-bottom: 16px;
}

.cookie-warning h3 {
  margin: 0 0 12px 0;
  font-size: 22px;
  font-weight: 600;
  color: #1f2937;
}

.cookie-warning p {
  margin: 0 0 24px 0;
  font-size: 15px;
  color: #6b7280;
  line-height: 1.6;
}

.cookie-warning-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
  .cookie-consent-banner {
    padding: 20px 16px;
  }

  .cookie-content {
    flex-direction: column;
    gap: 16px;
  }

  .cookie-icon {
    font-size: 36px;
  }

  .cookie-text h3 {
    font-size: 18px;
  }

  .cookie-text p {
    font-size: 13px;
  }

  .cookie-buttons {
    width: 100%;
  }

  .cookie-btn {
    flex: 1;
    justify-content: center;
    padding: 12px 16px;
    font-size: 14px;
  }

  .cookie-modal {
    width: 95%;
    max-height: 85vh;
  }

  .cookie-modal-header {
    padding: 20px 16px;
  }

  .cookie-modal-body {
    padding: 20px 16px;
  }

  .cookie-warning {
    width: 95%;
    padding: 24px 20px;
  }
}

@media (max-width: 480px) {
  .cookie-buttons {
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
  }
}
