/**
 * Cookie Consent Banner Styles
 * Modern dark design matching Energent.ai aesthetic
 */

/* Banner Container - Left side positioned */
.cookie-consent-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99999;
  max-width: 420px;
  transform: translateX(-120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.4s ease;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  pointer-events: none;
}

.cookie-consent-banner.visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.cookie-consent-banner.hiding {
  transform: translateX(-120%);
  opacity: 0;
}

/* Main Content Container - Dark theme */
.cookie-consent-content {
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(59, 130, 246, 0.05),
    0 0 60px rgba(59, 130, 246, 0.08);
}

/* Text Section */
.cookie-consent-text {
  margin-bottom: 1.25rem;
}

.cookie-consent-text h3 {
  margin: 0 0 0.625rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #60a5fa;
  letter-spacing: -0.01em;
}

.cookie-consent-text p {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(148, 163, 184, 0.9);
  line-height: 1.6;
}

/* Action Buttons Container */
.cookie-consent-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}

/* Base Button Styles */
.cookie-consent-btn {
  padding: 0.625rem 1rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  white-space: nowrap;
}

/* Reject Button - Outlined style */
.cookie-consent-btn-reject {
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.cookie-consent-btn-reject:hover {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.5);
  color: #e2e8f0;
}

/* Accept Button - Solid dark style */
.cookie-consent-btn-accept {
  background: rgba(30, 41, 59, 0.9);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-consent-btn-accept:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Customize Button - Teal outlined */
.cookie-consent-btn-customize {
  background: transparent;
  color: #22d3d1;
  border: 1px solid rgba(34, 211, 209, 0.4);
}

.cookie-consent-btn-customize:hover {
  background: rgba(34, 211, 209, 0.1);
  border-color: rgba(34, 211, 209, 0.6);
}

/* Responsive - Mobile */
@media (max-width: 480px) {
  .cookie-consent-banner {
    bottom: 16px;
    left: 16px;
    right: 16px;
    max-width: none;
    transform: translateY(120%);
  }

  .cookie-consent-banner.visible {
    transform: translateY(0);
  }

  .cookie-consent-banner.hiding {
    transform: translateY(120%);
  }

  .cookie-consent-content {
    padding: 1.25rem;
    border-radius: 14px;
  }

  .cookie-consent-text h3 {
    font-size: 0.9375rem;
  }

  .cookie-consent-text p {
    font-size: 0.8125rem;
  }

  .cookie-consent-actions {
    flex-direction: row;
    gap: 0.5rem;
  }

  .cookie-consent-btn {
    flex: 1;
    padding: 0.5625rem 0.75rem;
    font-size: 0.75rem;
    text-align: center;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .cookie-consent-actions {
    flex-wrap: wrap;
  }
  
  .cookie-consent-btn {
    flex: 1 1 calc(50% - 0.25rem);
  }
  
  .cookie-consent-btn-customize {
    flex: 1 1 100%;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .cookie-consent-content {
    background: #000000;
    border: 2px solid #ffffff;
  }

  .cookie-consent-btn {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .cookie-consent-banner {
    transition: opacity 0.2s ease;
  }

  .cookie-consent-banner.visible {
    transform: translateX(0);
  }

  .cookie-consent-banner.hiding {
    transform: translateX(0);
    opacity: 0;
  }
}

/* Print - Hide banner */
@media print {
  .cookie-consent-banner {
    display: none !important;
  }
}

/* Cookie Preferences Modal */
.cookie-preferences-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-preferences-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.cookie-preferences-modal {
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  max-width: 500px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.cookie-preferences-overlay.visible .cookie-preferences-modal {
  transform: translateY(0);
}

.cookie-preferences-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cookie-preferences-header h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #f8fafc;
}

.cookie-preferences-header p {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(148, 163, 184, 0.9);
  line-height: 1.5;
}

.cookie-preferences-body {
  padding: 1rem 1.5rem;
}

.cookie-category {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cookie-category:last-child {
  border-bottom: none;
}

.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.cookie-category-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #e2e8f0;
}

.cookie-category-description {
  font-size: 0.8125rem;
  color: rgba(148, 163, 184, 0.8);
  line-height: 1.5;
}

/* Toggle Switch */
.cookie-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.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: rgba(148, 163, 184, 0.2);
  border-radius: 24px;
  transition: all 0.3s ease;
}

.cookie-toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #94a3b8;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: rgba(34, 211, 209, 0.3);
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
  transform: translateX(20px);
  background: #22d3d1;
}

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

.cookie-preferences-footer {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  gap: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cookie-preferences-footer button {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cookie-btn-save {
  background: linear-gradient(135deg, #22d3d1 0%, #06b6d4 100%);
  color: #0f172a;
  border: none;
}

.cookie-btn-save:hover {
  box-shadow: 0 4px 15px rgba(34, 211, 209, 0.3);
  transform: translateY(-1px);
}

.cookie-btn-cancel {
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.cookie-btn-cancel:hover {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.5);
  color: #e2e8f0;
}

@media (max-width: 480px) {
  .cookie-preferences-modal {
    max-height: 90vh;
    border-radius: 16px;
  }
  
  .cookie-preferences-header,
  .cookie-preferences-body,
  .cookie-preferences-footer {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  
  .cookie-preferences-footer {
    flex-direction: column-reverse;
  }
}
