/* ═══════════════════════════════════════════════════════════════
   COOKIE CONSENT - Footer Banner Style (Light)
   Non-blocking footer banner, allows scrolling
   ═══════════════════════════════════════════════════════════════ */

/* Cookie Consent Banner - Fixed Bottom */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

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

.cookie-consent.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Cookie Modal Box - Now a horizontal banner */
.cookie-modal {
  background: transparent;
  border-radius: 0;
  max-width: 1200px;
  width: 100%;
  padding: 20px 32px;
  box-shadow: none;
  border: none;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 24px;
  animation: none;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-modal-icon {
  font-size: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-modal-icon svg {
  width: 40px;
  height: 40px;
}

.cookie-modal-content {
  flex: 1;
  min-width: 0;
}

.cookie-modal h3 {
  color: #1f2937;
  font-size: 1.1rem;
  margin: 0 0 4px 0;
  font-weight: 600;
}

.cookie-modal p {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.cookie-modal a {
  color: var(--t-primary, #4B5563);
  text-decoration: underline;
}

.cookie-modal a:hover {
  color: var(--t-primary-dark, #374151);
}

/* Cookie Modal Buttons */
.cookie-modal-buttons {
  display: flex;
  flex-direction: row;
  gap: 12px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: inherit;
  white-space: nowrap;
}

.cookie-btn-primary {
  background: linear-gradient(135deg, var(--t-primary, #4B5563) 0%, var(--t-primary-dark, #374151) 100%);
  color: #fff;
}

.cookie-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(var(--t-primary-rgb, 99, 102, 241), 0.4);
}

.cookie-btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.cookie-btn-secondary:hover {
  background: #e5e7eb;
}

.cookie-btn-link {
  background: transparent;
  color: #6b7280;
  text-decoration: underline;
  padding: 8px;
}

.cookie-btn-link:hover {
  color: #374151;
}

/* ═══════════════════════════════════════════════════════════════
   COOKIE SETTINGS PANEL - Full Width Banner
   ═══════════════════════════════════════════════════════════════ */

.cookie-settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-settings-overlay.hidden {
  display: none;
}

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

/* Settings Panel */
.cookie-settings-panel {
  background: #ffffff;
  width: 100%;
  max-height: 60vh;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  animation: panelSlideUp 0.3s ease;
}

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

/* Panel Header */
.cookie-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.cookie-settings-header h3 {
  color: #1f2937;
  font-size: 1.25rem;
  margin: 0;
  font-weight: 600;
}

.cookie-settings-close {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

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

/* Panel Body */
.cookie-settings-body {
  padding: 24px 32px;
  max-height: calc(60vh - 160px);
  overflow-y: auto;
}

.cookie-settings-body::-webkit-scrollbar {
  width: 8px;
}

.cookie-settings-body::-webkit-scrollbar-track {
  background: #f3f4f6;
}

.cookie-settings-body::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

/* Cookie Category */
.cookie-category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid #f3f4f6;
}

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

.cookie-category-info {
  flex: 1;
  padding-right: 24px;
}

.cookie-category-info h4 {
  color: #1f2937;
  font-size: 16px;
  margin: 0 0 6px 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-category-info h4 .badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  background: rgba(var(--t-primary-rgb, 99, 102, 241), 0.15);
  color: var(--t-primary, #4B5563);
}

.cookie-category-info p {
  color: #6b7280;
  font-size: 13px;
  margin: 0;
  line-height: 1.5;
}

/* Toggle Switch */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

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

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

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

.cookie-toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--t-primary, #4B5563) 0%, var(--t-primary-dark, #374151) 100%);
}

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

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

.cookie-toggle input:disabled + .toggle-slider:before {
  background: #10b981;
}

/* Panel Footer */
.cookie-settings-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 20px 32px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  flex-wrap: wrap;
}

.cookie-settings-footer .cookie-btn {
  flex: 0 0 auto;
  min-width: 160px;
}

/* Responsive */
@media (max-width: 768px) {
  .cookie-modal {
    flex-direction: column;
    text-align: center;
    padding: 16px 20px;
    gap: 12px;
  }
  
  .cookie-modal-content {
    text-align: center;
  }
  
  .cookie-modal-buttons {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .cookie-settings-header,
  .cookie-settings-body,
  .cookie-settings-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .cookie-settings-panel {
    max-height: 70vh;
  }
  
  .cookie-settings-footer {
    flex-direction: column;
    gap: 12px;
  }
  
  .cookie-settings-footer .cookie-btn {
    width: 100%;
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .cookie-modal h3 {
    font-size: 1rem;
  }
  
  .cookie-modal p {
    font-size: 12px;
  }
  
  .cookie-modal-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .cookie-btn {
    width: 100%;
  }
  
  .cookie-category {
    flex-direction: column;
    gap: 12px;
  }
  
  .cookie-category-info {
    padding-right: 0;
  }
}

/* ═══ Mobile: lift chat input above cookie banner ═══ */
@media (max-width: 768px) {
  body.cookie-banner-active .chat-view {
    padding-bottom: 200px;
  }
}
