/**
 * Bistorming Consent — banner styles για το chat.bistorming.gr (light theme).
 *
 * Port του assets/banner.css του WordPress plugin, με την παλέτα του site:
 * λευκό φόντο, ink #0a0a0a κείμενο, line #e6e6e6 περιγράμματα, κουμπιά #0a0a0a (ύφος Bistorming, 9/10/2026)
 * στο κουμπί αποδοχής. Όλα namespaced με .bc- ώστε να μη συγκρούονται με το
 * Tailwind του site.
 */

.bc-banner,
.bc-modal {
  --bc-bg: #ffffff;
  --bc-text: #0a0a0a;
  --bc-muted: #6b6b6b;
  --bc-line: #e6e6e6;
  /* Κουμπί «Αποδοχή» */
  --bc-btn1-bg: #0a0a0a;
  --bc-btn1-text: #ffffff;
  --bc-btn1-border: #0a0a0a;
  /* Κουμπιά «Προτιμήσεις/Απόρριψη» */
  --bc-btn2-bg: #ffffff;
  --bc-btn2-text: #0a0a0a;
  --bc-btn2-border: #e6e6e6;
  box-sizing: border-box;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--bc-text);
}

.bc-banner *,
.bc-modal * {
  box-sizing: border-box;
}

/* Scoped — να μην πειράξουμε το [hidden] όλης της σελίδας. */
.bc-banner[hidden],
.bc-modal[hidden] {
  display: none !important;
}

/* -------------------------------------------------------------------------
 * Bottom bar
 * ---------------------------------------------------------------------- */
.bc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2147483600; /* πάνω από το widget του chatbot */
  background: var(--bc-bg);
  border-top: 1px solid var(--bc-line);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.10);
  padding: 16px;
  animation: bc-slide-up 0.25s ease-out;
}

@keyframes bc-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* -------------------------------------------------------------------------
 * Box variant — κουτί σε γωνία αντί για μπάρα σε όλο το πλάτος.
 *
 * ΓΙΑΤΙ ΑΡΙΣΤΕΡΑ: η δεξιά πλευρά ανήκει στο widget του chatbot. Το launcher
 * είναι 54x54 στο bottom:16/right:16, αλλά το ΑΝΟΙΧΤΟ panel είναι 370x560 και
 * φτάνει από top:70 ως bottom:90 — οπότε οποιοδήποτε κουτί δεξιά σκεπάζει τη
 * συνομιλία μόλις ο επισκέπτης πατήσει το κουμπί (μετρημένο live 9/9/2026,
 * OVERLAP: true). Κανένα bottom offset δεν το λύνει. Αριστερά η γωνία είναι
 * ελεύθερη, άρα το κουτί κάθεται κανονικά στα 16px.
 *
 * Το --box-right μένει διαθέσιμο για sites με το widget αριστερά· εκεί το
 * offset των 96px κρατάει το κουτί πάνω από το launcher.
 * ---------------------------------------------------------------------- */
.bc-banner--box {
  width: auto;
  max-width: 370px;
  padding: 20px;
  border: 1px solid var(--bc-line);
  border-radius: 4px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.35);
  animation: bc-fade-in 0.25s ease-out;
}

.bc-banner--box-left {
  right: auto;
  left: 16px;
  bottom: 16px;
}

.bc-banner--box-right {
  left: auto;
  right: 16px;
  bottom: 96px; /* πάνω από το launcher, όταν το widget είναι αριστερά */
}

@keyframes bc-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bc-banner--box .bc-banner__title { font-size: 16px; }
.bc-banner--box .bc-banner__desc  { font-size: 13.5px; }
.bc-banner--box .bc-btn {
  padding: 9px 14px;
  font-size: 13px;
  min-height: 40px;
}

/* Σε στενές οθόνες το κουτί πιάνει όλο το πλάτος (με περιθώρια). */
@media (max-width: 480px) {
  .bc-banner--box,
  .bc-banner--box-left,
  .bc-banner--box-right {
    left: 16px;
    right: 16px;
    max-width: none;
  }
}

.bc-banner__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bc-banner__title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
}

.bc-banner__desc {
  margin: 0;
  font-size: 14px;
}

/* ID-scoped ώστε να υπερισχύουν των Tailwind/base styles */
#bistorming-consent-banner .bc-banner__title,
#bistorming-consent-modal .bc-modal__title,
#bistorming-consent-modal .bc-cat__title {
  color: var(--bc-text);
}
#bistorming-consent-banner .bc-banner__desc,
#bistorming-consent-modal .bc-cat__desc {
  color: var(--bc-muted);
}

.bc-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* -------------------------------------------------------------------------
 * Buttons
 * ---------------------------------------------------------------------- */
.bc-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
  flex: 1 1 auto;
  min-height: 44px; /* touch target */
}

.bc-btn:focus-visible {
  outline: 3px solid var(--bc-btn1-bg);
  outline-offset: 2px;
}

#bistorming-consent-banner .bc-btn--primary,
#bistorming-consent-modal .bc-btn--primary {
  background: var(--bc-btn1-bg);
  color: var(--bc-btn1-text);
  border-color: var(--bc-btn1-border);
}
#bistorming-consent-banner .bc-btn--primary:hover,
#bistorming-consent-modal .bc-btn--primary:hover { filter: brightness(0.92); }

#bistorming-consent-banner .bc-btn--secondary,
#bistorming-consent-modal .bc-btn--secondary {
  background: var(--bc-btn2-bg);
  color: var(--bc-btn2-text);
  border-color: var(--bc-btn2-border);
}
/* Σε light θέμα το brightness() δεν φαίνεται — αλλάζουμε φόντο/περίγραμμα. */
#bistorming-consent-banner .bc-btn--secondary:hover,
#bistorming-consent-modal .bc-btn--secondary:hover {
  background: #f6f6f6;
  border-color: #d4d4d8;
}

/* -------------------------------------------------------------------------
 * Preferences modal
 * ---------------------------------------------------------------------- */
.bc-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483601;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.bc-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.45);
}

.bc-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bc-bg);
  border: 1px solid var(--bc-line);
  border-radius: 4px;
  padding: 24px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.35);
}

.bc-modal__title {
  margin: 0 0 16px;
  font-size: 19px;
  font-weight: 700;
}

.bc-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 3px;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
#bistorming-consent-modal .bc-modal__close {
  background: transparent;
  color: var(--bc-muted);
  border: 1px solid transparent;
}
#bistorming-consent-modal .bc-modal__close:hover {
  background: #f6f6f6;
  color: var(--bc-text);
}
#bistorming-consent-modal .bc-modal__close:focus-visible {
  outline: 3px solid var(--bc-btn1-bg);
  outline-offset: 2px;
}

.bc-modal__cats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}

.bc-cat {
  padding: 14px 0;
  border-bottom: 1px solid var(--bc-line);
}
.bc-cat:last-child { border-bottom: 0; }

.bc-cat__label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 600;
}

.bc-cat__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

/* iOS-style switch */
.bc-cat__switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  border-radius: 3px;
  background: #d4d4d8;
  transition: background 0.2s ease;
}
.bc-cat__switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.bc-cat__input:checked + .bc-cat__switch { background: var(--bc-btn1-bg); }
.bc-cat__input:checked + .bc-cat__switch::after { transform: translateX(18px); }
.bc-cat__input:disabled + .bc-cat__switch { opacity: 0.5; cursor: not-allowed; }
.bc-cat__input:focus-visible + .bc-cat__switch {
  outline: 3px solid var(--bc-btn1-bg);
  outline-offset: 2px;
}

.bc-cat__title { font-size: 15px; }

.bc-cat__desc {
  margin: 6px 0 0 56px;
  font-size: 13px;
}

.bc-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* -------------------------------------------------------------------------
 * Desktop
 * ---------------------------------------------------------------------- */
@media (min-width: 768px) {
  .bc-banner__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .bc-banner__text { flex: 1 1 auto; }
  .bc-banner__actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
  }
  .bc-btn { flex: 0 0 auto; }

  /* Το κουτί μένει σε στήλη σε κάθε πλάτος — δεν χωράει σε γραμμή. */
  .bc-banner--box .bc-banner__inner {
    flex-direction: column;
    align-items: stretch;
  }
  .bc-banner--box .bc-banner__actions { flex-wrap: wrap; }
  .bc-banner--box .bc-btn { flex: 1 1 auto; }
}

/* -------------------------------------------------------------------------
 * Reduced motion
 * ---------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .bc-banner,
  .bc-banner--box { animation: none; }
  .bc-btn,
  .bc-cat__switch,
  .bc-cat__switch::after { transition: none; }
}
