/**
 * Cookie Consent Banner Styles
 * GDPR-compliant cookie consent UI
 * Matches Diveworld blue/yellow theme
 */

/* ========================================
   BANNER BASE
   ======================================== */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #fff;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

.cookie-banner[hidden] {
  display: block;
  visibility: hidden;
}

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

/* ========================================
   BANNER CONTENT
   ======================================== */

.cookie-banner-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

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

.cookie-banner-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a2a3a;
  margin: 0 0 0.5rem;
}

.cookie-banner-description {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.5;
  margin: 0;
}

.cookie-link {
  color: #0077B6;
  text-decoration: none;
  font-weight: 500;
}

.cookie-link:hover {
  text-decoration: underline;
}

/* ========================================
   BANNER ACTIONS
   ======================================== */

.cookie-banner-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cookie-btn-accept {
  background: #0077B6;
  color: #fff;
}

.cookie-btn-accept:hover {
  background: #005f8f;
}

.cookie-btn-reject {
  background: #f5f5f5;
  color: #333;
  border: 1px solid #ccc;
}

.cookie-btn-reject:hover {
  background: #eee;
  border-color: #999;
}

.cookie-btn-settings {
  background: transparent;
  color: #0077B6;
  border: 1px solid #0077B6;
}

.cookie-btn-settings:hover {
  background: rgba(0, 119, 182, 0.1);
}

.cookie-btn-save {
  background: #0077B6;
  color: #fff;
}

.cookie-btn-save:hover {
  background: #005f8f;
}

/* ========================================
   SETTINGS PANEL
   ======================================== */

.cookie-settings {
  border-top: 1px solid #ddd;
  background: #f9f9f9;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.cookie-settings[hidden] {
  display: block;
}

.cookie-settings-visible {
  max-height: 400px;
}

.cookie-settings-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.cookie-settings-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a2a3a;
  margin: 0 0 1rem;
}

/* ========================================
   COOKIE OPTIONS
   ======================================== */

.cookie-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e5e5e5;
}

.cookie-option:last-of-type {
  border-bottom: none;
}

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

.cookie-option-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.2rem;
}

.cookie-option-desc {
  display: block;
  font-size: 0.8rem;
  color: #777;
}

/* ========================================
   TOGGLE SWITCHES
   ======================================== */

.cookie-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

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

.cookie-toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 24px;
  transition: background 0.2s ease;
}

.cookie-toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: #0077B6;
}

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

.cookie-toggle input:focus + .cookie-toggle-slider {
  box-shadow: 0 0 0 2px rgba(0, 119, 182, 0.3);
}

.cookie-toggle-disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.cookie-toggle-disabled .cookie-toggle-slider {
  background: #0077B6;
}

.cookie-toggle-label {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  color: #777;
}

/* ========================================
   SETTINGS ACTIONS
   ======================================== */

.cookie-settings-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e5e5;
  text-align: right;
}

/* ========================================
   SETTINGS TRIGGER (Cookie Icon)
   ======================================== */

.cookie-settings-trigger {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9998;
  width: 44px;
  height: 44px;
  background: #1a2a3a;
  color: #FFC107;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
}

.cookie-settings-trigger-visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.cookie-settings-trigger:hover {
  background: #0077B6;
  transform: scale(1.1);
}

.cookie-settings-trigger:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.4);
}

.cookie-settings-trigger svg {
  width: 20px;
  height: 20px;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

@media (max-width: 768px) {
  .cookie-banner-content {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 1rem;
  }

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

  .cookie-btn {
    width: 100%;
    padding: 0.75rem 1rem;
  }

  .cookie-settings-content {
    padding: 1rem;
  }

  .cookie-option {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .cookie-settings-actions {
    text-align: center;
  }

  .cookie-btn-save {
    width: 100%;
  }

  .cookie-settings-trigger {
    bottom: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
  }

  .cookie-settings-trigger svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 480px) {
  .cookie-banner-title {
    font-size: 0.95rem;
  }

  .cookie-banner-description {
    font-size: 0.8rem;
  }

  .cookie-option-label {
    font-size: 0.85rem;
  }

  .cookie-option-desc {
    font-size: 0.75rem;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .cookie-banner,
  .cookie-settings-trigger {
    display: none !important;
  }
}

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  .cookie-banner,
  .cookie-settings,
  .cookie-toggle-slider,
  .cookie-toggle-slider::before,
  .cookie-settings-trigger {
    transition: none;
  }
}
