/* ============================================================
   MEDC Invitational — Captain Chat floating widget
   ============================================================ */

.captain-chat-widget {
  position: fixed;
  z-index: 9999;
  bottom: 24px;
  right: 24px;
  font-family: inherit;
}

.captain-chat-widget.hide {
  display: none;
}

/* ----- Launcher button ----- */
.captain-chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(13, 18, 35, 0.95);
  color: rgba(234, 240, 255, 0.98);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(96, 165, 250, 0.2);
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease, background 0.2s ease;
}

.captain-chat-launcher:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.45), 0 0 24px rgba(96, 165, 250, 0.25);
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(20, 28, 50, 0.98);
}

.captain-chat-launcher:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.4);
}

.captain-chat-launcher__icon {
  font-size: 20px;
  line-height: 1;
}

.captain-chat-launcher__label {
  letter-spacing: 0.02em;
}

.captain-chat-launcher__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: captain-chat-badge-pulse 1.5s ease-in-out infinite;
}

.captain-chat-launcher {
  position: relative;
}

@keyframes captain-chat-badge-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.08); }
}

/* ----- Panel (slide-out from right) ----- */
.captain-chat-panel {
  position: fixed;
  inset: 0;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.25s ease;
}

.captain-chat-panel.is-open {
  pointer-events: auto;
  visibility: visible;
}

.captain-chat-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.captain-chat-panel.is-open .captain-chat-panel__backdrop {
  opacity: 1;
}

.captain-chat-panel__drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background: rgba(13, 18, 35, 0.98);
  border-left: 1px solid rgba(96, 165, 250, 0.2);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.captain-chat-panel.is-open .captain-chat-panel__drawer {
  transform: translateX(0);
}

/* Panel header */
.captain-chat-panel__header {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.captain-chat-panel__header-text {
  flex: 1;
  min-width: 0;
}

.captain-chat-panel__title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(234, 240, 255, 0.98);
}

.captain-chat-panel__subtitle {
  margin: 0;
  font-size: 12px;
  color: rgba(183, 195, 230, 0.7);
}

.captain-chat-panel__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(234, 240, 255, 0.9);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.captain-chat-panel__close:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.captain-chat-panel__close:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.4);
}

/* Panel body (scrollable card) */
.captain-chat-panel__body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.captain-chat-card--widget {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

.captain-chat-card__head--widget {
  padding: 12px 20px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.captain-chat-card--widget .captain-chat-messages {
  flex: 1;
  min-height: 200px;
}

.captain-chat-card--widget .captain-chat-compose {
  padding: 12px 20px 20px;
}

/* Mobile: full-width / full-height feel */
@media (max-width: 480px) {
  .captain-chat-widget {
    bottom: 16px;
    right: 16px;
  }

  .captain-chat-launcher {
    padding: 12px 16px;
    font-size: 14px;
  }

  .captain-chat-launcher__label {
    display: none;
  }

  .captain-chat-panel__drawer {
    max-width: 100%;
    border-radius: 0;
  }

  .captain-chat-panel__header {
    padding: 16px 16px 12px;
  }

  .captain-chat-panel__title {
    font-size: 16px;
  }

  .captain-chat-card__head--widget,
  .captain-chat-card--widget .captain-chat-compose {
    padding-left: 16px;
    padding-right: 16px;
  }

  .captain-chat-card--widget .captain-chat-messages {
    padding-left: 16px;
    padding-right: 16px;
  }
}
