/**
 * Cookie Consent Banner Styles
 * GDPR Compliant Cookie Banner - AirPM Theme
 */

/* ============================================
   COOKIE BANNER
   ============================================ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #ffffff;
  border-top: 3px solid var(--primary-color, #2563eb);
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
}

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

.cookie-banner.hidden {
  display: none;
}

.cookie-banner-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Main Banner Content */
.cookie-banner-main {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

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

.cookie-banner-title {
  font-size: 1.1rem;
  color: var(--primary-color, #2563eb);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.cookie-banner-description {
  font-size: 0.9rem;
  color: var(--text-secondary, #6b7280);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.cookie-banner-links {
  font-size: 0.85rem;
}

.cookie-banner-links a {
  color: var(--primary-color, #2563eb);
  margin-right: 1rem;
}

.cookie-banner-links a:hover {
  color: var(--primary-dark, #1e40af);
  text-decoration: underline;
}

/* Buttons */
.cookie-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.625rem 1.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 160px;
  text-align: center;
}

.cookie-btn-accept {
  background: var(--primary-color, #2563eb);
  color: #ffffff;
  border-color: var(--primary-color, #2563eb);
}

.cookie-btn-accept:hover {
  background: var(--primary-dark, #1e40af);
  border-color: var(--primary-dark, #1e40af);
}

.cookie-btn-reject {
  background: transparent;
  color: var(--text-secondary, #6b7280);
  border-color: var(--border-color, #e5e7eb);
}

.cookie-btn-reject:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.cookie-btn-settings {
  background: transparent;
  color: var(--primary-color, #2563eb);
  border-color: var(--primary-color, #2563eb);
}

.cookie-btn-settings:hover {
  background: var(--primary-color, #2563eb);
  color: #ffffff;
}

/* ============================================
   COOKIE SETTINGS MODAL
   ============================================ */
.cookie-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cookie-settings-modal.active {
  opacity: 1;
  visibility: visible;
}

.cookie-settings-content {
  background: #ffffff;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.cookie-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-secondary, #f9fafb);
}

.cookie-settings-title {
  font-size: 1.2rem;
  color: var(--text-primary, #1f2937);
  font-weight: 600;
}

.cookie-settings-close {
  background: none;
  border: none;
  color: var(--text-secondary, #6b7280);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 0.25rem;
  line-height: 1;
}

.cookie-settings-close:hover {
  color: #ef4444;
}

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

.cookie-settings-intro {
  font-size: 0.9rem;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* Cookie Categories */
.cookie-category {
  background: var(--bg-secondary, #f9fafb);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cookie-category-header:hover {
  background: #f3f4f6;
}

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

.cookie-category-name {
  font-size: 0.95rem;
  color: var(--text-primary, #1f2937);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.cookie-category-name .badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  background: var(--border-color, #e5e7eb);
  border-radius: 4px;
  color: var(--text-secondary, #6b7280);
}

.cookie-category-name .badge.required {
  background: #dcfce7;
  color: #16a34a;
}

.cookie-category-description {
  font-size: 0.8rem;
  color: var(--text-secondary, #6b7280);
}

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

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

.cookie-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #d1d5db;
  border-radius: 26px;
  transition: all 0.2s ease;
}

.cookie-toggle-slider::before {
  position: absolute;
  content: '';
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: var(--primary-color, #2563eb);
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Cookie Details (expandable) */
.cookie-category-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #ffffff;
}

.cookie-category.expanded .cookie-category-details {
  max-height: 500px;
}

.cookie-category-details-inner {
  padding: 1rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

.cookie-list {
  font-size: 0.8rem;
}

.cookie-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  color: var(--text-secondary, #6b7280);
}

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

.cookie-item-name {
  color: var(--primary-color, #2563eb);
  font-weight: 500;
}

.cookie-item-duration {
  color: var(--text-light, #9ca3af);
}

.cookie-no-items {
  color: var(--text-light, #9ca3af);
  font-size: 0.85rem;
  font-style: italic;
}

/* Settings Footer */
.cookie-settings-footer {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-secondary, #f9fafb);
}

.cookie-settings-footer .cookie-btn {
  flex: 1;
}

/* ============================================
   COOKIE PREFERENCES BUTTON (floating)
   ============================================ */
.cookie-preferences-btn {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 9998;
  background: #ffffff;
  border: 1px solid var(--primary-color, #2563eb);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  color: var(--primary-color, #2563eb);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cookie-preferences-btn.visible {
  opacity: 1;
  visibility: visible;
}

.cookie-preferences-btn:hover {
  background: var(--primary-color, #2563eb);
  color: #ffffff;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .cookie-banner {
    padding: 1rem;
  }

  .cookie-banner-main {
    flex-direction: column;
    gap: 1rem;
  }

  .cookie-banner-actions {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }

  .cookie-btn {
    flex: 1;
    min-width: 120px;
  }

  .cookie-settings-content {
    max-height: 90vh;
  }

  .cookie-settings-footer {
    flex-direction: column;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.cookie-toggle input:focus + .cookie-toggle-slider {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.cookie-btn:focus,
.cookie-settings-close:focus {
  outline: 2px solid var(--primary-color, #2563eb);
  outline-offset: 2px;
}

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