/**
 * Cookie Consent Modal Styles
 * GDPR/CCPA Compliant Design
 *
 * Design Philosophy:
 * - "Accept All" is visually prominent (primary action)
 * - "Decline" is clearly visible but secondary (compliant requirement)
 * - Modal blocks interaction until choice is made
 * - Accessible and mobile-responsive
 */

/* Modal Overlay - Blocks site interaction */
.consent-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.consent-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Main Modal Container */
.consent-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 999999;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.consent-modal.active {
  transform: translateY(0);
}

/* Alternative: Center Modal Style */
.consent-modal.centered {
  bottom: 50%;
  left: 50%;
  right: auto;
  transform: translate(-50%, 50%) scale(0.9);
  max-width: 520px;
  width: calc(100% - 32px);
  border-radius: 16px;
  margin: 0;
}

.consent-modal.centered.active {
  transform: translate(-50%, 50%) scale(1);
}

/* Modal Content */
.consent-content {
  padding: 24px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.consent-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.consent-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.consent-icon svg {
  width: 24px;
  height: 24px;
  fill: white;
}

.consent-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
}

/* Description Text */
.consent-description {
  font-size: 14px;
  line-height: 1.6;
  color: #4a4a68;
  margin-bottom: 20px;
}

.consent-description a {
  color: #667eea;
  text-decoration: underline;
}

.consent-description a:hover {
  color: #764ba2;
}

/* Button Container */
.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Primary Accept Button - Visually Prominent */
.consent-btn-accept {
  flex: 1;
  min-width: 160px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.consent-btn-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.consent-btn-accept:active {
  transform: translateY(0);
}

/* Secondary Decline Button - Visible but Not Dominant */
/* NOTE: GDPR requires this button to be clearly visible and accessible */
.consent-btn-decline {
  flex: 1;
  min-width: 160px;
  padding: 14px 28px;
  background: transparent;
  color: #4a4a68;
  border: 2px solid #d1d1e0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.consent-btn-decline:hover {
  border-color: #667eea;
  color: #667eea;
}

/* Manage Preferences Button */
.consent-btn-manage {
  padding: 14px 20px;
  background: transparent;
  color: #667eea;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
}

.consent-btn-manage:hover {
  color: #764ba2;
}

/* Preferences Panel (Expandable) */
.consent-preferences {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
  background: #f8f9fc;
  border-radius: 12px;
  margin-top: 0;
}

.consent-preferences.expanded {
  max-height: 500px;
  padding: 20px;
  margin-top: 20px;
}

/* Cookie Category */
.cookie-category {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid #e1e4ed;
}

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

.category-info {
  flex: 1;
  padding-right: 16px;
}

.category-name {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 4px 0;
}

.category-description {
  font-size: 13px;
  color: #6b6b8a;
  margin: 0;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

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

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

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

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.toggle-switch input:disabled + .toggle-slider {
  background-color: #667eea;
  opacity: 0.7;
  cursor: not-allowed;
}

/* Save Preferences Button */
.consent-btn-save {
  width: 100%;
  margin-top: 16px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .consent-content {
    padding: 20px;
  }

  .consent-title {
    font-size: 18px;
  }

  .consent-description {
    font-size: 13px;
  }

  .consent-actions {
    flex-direction: column;
  }

  .consent-btn-accept,
  .consent-btn-decline {
    width: 100%;
    min-width: auto;
  }

  .consent-modal.centered {
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
    max-width: 100%;
    width: 100%;
    border-radius: 16px 16px 0 0;
  }

  .consent-modal.centered.active {
    transform: translateY(0);
  }
}

/* Accessibility: Focus States */
.consent-btn-accept:focus,
.consent-btn-decline:focus,
.consent-btn-manage:focus,
.consent-btn-save:focus {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

/* Animation for initial appearance */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .consent-modal {
    background: #1a1a2e;
  }

  .consent-title {
    color: #ffffff;
  }

  .consent-description {
    color: #a0a0b8;
  }

  .consent-btn-decline {
    color: #a0a0b8;
    border-color: #3a3a5a;
  }

  .consent-btn-decline:hover {
    color: #667eea;
    border-color: #667eea;
  }

  .consent-preferences {
    background: #252540;
  }

  .category-name {
    color: #ffffff;
  }

  .category-description {
    color: #8888a8;
  }

  .cookie-category {
    border-bottom-color: #3a3a5a;
  }
}
