/**
 * Cookie Consent Banner Styles
 * Light theme, modern design
 */

/* ============================================
   Base Styles & Reset
   ============================================ */

.cookie-consent {
  --cc-primary-color: #00d4ff;
  --cc-primary-hover: #00b8e6;
  --cc-bg-overlay: rgba(0, 0, 0, 0.5);
  --cc-bg-dialog: #ffffff;
  --cc-text-primary: #212529;
  --cc-text-secondary: #6c757d;
  --cc-border-color: #dee2e6;
  --cc-border-radius: 12px;
  --cc-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  --cc-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--cc-text-primary);
  opacity: 0;
  visibility: hidden;
  transition: var(--cc-transition);
  pointer-events: none;
}

.cookie-consent * {
  box-sizing: border-box;
}

.cookie-consent--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ============================================
   Overlay
   ============================================ */

.cookie-consent__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--cc-bg-overlay);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* ============================================
   Dialog Container
   ============================================ */

.cookie-consent__dialog {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 95vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.cookie-consent__container {
  background: var(--cc-bg-dialog);
  border-radius: var(--cc-border-radius) var(--cc-border-radius) 0 0;
  box-shadow: var(--cc-shadow);
  padding: 24px;
  max-width: 100%;
  margin: 0 auto;
}

/* ============================================
   Header
   ============================================ */

.cookie-consent__header {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.cookie-consent__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cc-primary-color), var(--cc-primary-hover));
  border-radius: 12px;
  color: #ffffff;
}

.cookie-consent__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--cc-text-primary);
  line-height: 1.3;
}

.cookie-consent__description {
  margin: 0;
  color: var(--cc-text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* ============================================
   Body / Categories
   ============================================ */

.cookie-consent__body {
  margin-bottom: 24px;
}

.cookie-consent__category {
  border: 1px solid var(--cc-border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  transition: var(--cc-transition);
  background: #ffffff;
}

.cookie-consent__category:hover {
  border-color: var(--cc-primary-color);
  box-shadow: 0 2px 8px rgba(0, 212, 255, 0.1);
}

.cookie-consent__category:last-child {
  margin-bottom: 0;
}

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

.cookie-consent__category-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cookie-consent__category-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--cc-text-primary);
}

.cookie-consent__info-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--cc-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--cc-transition);
}

.cookie-consent__info-btn:hover,
.cookie-consent__info-btn:focus {
  color: var(--cc-primary-color);
  background: rgba(0, 212, 255, 0.1);
  outline: none;
}

.cookie-consent__category-desc {
  margin: 0 0 12px 0;
  color: var(--cc-text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

/* ============================================
   Toggle Switch
   ============================================ */

.cookie-consent__toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.cookie-consent__toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cookie-consent__toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 26px;
  transition: var(--cc-transition);
}

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

.cookie-consent__toggle input:checked + .cookie-consent__toggle-slider {
  background-color: var(--cc-primary-color);
}

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

.cookie-consent__toggle input:focus + .cookie-consent__toggle-slider {
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.25);
}

.cookie-consent__toggle--disabled {
  opacity: 0.7;
}

.cookie-consent__toggle--disabled .cookie-consent__toggle-slider {
  cursor: not-allowed;
  background-color: var(--cc-primary-color);
}

.cookie-consent__badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: #e8f9fc;
  color: #00a3c4;
}

/* ============================================
   Details Section
   ============================================ */

.cookie-consent__details {
  margin-top: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid var(--cc-primary-color);
}

.cookie-consent__details[hidden] {
  display: none;
}

.cookie-consent__details-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--cc-text-primary);
}

.cookie-consent__details-list {
  margin: 0 0 12px 0;
  padding-left: 20px;
  list-style: disc;
  color: var(--cc-text-secondary);
  font-size: 13px;
}

.cookie-consent__details-list li {
  margin-bottom: 4px;
  line-height: 1.5;
}

.cookie-consent__details-note {
  font-size: 12px;
  color: var(--cc-text-secondary);
  margin: 0;
  line-height: 1.6;
}

.cookie-consent__details-note a {
  color: var(--cc-primary-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: var(--cc-transition);
}

.cookie-consent__details-note a:hover {
  border-bottom-color: var(--cc-primary-color);
}

/* ============================================
   Footer
   ============================================ */

.cookie-consent__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--cc-border-color);
}

.cookie-consent__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cc-text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: var(--cc-transition);
  padding: 6px 0;
}

.cookie-consent__link:hover,
.cookie-consent__link:focus {
  color: var(--cc-primary-color);
  outline: none;
}

.cookie-consent__link svg {
  flex-shrink: 0;
}

.cookie-consent__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================
   Buttons
   ============================================ */

.cookie-consent__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--cc-transition);
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}

.cookie-consent__btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.25);
}

.cookie-consent__btn--primary {
  background: var(--cc-primary-color);
  color: #ffffff;
  border-color: var(--cc-primary-color);
}

.cookie-consent__btn--primary:hover {
  background: var(--cc-primary-hover);
  border-color: var(--cc-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.cookie-consent__btn--primary:active {
  transform: translateY(0);
}

.cookie-consent__btn--secondary {
  background: transparent;
  color: var(--cc-text-secondary);
  border-color: var(--cc-border-color);
}

.cookie-consent__btn--secondary:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
  color: var(--cc-text-primary);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (min-width: 768px) {
  .cookie-consent__dialog {
    bottom: 20px;
    left: 50%;
    transform: translate(-50%, 120%);
    width: calc(100% - 40px);
    max-width: 680px;
  }

  .cookie-consent--visible .cookie-consent__dialog {
    transform: translate(-50%, 0);
  }

  .cookie-consent__container {
    border-radius: var(--cc-border-radius);
    padding: 32px;
  }

  .cookie-consent__footer {
    flex-wrap: nowrap;
  }
}

@media (min-width: 1024px) {
  .cookie-consent__dialog {
    max-width: 800px;
  }
}

@media (max-width: 480px) {
  .cookie-consent__dialog {
    bottom: 12px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: calc(100% - 24px);
  }

  .cookie-consent__container {
    padding: 16px;
    border-radius: var(--cc-border-radius);
  }

  .cookie-consent__header {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    margin-bottom: 16px;
  }

  .cookie-consent__icon {
    margin: 0 auto;
    width: 40px;
    height: 40px;
  }

  .cookie-consent__icon svg {
    width: 22px;
    height: 22px;
  }

  .cookie-consent__title {
    font-size: 17px;
    margin-bottom: 6px;
  }

  .cookie-consent__description {
    font-size: 13px;
  }

  .cookie-consent__body {
    margin-bottom: 16px;
  }

  .cookie-consent__category {
    padding: 12px;
  }

  .cookie-consent__category-name {
    font-size: 14px;
  }

  .cookie-consent__category-desc {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .cookie-consent__footer {
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
  }

  .cookie-consent__actions {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .cookie-consent__btn {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
    font-size: 13px;
  }

  .cookie-consent__link {
    width: 100%;
    justify-content: center;
    font-size: 12px;
  }

  .cookie-consent__toggle {
    width: 42px;
    height: 24px;
  }

  .cookie-consent__toggle-slider:before {
    height: 18px;
    width: 18px;
  }

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

/* ============================================
   Accessibility & Print
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .cookie-consent,
  .cookie-consent__dialog,
  .cookie-consent__toggle-slider,
  .cookie-consent__toggle-slider:before,
  .cookie-consent__btn,
  .cookie-consent__category {
    transition: none !important;
  }
}

@media print {
  .cookie-consent {
    display: none !important;
  }
}

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

  .cookie-consent__category {
    border-width: 2px;
  }
}

/* Focus visible for better keyboard navigation */
.cookie-consent__btn:focus-visible,
.cookie-consent__toggle input:focus-visible + .cookie-consent__toggle-slider,
.cookie-consent__info-btn:focus-visible,
.cookie-consent__link:focus-visible {
  outline: 2px solid var(--cc-primary-color);
  outline-offset: 2px;
}
