/* ============================================
   PAAAL v2 — Floating Coach Panel
   ============================================ */

/* --- FAB Button --- */
.coach-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  font-family: 'Inter', sans-serif;
}

.coach-fab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #4F46E5;
  color: #fff;
  border: none;
  border-radius: 28px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.coach-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(79, 70, 229, 0.45);
}

.coach-fab svg {
  flex-shrink: 0;
}

.coach-panel.open .coach-fab {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

/* --- Expanded Panel (base) --- */
.coach-expanded {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 380px;
  height: 540px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease, width 250ms ease, height 250ms ease, border-radius 250ms ease, top 250ms ease, bottom 250ms ease;
}

.coach-panel.open .coach-expanded {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* --- Size: Compact (default) --- */
.coach-panel.size-compact .coach-expanded {
  width: 380px;
  height: 540px;
}

/* --- Size: Expanded --- */
.coach-panel.size-expanded .coach-expanded {
  width: 560px;
  height: 680px;
}

/* --- Size: Side Panel (docked right, full height) --- */
.coach-panel.size-sidepanel {
  bottom: 0;
  right: 0;
  top: 0;
}

.coach-panel.size-sidepanel .coach-fab {
  opacity: 0;
  pointer-events: none;
}

.coach-panel.size-sidepanel .coach-expanded {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  height: 100%;
  border-radius: 0;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

/* --- Panel Header --- */
.coach-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #4F46E5;
  color: #fff;
  flex-shrink: 0;
}

.coach-panel-title {
  font-size: 15px;
  font-weight: 600;
}

.coach-panel-actions {
  display: flex;
  gap: 4px;
}

.coach-panel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  transition: background 150ms ease;
}

.coach-panel-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* --- Panel Body (ChatKit container) --- */
.coach-panel-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.coach-panel-loading,
.coach-panel-error,
.coach-panel-expired {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  text-align: center;
  color: #6B7280;
  font-size: 14px;
  gap: 12px;
}

.coach-panel-extend {
  display: inline-block;
  padding: 8px 20px;
  background: #4F46E5;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

.coach-panel-extend:hover {
  background: #4338CA;
}

/* --- Suggestion Chips --- */
.coach-panel-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid #E5E7EB;
  background: #F9FAFB;
  flex-shrink: 0;
}

.coach-panel-suggestions:empty {
  display: none;
}

.coach-chip {
  padding: 6px 14px;
  background: #EEF2FF;
  color: #4F46E5;
  border: 1px solid #C7D2FE;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  white-space: nowrap;
}

.coach-chip:hover {
  background: #4F46E5;
  color: #fff;
}

/* --- Journey Nudge Banner --- */
.journey-nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  margin-top: 12px;
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  border-radius: 12px;
  font-size: 14px;
}

.journey-nudge-text {
  color: #1F2937;
}

.journey-nudge-link {
  color: #4F46E5;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.journey-nudge-link:hover {
  text-decoration: underline;
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .coach-panel {
    bottom: 16px;
    right: 16px;
  }

  .coach-fab .coach-fab-label {
    display: none;
  }

  .coach-fab {
    padding: 14px;
    border-radius: 50%;
  }

  /* Mobile always goes full-screen regardless of size class */
  .coach-expanded,
  .coach-panel.size-compact .coach-expanded,
  .coach-panel.size-expanded .coach-expanded,
  .coach-panel.size-sidepanel .coach-expanded {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    box-shadow: none;
  }

  /* Hide expand button on mobile — already full screen */
  #coach-expand {
    display: none;
  }

  .journey-nudge {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
