/**
 * Inn of Cape May — AI Concierge styles.
 *
 * v2 — The Inn of Cape May brand system (Harbour Navy + Antique Brass,
 * Cormorant + Jost), inheriting the theme's CSS variables when present.
 *
 * @package IOCM_Concierge
 * @version 2.0.0
 */

:root {
  --iocm-accent: var(--navy, #154577);
  --iocm-accent-deep: var(--navy-deep, #0f3257);
  --iocm-brass: var(--champagne, #e7cf9a);
  --iocm-harbor: #12283f;
  --iocm-black: #0c1c2e;
  --iocm-linen: #fffdf8;
  --iocm-linen-muted: rgba(255, 253, 248, 0.78);
  --iocm-border: rgba(255, 253, 248, 0.16);
  --iocm-radius: 16px;
  --iocm-font-display: "Cormorant", "Cormorant Garamond", "Georgia", serif;
  --iocm-font-body: "Jost", "Montserrat", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
}

/* ── Drawer shell ─────────────────────────────────────────────────── */
.iocm-shell {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99999;
  font-family: var(--iocm-font-body);
}

.iocm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 42, 66, 0.60);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.iocm-drawer {
  position: absolute;
  top: 0;
  width: min(460px, 94vw);
  height: 100%;
  background: linear-gradient(180deg, var(--iocm-harbor) 0%, var(--iocm-black) 100%);
  box-shadow: -18px 0 40px rgba(0, 0, 0, 0.4);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  color: var(--iocm-linen);
}

.iocm-shell--right .iocm-drawer {
  right: 0;
  border-left: 1px solid rgba(194, 163, 107, 0.20);
}
.iocm-shell--left .iocm-drawer {
  left: 0;
  right: auto;
  transform: translateX(-100%);
  border-left: none;
  border-right: 1px solid rgba(194, 163, 107, 0.20);
  box-shadow: 18px 0 40px rgba(0, 0, 0, 0.4);
}

.iocm-shell.is-open {
  pointer-events: auto;
}
.iocm-shell.is-open .iocm-overlay {
  opacity: 1;
}
.iocm-shell.is-open .iocm-drawer {
  transform: translateX(0);
}
body.iocm-open {
  overflow: hidden;
}

/* ── Close ────────────────────────────────────────────────────────── */
.iocm-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--iocm-border);
  border-radius: 999px;
  background: rgba(250, 246, 240, 0.06);
  color: var(--iocm-linen);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: background 0.18s;
}
.iocm-close:hover {
  background: rgba(250, 246, 240, 0.14);
}

/* ── FAB ──────────────────────────────────────────────────────────── */
.iocm-fab {
  position: fixed;
  bottom: 24px;
  min-width: 62px;
  height: 62px;
  padding: 0 22px;
  gap: 10px;
  border: none;
  border-radius: 999px;
  font-family: var(--iocm-font-body);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--iocm-accent) 0%, var(--iocm-accent-deep) 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(13, 42, 66, 0.45);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s, box-shadow 0.18s;
}
.iocm-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 30px rgba(13, 42, 66, 0.55);
}
.iocm-fab--right { right: 24px; }
.iocm-fab--left  { left: 24px; }

/* ── Header ───────────────────────────────────────────────────────── */
.iocm-header {
  padding: 28px 24px 18px;
  background: linear-gradient(180deg, rgba(231, 207, 154, 0.10) 0%, transparent 100%);
  border-bottom: 1px solid var(--iocm-border);
}

.iocm-title {
  font-family: var(--iocm-font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--iocm-brass);
  letter-spacing: 0.01em;
}

.iocm-subtitle {
  font-size: 13px;
  color: var(--iocm-linen-muted);
  margin-top: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Quick actions ────────────────────────────────────────────────── */
.iocm-quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(250, 246, 240, 0.06);
  background: rgba(250, 246, 240, 0.02);
}

.iocm-quick button {
  border: 1px solid var(--iocm-border);
  background: rgba(250, 246, 240, 0.04);
  color: var(--iocm-linen);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 12.5px;
  font-family: var(--iocm-font-body);
  letter-spacing: 0.02em;
  transition: background 0.15s, border-color 0.15s;
}
.iocm-quick button:hover {
  background: rgba(231, 207, 154, 0.14);
  border-color: var(--iocm-brass);
}

/* ── Messages ─────────────────────────────────────────────────────── */
.iocm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: radial-gradient(ellipse at top, rgba(231, 207, 154, 0.06), transparent 50%),
    var(--iocm-black);
}

.iocm-msg {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: var(--iocm-radius);
  line-height: 1.55;
  font-size: 14px;
  font-family: var(--iocm-font-body);
}

.iocm-msg--user {
  align-self: flex-end;
  background: var(--iocm-accent);
  color: #fff;
}

.iocm-msg--assistant {
  align-self: flex-start;
  background: var(--iocm-harbor);
  color: var(--iocm-linen);
  border: 1px solid rgba(194, 163, 107, 0.10);
}

.iocm-msg--assistant a {
  color: var(--iocm-brass);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.iocm-thinking {
  opacity: 0.68;
  font-style: italic;
}

/* ── Form ─────────────────────────────────────────────────────────── */
.iocm-form {
  display: flex;
  gap: 10px;
  padding: 16px 18px;
  border-top: 1px solid var(--iocm-border);
  background: var(--iocm-harbor);
}

.iocm-form input[type="text"] {
  flex: 1;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--iocm-border);
  background: rgba(26, 26, 26, 0.5);
  color: var(--iocm-linen);
  font-size: 14px;
  font-family: var(--iocm-font-body);
  outline: none;
  transition: border-color 0.18s;
}
.iocm-form input[type="text"]:focus {
  border-color: var(--iocm-brass);
}
.iocm-form input[type="text"]::placeholder {
  color: var(--iocm-linen-muted);
}

.iocm-form button {
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 14px;
  background: var(--iocm-accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.iocm-form button:hover {
  opacity: 0.85;
}

/* ── Powered-by ───────────────────────────────────────────────────── */
.iocm-powered {
  text-align: center;
  padding: 8px 16px 10px;
  font-size: 11px;
  color: rgba(255, 253, 248, 0.62);
  background: var(--iocm-harbor);
  letter-spacing: 0.02em;
}
.iocm-powered strong {
  color: rgba(255, 253, 248, 0.8);
}

/* ── Embed widget ─────────────────────────────────────────────────── */
.iocm-widget--embed {
  max-width: 520px;
  border: 1px solid rgba(194, 163, 107, 0.18);
  background: var(--iocm-harbor);
  color: var(--iocm-linen);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  font-family: var(--iocm-font-body);
}

.iocm-widget--embed .iocm-messages {
  min-height: 280px;
  max-height: 420px;
}

/* ── Scrollbar ────────────────────────────────────────────────────── */
.iocm-messages::-webkit-scrollbar {
  width: 6px;
}
.iocm-messages::-webkit-scrollbar-track {
  background: transparent;
}
.iocm-messages::-webkit-scrollbar-thumb {
  background: rgba(194, 163, 107, 0.2);
  border-radius: 3px;
}

/* ── v2 additions ─────────────────────────────────────────────────── */
.iocm-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.iocm-disclosure {
  padding: 10px 18px 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--iocm-linen-muted);
  background: var(--iocm-harbor);
  text-align: center;
  font-family: var(--iocm-font-body);
}

@media (max-width: 640px) {
  .iocm-fab__label { display: none; }
  .iocm-fab { padding: 0; width: 62px; }
}

.iocm-fab:focus-visible,
.iocm-close:focus-visible,
.iocm-quick button:focus-visible,
.iocm-form button:focus-visible,
.iocm-form input[type="text"]:focus-visible,
.iocm-msg a:focus-visible {
  outline: 2px solid var(--iocm-brass);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .iocm-drawer,
  .iocm-overlay,
  .iocm-fab,
  .iocm-quick button,
  .iocm-close {
    transition: none !important;
  }
}

/* Hide the concierge widget while the site mobile nav menu is open, so it doesn't overlap/cover menu items (nav-open class is toggled on <body> by the theme's nav-toggle button). */
body.nav-open .iocm-shell,
body.nav-open .iocm-fab {
  display: none !important;
}
