/* ═══════════════════════════════════════════════
   14-ponte-caregiver.css — v1.2
   ═══════════════════════════════════════════════ */

/* ─── BRIDGE OVERLAY (visibile su qualunque schermata) ─── */
#cgbridge-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
}

.cgb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.40);
  backdrop-filter: blur(3px);
}

.cgb-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 16px 18px 32px;
  box-shadow: 0 -8px 40px rgba(0,0,0,.22);
  animation: slideUpPanel .3s cubic-bezier(.22,1,.36,1);
}

@keyframes slideUpPanel {
  from { transform: translateY(100%); opacity:0; }
  to   { transform: translateY(0);    opacity:1; }
}

.cgb-panel-label {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 10px;
  opacity: .8;
}

.cgb-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg);
}

.cgb-icon { font-size: 36px; flex-shrink: 0; line-height: 1; }

.cgb-meta { flex: 1; min-width: 0; }

.cgb-who {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 3px;
}

.cgb-what {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.cgb-close {
  background: var(--bg);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cgb-section {
  padding: 9px 11px;
  border-radius: 11px;
  margin-bottom: 7px;
}

.cgb-reply  { background: #eff6ff; }
.cgb-action { background: #f0fdf4; }
.cgb-avoid  { background: #fff7ed; }

.cgb-section-label {
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cgb-reply  .cgb-section-label { color: #1d4ed8; }
.cgb-action .cgb-section-label { color: #15803d; }
.cgb-avoid  .cgb-section-label { color: #c2410c; }

.cgb-section-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
}

.cgb-loading-dot {
  font-size: 9px;
  opacity: .6;
  animation: blink 1s infinite;
}
@keyframes blink { 0%,100%{opacity:.3} 50%{opacity:1} }

.cgb-footer { margin-top: 13px; }

.cgb-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 13px;
  font: 800 14px 'Nunito', sans-serif;
  cursor: pointer;
  transition: transform .15s;
}
.cgb-btn:active { transform: scale(.98); }

.cgb-btn-ok {
  background: var(--grass);
  color: #fff;
}

/* ─── BANNER CONFERMA SULLA SCHERMATA UTENTE ────────────── */
#user-sent-banner {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8500;
  background: var(--white);
  border-radius: 16px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 28px rgba(0,0,0,.16);
  border: 2px solid var(--grass);
  min-width: 260px;
  max-width: 340px;
  animation: popIn .3s cubic-bezier(.22,1,.36,1);
  transition: opacity .3s, transform .3s;
}

@keyframes popIn {
  from { transform: translateX(-50%) scale(.85); opacity:0; }
  to   { transform: translateX(-50%) scale(1);   opacity:1; }
}

.usb-icon { font-size: 26px; flex-shrink: 0; }

.usb-text { flex: 1; }

.usb-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--grass);
}

.usb-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-soft);
  line-height: 1.4;
  margin-top: 2px;
}

.usb-check {
  font-size: 18px;
  font-weight: 900;
  color: var(--grass);
  flex-shrink: 0;
}

/* ─── CAMPANELLA TOPBAR CAREGIVER ────────────────────────── */
.cgb-notif-bell {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 20px;
  transition: background .15s;
  font-size: 14px;
}
.cgb-notif-bell:hover { background: rgba(0,0,0,.06); }

.cgb-notif-bell .pill-cg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#cg-notif-badge {
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--rose);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: 900;
  flex-shrink: 0;
  animation: pulse-badge .5s ease;
}

@keyframes pulse-badge {
  0%   { transform: scale(.5); opacity:0; }
  60%  { transform: scale(1.25); }
  100% { transform: scale(1);  opacity:1; }
}

/* ─── PANNELLO NOTIFICHE (dropdown) ──────────────────────── */
#cg-notif-panel {
  position: fixed;
  top: 54px;
  right: 8px;
  width: min(340px, calc(100vw - 16px));
  max-height: 72vh;
  overflow-y: auto;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 8px 36px rgba(0,0,0,.18);
  z-index: 8000;
  padding: 0 0 8px;
  animation: slideDown .25s ease;
}

@keyframes slideDown {
  from { transform: translateY(-10px); opacity:0; }
  to   { transform: translateY(0);     opacity:1; }
}

.cgn-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 2px solid var(--bg);
  position: sticky;
  top: 0;
  background: var(--white);
  border-radius: 20px 20px 0 0;
}

.cgn-panel-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.cgn-panel-close {
  background: var(--bg);
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cgn-item {
  background: var(--bg);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 8px 10px 0;
}

.cgn-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.cgn-emoji { font-size: 18px; flex-shrink: 0; }

.cgn-label {
  flex: 1;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}

.cgn-time {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-soft);
}

.cgn-reply {
  font-size: 11px;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  border-radius: 7px;
  padding: 5px 8px;
  margin-bottom: 4px;
  line-height: 1.4;
}

.cgn-action {
  font-size: 11px;
  font-weight: 600;
  color: #15803d;
  background: #f0fdf4;
  border-radius: 7px;
  padding: 5px 8px;
  margin-bottom: 4px;
  line-height: 1.4;
}

.cgn-avoid {
  font-size: 11px;
  font-weight: 600;
  color: #c2410c;
  background: #fff7ed;
  border-radius: 7px;
  padding: 5px 8px;
  line-height: 1.4;
}

/* ─── DIARIO NARRATIVO ────────────────────────────────────── */
#bridge-diary-container {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}

.nd-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
}

.nd-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--bg);
  border-top-color: var(--violet);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.nd-arc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 12px;
}

.nd-summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 14px;
}

.nd-section-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-soft);
  margin: 12px 0 6px;
}

.nd-highlight {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  padding: 5px 8px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 4px;
  line-height: 1.4;
}

.nd-suggestion {
  font-size: 12px;
  font-weight: 700;
  color: var(--ocean);
  background: var(--ocean-pale);
  padding: 7px 10px;
  border-radius: 9px;
  margin-bottom: 5px;
  line-height: 1.4;
}

/* ─── TRADUTTORE COMPORTAMENTALE ─────────────────────────── */
.behavior-catalog-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-soft);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

#behavior-catalog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 12px;
}

.beh-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
}
.beh-btn:active { transform: scale(.97); }
.beh-btn.sel { background: var(--violet-pale); border-color: var(--violet); }

.beh-emoji { font-size: 18px; flex-shrink: 0; }
.beh-label { font-size: 11px; font-weight: 700; color: var(--text); line-height: 1.3; }
.beh-btn.sel .beh-label { color: var(--violet); }

.beh-context {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font: 700 12px 'Nunito', sans-serif;
  color: var(--text);
  width: 100%;
  margin-bottom: 10px;
  resize: none;
  outline: none;
  box-sizing: border-box;
}
.beh-context:focus { border-color: var(--violet); }

#behavior-translate-btn {
  width: 100%;
  padding: 13px;
  background: var(--violet);
  color: #fff;
  border: none;
  border-radius: 12px;
  font: 800 14px 'Nunito', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform .15s;
}
#behavior-translate-btn:active { transform: scale(.98); }

.bt-result { display: flex; flex-direction: column; gap: 9px; }

.bt-meaning { background: #eff6ff; border-radius: 12px; padding: 11px 13px; }

.bt-section-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-soft);
  margin-bottom: 5px;
}

.bt-section-text { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.5; }

.bt-triggers { padding: 9px 13px; background: var(--bg); border-radius: 12px; }

.bt-tag {
  display: inline-block;
  background: var(--sun-pale);
  color: var(--coral);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  margin: 2px 3px 2px 0;
}

.bt-respond { background: #f0fdf4; border-radius: 12px; padding: 11px 13px; }

.bt-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.bt-num {
  background: var(--grass);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  flex-shrink: 0;
  margin-top: 1px;
}

.bt-prevent { background: #fff7ed; border-radius: 12px; padding: 11px 13px; }

/* ─── TAB PONTE ───────────────────────────────────────────── */
.ponte-tab-container { padding: 0 16px 40px; }
.ponte-section-card { background: var(--white); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); margin-bottom: 13px; }
.ponte-section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ponte-section-icon { font-size: 20px; }
.ponte-section-title { font-size: 14px; font-weight: 800; color: var(--text); }
.ponte-section-sub { font-size: 11px; font-weight: 600; color: var(--text-soft); margin-bottom: 13px; line-height: 1.4; }
.ponte-divider { height: 1px; background: var(--bg); margin: 12px 0; }

@keyframes fadeIn { from{opacity:0} to{opacity:1} }
