/* ============================================
   eBrains Digital — Cookie Consent Styles
   ============================================ */

/* ---------- Overlay ---------- */
#cookie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 16, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#cookie-overlay.cb-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Banner ---------- */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #0a0a1a;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 24px 0;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

#cookie-banner.cb-closing {
  transform: translateY(100%);
}

.cb-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.cb-text {
  flex: 1;
}

.cb-text h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 6px;
}

.cb-text p {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
}

.cb-text a {
  color: #00d4ff;
  text-decoration: none;
}

.cb-text a:hover {
  text-decoration: underline;
}

.cb-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */
.cb-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cb-btn-primary {
  background: linear-gradient(135deg, #00d4ff, #8b5cf6);
  color: #050510;
}

.cb-btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.cb-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cb-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.cb-btn-ghost {
  background: transparent;
  color: #94a3b8;
  padding: 10px 16px;
}

.cb-btn-ghost:hover {
  color: #f1f5f9;
}

/* ---------- Preferences Modal ---------- */
#cookie-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 9999;
  background: #0a0a1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  width: 90%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#cookie-modal.cm-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

#cookie-modal.cm-closing {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.95);
}

.cm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cm-header h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f1f5f9;
}

.cm-close {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cm-close:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.06);
}

.cm-body {
  padding: 20px 28px;
  overflow-y: auto;
  flex: 1;
}

.cm-intro {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 24px;
}

.cm-intro a {
  color: #00d4ff;
  text-decoration: none;
}

.cm-intro a:hover {
  text-decoration: underline;
}

/* ---------- Category ---------- */
.cm-category {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 12px;
}

.cm-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cm-cat-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cm-cat-info h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f1f5f9;
}

.cm-badge {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: #00d4ff;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.15);
  padding: 2px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cm-cat-desc {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
}

.cm-no-cookies {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: #64748b;
  font-style: italic;
  margin: 8px 0 0;
}

/* ---------- Toggle Switch ---------- */
.cm-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.cm-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.25s ease;
}

.cm-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #64748b;
  border-radius: 50%;
  transition: transform 0.25s ease, background 0.25s ease;
}

.cm-toggle input:checked + .cm-toggle-slider {
  background: rgba(0, 212, 255, 0.2);
}

.cm-toggle input:checked + .cm-toggle-slider::before {
  transform: translateX(20px);
  background: #00d4ff;
}

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

.cm-toggle input:disabled:checked + .cm-toggle-slider {
  background: rgba(0, 212, 255, 0.15);
}

.cm-toggle input:disabled:checked + .cm-toggle-slider::before {
  background: #00d4ff;
  opacity: 0.7;
}

/* ---------- Cookie Table ---------- */
.cm-cookie-list {
  margin-top: 12px;
  overflow-x: auto;
}

.cm-cookie-list table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
}

.cm-cookie-list th {
  text-align: left;
  color: #64748b;
  font-weight: 600;
  padding: 6px 12px 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
}

.cm-cookie-list td {
  color: #94a3b8;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.cm-cookie-list tr:last-child td {
  border-bottom: none;
}

/* ---------- Modal Footer ---------- */
.cm-footer {
  display: flex;
  gap: 10px;
  padding: 16px 28px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cm-footer .cb-btn {
  flex: 1;
}

/* ---------- Floating Cookie Button ---------- */
#cookie-fab {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9990;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  pointer-events: none;
}

#cookie-fab.cookie-fab-visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

#cookie-fab:hover {
  color: #00d4ff;
  border-color: rgba(0, 212, 255, 0.3);
  background: rgba(10, 10, 26, 0.95);
  transform: scale(1.08);
}

/* ---------- Cookie Settings Link (Footer) ---------- */
.cookie-settings-link {
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.2s;
}

.cookie-settings-link:hover {
  color: #00d4ff !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .cb-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .cb-actions {
    width: 100%;
    flex-direction: column;
  }

  .cb-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  #cookie-modal {
    width: 95%;
    max-height: 90vh;
  }

  .cm-header {
    padding: 20px 20px 14px;
  }

  .cm-body {
    padding: 16px 20px;
  }

  .cm-footer {
    padding: 14px 20px 20px;
    flex-direction: column;
  }

  .cm-cat-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .cm-cookie-list table {
    font-size: 0.72rem;
  }
}
