/**
 * GDPR Cookie Consent Banner Styles
 */

/* Backdrop overlay */
.cookie-consent-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  animation: fadeIn 0.3s ease-out;
  pointer-events: none;
}

.cookie-consent-backdrop.cookie-consent-hiding {
  animation: fadeOut 0.3s ease-out;
}

/* Main banner container */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  animation: slideUp 0.4s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

.cookie-consent-banner.cookie-consent-hiding {
  animation: slideDown 0.3s ease-out;
}

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

/* Header */
.cookie-consent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.cookie-consent-header h3 {
  margin: 0;
  font-size: 24px;
  color: #1e293b;
  font-weight: 600;
}

.cookie-consent-close {
  background: none;
  border: none;
  font-size: 32px;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.cookie-consent-close:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* Description */
#cookie-consent-description {
  color: #475569;
  line-height: 1.6;
  margin-bottom: 24px;
  font-size: 15px;
}

/* Cookie options container */
.cookie-consent-options {
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cookie-option {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  transition: border-color 0.2s, background 0.2s;
}

.cookie-option:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

/* Custom checkbox styling */
.cookie-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  position: relative;
  padding-left: 0;
  user-select: none;
}

.cookie-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: relative;
  height: 24px;
  min-width: 24px;
  width: 24px;
  background-color: white;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  transition: all 0.2s;
  margin-top: 2px;
}

.cookie-checkbox:hover input:not(:disabled) ~ .checkmark {
  border-color: #38A3A5;
}

.cookie-checkbox input:checked ~ .checkmark {
  background-color: #38A3A5;
  border-color: #38A3A5;
}

.cookie-checkbox input:disabled ~ .checkmark {
  background-color: #e2e8f0;
  border-color: #cbd5e1;
  cursor: not-allowed;
}

.cookie-checkbox input:disabled {
  cursor: not-allowed;
}

.cookie-checkbox input:disabled ~ .cookie-option-text {
  opacity: 0.7;
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.cookie-checkbox input:checked ~ .checkmark:after {
  display: block;
}

.cookie-option-text {
  flex: 1;
}

.cookie-option-text strong {
  display: block;
  color: #1e293b;
  font-size: 16px;
  margin-bottom: 4px;
}

.cookie-option-text p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}

/* Action buttons */
.cookie-consent-actions {
  display: flex;
  gap: 12px;
  margin: 24px 0 16px 0;
  flex-wrap: wrap;
}

.cookie-consent-actions button {
  flex: 1;
  min-width: 140px;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #57CC99, #38A3A5);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #38A3A5, #22577A);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 163, 165, 0.3);
}

.btn-secondary {
  background: white;
  color: #475569;
  border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* Footer links */
.cookie-consent-footer {
  margin-top: 16px;
  font-size: 13px;
  color: #64748b;
  text-align: center;
}

.cookie-consent-footer a {
  color: #38A3A5;
  text-decoration: underline;
}

.cookie-consent-footer a:hover {
  color: #22577A;
}

/* Cookie settings button (fixed in footer) */
.cookie-settings-btn {
  position: fixed;
  bottom: 12px;
  left: 12px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.cookie-settings-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

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

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

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

@keyframes slideDown {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(100%);
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .cookie-consent-content {
    padding: 24px 20px;
  }

  .cookie-consent-header h3 {
    font-size: 20px;
  }

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

  .cookie-consent-actions button {
    width: 100%;
    min-width: auto;
  }

  .btn-accept-all {
    order: -1; /* Put "Accept all" first on mobile */
  }

  .cookie-settings-btn {
    right: 12px;
    bottom: 12px;
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .cookie-settings-btn:hover {
    transform: translateY(-2px) scale(1.05);
  }

  .cookie-option-text strong {
    font-size: 15px;
  }

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

@media (max-width: 480px) {
  .cookie-consent-header h3 {
    font-size: 18px;
  }

  .cookie-option {
    padding: 12px;
  }

  .cookie-settings-btn {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .cookie-consent-banner,
  .cookie-consent-backdrop,
  .cookie-consent-close,
  .cookie-settings-btn,
  .btn-primary,
  .btn-secondary,
  .checkmark,
  .cookie-option {
    animation: none !important;
    transition: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .cookie-consent-banner {
    border: 2px solid black;
  }

  .cookie-option {
    border-width: 3px;
  }

  .btn-secondary {
    border-width: 3px;
  }
}

/* Print styles */
@media print {
  .cookie-consent-banner,
  .cookie-consent-backdrop,
  .cookie-settings-btn {
    display: none !important;
  }
}
