/* proguide-companion.css — TSI ProGuide companion side-panel.
 * Slate-900 / orange-500 base, per-species accents.
 * Responsive: docked right ≥768px, bottom slide-up sheet <768px.
 */

#proguide-companion-mount {
  display: block;
}

/* The actual panel is fixed-position and rendered by proguide-companion.js
 * into <body>; the mount div is just a discovery hook so the script knows
 * the page wants a companion. */

.tsi-pgc-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 32px);
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  z-index: 9990;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.tsi-pgc-panel.tsi-pgc-collapsed {
  height: 56px;
  width: 240px;
}

.tsi-pgc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-bottom: 1px solid #334155;
  cursor: pointer;
  user-select: none;
}

.tsi-pgc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid var(--tsi-pgc-accent, #f97316);
}

.tsi-pgc-title {
  flex: 1;
  min-width: 0;
}
.tsi-pgc-title .tsi-pgc-name {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tsi-pgc-title .tsi-pgc-specialty {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tsi-pgc-collapse-btn {
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.tsi-pgc-collapse-btn:hover { color: #f97316; }

.tsi-pgc-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #0b1224;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tsi-pgc-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  word-wrap: break-word;
}
.tsi-pgc-msg-user {
  align-self: flex-end;
  background: #f97316;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.tsi-pgc-msg-guide {
  align-self: flex-start;
  background: #1e293b;
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
  border-left: 3px solid var(--tsi-pgc-accent, #f97316);
}
.tsi-pgc-msg .ad-slot {
  display: block;
  margin-top: 6px;
}
.tsi-pgc-typing {
  align-self: flex-start;
  font-style: italic;
  color: #94a3b8;
  font-size: 12px;
  padding: 4px 12px;
}

.tsi-pgc-footer {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #0f172a;
  border-top: 1px solid #334155;
}
.tsi-pgc-input {
  flex: 1;
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  min-height: 36px;
  max-height: 80px;
}
.tsi-pgc-input:focus {
  outline: 2px solid var(--tsi-pgc-accent, #f97316);
  outline-offset: 0;
  border-color: transparent;
}
.tsi-pgc-send {
  background: var(--tsi-pgc-accent, #f97316);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.tsi-pgc-send:hover { filter: brightness(1.1); }
.tsi-pgc-send:disabled { background: #475569; cursor: not-allowed; }

.tsi-pgc-toolbar {
  display: flex;
  gap: 6px;
  padding: 6px 12px;
  background: #0f172a;
  border-top: 1px solid #1e293b;
  font-size: 11px;
}
.tsi-pgc-toolbar button {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
}
.tsi-pgc-toolbar button:hover { color: #fb923c; border-color: #fb923c; }

.tsi-pgc-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  padding: 20px 10px;
}

/* Species accents (--tsi-pgc-accent applied via data-species on the panel) */
.tsi-pgc-panel[data-species="deer"]    { --tsi-pgc-accent: #92400e; }
.tsi-pgc-panel[data-species="duck"]    { --tsi-pgc-accent: #0ea5e9; }
.tsi-pgc-panel[data-species="turkey"]  { --tsi-pgc-accent: #f97316; }
.tsi-pgc-panel[data-species="elk"]     { --tsi-pgc-accent: #65a30d; }
.tsi-pgc-panel[data-species="goose"]   { --tsi-pgc-accent: #6366f1; }

/* Mobile — slide-up bottom sheet */
@media (max-width: 767px) {
  .tsi-pgc-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 70vh;
    border-radius: 12px 12px 0 0;
    transform: translateY(calc(100% - 56px));
  }
  .tsi-pgc-panel.tsi-pgc-open {
    transform: translateY(0);
  }
  .tsi-pgc-panel.tsi-pgc-collapsed {
    width: 100%;
    height: 56px;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tsi-pgc-panel { transition: none; }
}
