/* Cookie Consent & Management System — styles for the consent banner, the preferences modal,
   and the permanent footer link. Namespaced under `cc-` so nothing here collides with the rest
   of style.css. Colors/spacing/radius all come from the site's existing CSS variables (see
   :root in style.css) so this automatically matches both the light and dark themes. */

.cc-banner {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 9500; /* below the WhatsApp/chat floating buttons (9999) so those never get hidden */
  width: min(400px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 22px 22px 20px;
  font-family: 'Inter', 'Cairo', sans-serif;
  animation: ccSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.cc-banner-title {
  font-family: 'Outfit', 'Cairo', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cc-banner-title i {
  color: var(--primary-text);
}

.cc-banner-text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-light);
  margin: 0 0 16px;
}

.cc-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cc-btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.cc-btn-primary {
  background: var(--primary-gradient);
  color: var(--primary-foreground);
  flex: 1 1 auto;
}

.cc-btn-primary:hover { filter: brightness(1.05); }

.cc-btn-secondary {
  background: var(--surface-high);
  color: var(--text);
  border-color: var(--border);
  flex: 1 1 auto;
}

.cc-btn-secondary:hover { background: var(--border); }

.cc-btn-ghost {
  background: none;
  color: var(--text-light);
  text-decoration: underline;
  padding: 11px 4px;
  flex: 1 1 100%;
  text-align: center;
}

.cc-btn-ghost:hover { color: var(--primary-text); }

/* --- Settings Modal (built on the site's existing .modal / .modal-content system) --- */
.cc-modal-content {
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
}

.cc-modal-title {
  font-family: 'Outfit', 'Cairo', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  margin: 0 0 10px;
}

.cc-modal-intro {
  color: var(--text-light);
  font-size: 0.92rem;
  line-height: 1.7;
  margin: 0 0 24px;
}

.cc-category {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 14px;
  background: var(--surface-high);
}

.cc-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.cc-category-title {
  font-weight: 800;
  font-size: 0.98rem;
  margin: 0;
}

.cc-category-desc {
  color: var(--text-light);
  font-size: 0.85rem;
  line-height: 1.65;
  margin: 0;
}

.cc-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--success);
  background: rgba(var(--success-rgb), 0.12);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

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

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

.cc-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.25s ease;
}

.cc-toggle-track::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: var(--surface);
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.cc-toggle input:checked + .cc-toggle-track {
  background: var(--primary);
}

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

[dir="rtl"] .cc-toggle input:checked + .cc-toggle-track::before {
  transform: translateX(-20px);
}

.cc-toggle input:disabled + .cc-toggle-track {
  cursor: not-allowed;
  opacity: 0.7;
}

.cc-toggle input:focus-visible + .cc-toggle-track {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.cc-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
  justify-content: flex-end;
}

.cc-modal-actions .cc-btn {
  flex: 0 1 auto;
  padding: 12px 24px;
}

/* Permanent footer link (auto-injected into any page with a <footer class="footer">) */
.cc-footer-link {
  color: var(--text-light);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  background: none;
  border: none;
  padding: 0;
}

.cc-footer-link:hover { color: var(--primary-text); text-decoration: underline; }

.cc-footer-sep {
  margin: 0 8px;
  opacity: 0.5;
}

/* --- Mobile --- */
@media (max-width: 600px) {
  .cc-banner {
    left: 10px;
    right: 90px; /* keep the bottom-right floating button (WhatsApp/chat) fully clear */
    bottom: 10px;
    width: auto;
    padding: 18px 18px 16px;
  }

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

  .cc-btn-primary,
  .cc-btn-secondary {
    flex: 1 1 100%;
  }

  .cc-modal-content {
    max-height: 90vh;
    padding: 26px 20px;
  }

  .cc-modal-actions {
    flex-direction: column-reverse;
  }

  .cc-modal-actions .cc-btn {
    width: 100%;
  }
}
