/* public/css/kiosk-chat.css: the envelope button and the kids' message pop-up */

#messages-btn { overflow: visible; }

.kc-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  background: #c0392b;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
  pointer-events: none;
}
.kc-badge[hidden] { display: none; }

#messages-btn.kc-has-unread { animation: kc-pulse 1.6s ease-in-out infinite; }
@keyframes kc-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.45); }
  50% { box-shadow: 0 0 0 12px rgba(192, 57, 43, 0); }
}

.kc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.kc-overlay.kc-open { display: flex; }

.kc-modal {
  background: var(--cream);
  border-radius: 20px;
  width: min(92vw, 1100px);
  height: 92vh;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.kc-header { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.kc-header h3 {
  font-size: 1.4rem;
  color: var(--terracotta-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kc-close {
  background: var(--terracotta);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.kc-chips { display: flex; gap: 12px; flex-shrink: 0; }
.kc-chip {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 10px;
  border-radius: 14px;
  border: 2px solid var(--border-tan);
  background: var(--blush);
  color: var(--text-dark);
  cursor: pointer;
  touch-action: manipulation;
}
.kc-chip-name { font-size: 1.35rem; font-weight: 700; }
.kc-chip-sub { font-size: 0.85rem; color: var(--text-mid); }
.kc-chip.kc-picked { background: var(--sage-dark); border-color: var(--sage-dark); color: #fff; }
.kc-chip.kc-picked .kc-chip-sub { color: rgba(255, 255, 255, 0.85); }
.kc-chip.kc-unavailable { opacity: 0.45; }
.kc-chip-dot {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 26px;
  height: 26px;
  border-radius: 13px;
  background: #c0392b;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 26px;
}

.kc-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border: 1.5px solid var(--border-tan);
  border-radius: 12px;
  background: var(--off-white);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kc-empty { margin: auto; color: var(--text-light); font-size: 1.2rem; }
.kc-msg { display: flex; flex-direction: column; max-width: 75%; }
.kc-out { align-self: flex-end; align-items: flex-end; }
.kc-in { align-self: flex-start; align-items: flex-start; }
.kc-bubble {
  padding: 10px 16px;
  border-radius: 18px;
  font-size: 1.2rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.kc-out .kc-bubble { background: var(--sage-dark); color: #fff; border-bottom-right-radius: 6px; }
.kc-in .kc-bubble { background: var(--tan); color: var(--text-dark); border-bottom-left-radius: 6px; }
.kc-meta { font-size: 0.8rem; color: var(--text-light); margin-top: 3px; padding: 0 6px; }

.kc-status { min-height: 1.2em; font-size: 0.95rem; color: var(--text-mid); flex-shrink: 0; }
.kc-status.kc-error { color: #b02a2a; font-weight: 600; }

.kc-input {
  flex-shrink: 0;
  font-size: 1.3rem;
  padding: 12px 16px;
  border: 2px solid var(--terracotta);
  border-radius: 10px;
  outline: none;
  color: var(--text-dark);
  background: var(--blush);
}

.kc-keyboard { flex-shrink: 0; display: flex; flex-direction: column; gap: 7px; }
.kc-kb-row { display: flex; gap: 7px; justify-content: center; }
.kc-key {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--border-tan);
  border-radius: 10px;
  padding: 14px 0;
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  color: var(--text-dark);
}
.kc-key:active { background: var(--tan); }
.kc-key.kc-dark { background: var(--tan); }
.kc-key.kc-wide { flex: 1.5; }
.kc-key.kc-on { background: var(--sage-dark); color: #fff; }
.kc-key.kc-space { flex: 4; }
.kc-key.kc-send { flex: 3; background: var(--sage-dark); color: #fff; font-size: 1.1rem; }
.kc-key.kc-send:disabled { opacity: 0.5; cursor: default; }
