/**
 * Cookie Consent Styles
 * GDPR-compliant cookie consent banner and modal
 */

/* ===== Cookie Banner ===== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-top: 3px solid #0066cc;
  padding: 1.5rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  animation: slideUp 0.4s ease-out;
}

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

.cookie-banner__container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.cookie-banner__icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.cookie-banner__content {
  flex: 1;
  color: #e0e0e0;
}

.cookie-banner__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.cookie-banner__description {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.cookie-banner__links {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

.cookie-banner__link {
  color: #66b3ff;
  text-decoration: none;
  transition: color 0.2s;
}

.cookie-banner__link:hover {
  color: #99ccff;
  text-decoration: underline;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cookie-banner__button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 140px;
  text-align: center;
}

.cookie-banner__button--accept {
  background: #0066cc;
  color: #ffffff;
}

.cookie-banner__button--accept:hover {
  background: #0052a3;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.cookie-banner__button--essential {
  background: #cc3300;
  color: #ffffff;
}

.cookie-banner__button--essential:hover {
  background: #a32900;
  box-shadow: 0 4px 12px rgba(204, 51, 0, 0.3);
}

.cookie-banner__button--customize {
  background: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
}

.cookie-banner__button--customize:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #99ccff;
}

.cookie-banner__button:focus-visible {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* ===== Cookie Modal ===== */
.cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
  animation: fadeIn 0.3s ease-out;
}

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

.cookie-modal__dialog {
  background: #ffffff;
  border-radius: 12px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-modal__header {
  padding: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cookie-modal__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0;
}

.cookie-modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s;
}

.cookie-modal__close:hover {
  color: #cc3300;
}

.cookie-modal__close:focus-visible {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
  border-radius: 4px;
}

.cookie-modal__body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.cookie-category {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #f9f9f9;
}

.cookie-category__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.cookie-category__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0;
}

.cookie-category__toggle {
  position: relative;
  width: 52px;
  height: 28px;
}

.cookie-category__checkbox {
  opacity: 0;
  width: 0;
  height: 0;
}

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

.cookie-category__slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.cookie-category__checkbox:checked + .cookie-category__slider {
  background-color: #0066cc;
}

.cookie-category__checkbox:checked + .cookie-category__slider:before {
  transform: translateX(24px);
}

.cookie-category__checkbox:disabled + .cookie-category__slider {
  cursor: not-allowed;
  opacity: 0.6;
}

.cookie-category__checkbox:focus-visible + .cookie-category__slider {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.cookie-category__description {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.cookie-category__examples {
  font-size: 0.875rem;
  color: #777;
  font-style: italic;
}

.cookie-category__examples strong {
  font-weight: 600;
  color: #555;
}

.cookie-modal__footer {
  padding: 1.5rem;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.cookie-modal__button {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.cookie-modal__button--save {
  background: #0066cc;
  color: #ffffff;
}

.cookie-modal__button--save:hover {
  background: #0052a3;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.cookie-modal__button--cancel {
  background: #e0e0e0;
  color: #333;
}

.cookie-modal__button--cancel:hover {
  background: #d0d0d0;
}

.cookie-modal__button:focus-visible {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .cookie-banner__container {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .cookie-banner__actions {
    flex-direction: column;
    width: 100%;
  }

  .cookie-banner__button {
    width: 100%;
  }

  .cookie-modal__dialog {
    max-height: 95vh;
  }

  .cookie-modal__footer {
    flex-direction: column;
  }

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

@media (max-width: 480px) {
  .cookie-banner {
    padding: 1rem;
  }

  .cookie-banner__title {
    font-size: 1.125rem;
  }

  .cookie-banner__description {
    font-size: 0.875rem;
  }

  .cookie-banner__button {
    font-size: 0.9rem;
    padding: 0.625rem 1.25rem;
  }

  .cookie-modal__header,
  .cookie-modal__body,
  .cookie-modal__footer {
    padding: 1rem;
  }

  .cookie-modal__title {
    font-size: 1.25rem;
  }

  .cookie-category {
    padding: 1rem;
  }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
  .cookie-banner,
  .cookie-modal,
  .cookie-modal__dialog {
    animation: none;
  }

  .cookie-category__slider,
  .cookie-category__slider:before,
  .cookie-banner__button,
  .cookie-banner__link {
    transition: none;
  }
}

/* ===== Hidden State ===== */
.cookie-banner.hidden,
.cookie-modal.hidden {
  display: none;
}

/* ===== Page Blur Overlay ===== */
/* CRITICAL: Prevents page interaction until consent given */
.page-blur-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* Safari support */
  z-index: 9998; /* Below cookie banner (9999) but above all content */
  pointer-events: all; /* Prevent clicks on underlying content */
  display: flex;
  align-items: center;
  justify-content: center;
  animation: blurIn 0.3s ease-out;
}

@keyframes blurIn {
  from {
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    opacity: 0;
  }
  to {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 1;
  }
}

.page-blur-overlay__message {
  background: rgba(26, 26, 46, 0.95);
  color: #ffffff;
  padding: 2rem;
  border-radius: 12px;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.page-blur-overlay__message h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #ffffff;
}

.page-blur-overlay__message p {
  font-size: 1rem;
  line-height: 1.6;
  color: #e0e0e0;
  margin: 0;
}

.page-blur-overlay.hidden {
  display: none;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .page-blur-overlay {
    animation: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}
