/* ============================================================
   The Haven Collection | AI Concierge widget
   Refined luxury chat panel matched to the brand palette.
   ============================================================ */

:root {
    --hc-bg: #faf8f5;
    --hc-bg-alt: #f1ede6;
    --hc-text: #2c2c2c;
    --hc-muted: #6f6a62;
    --hc-line: rgba(0, 0, 0, 0.08);
    --hc-gold: #c9a96e;
    --hc-gold-soft: rgba(201, 169, 110, 0.14);
    --hc-shadow: 0 18px 60px rgba(20, 16, 10, 0.18);
}

/* Launcher (bottom-right, above the existing floating reserve tab) */
.hc-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #1c1a17;
    color: #f5efe2;
    border: 1px solid rgba(201, 169, 110, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 30px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.02em;
    box-shadow: var(--hc-shadow);
    z-index: 9998;
    transition: transform 0.25s ease, background 0.25s ease;
}
.hc-launcher:hover {
    transform: translateY(-2px);
    background: #2a2620;
}
.hc-launcher.is-open {
    transform: scale(0.85);
    opacity: 0;
    pointer-events: none;
}

/* Panel */
.hc-panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 48px);
    background: var(--hc-bg);
    border-radius: 4px;
    box-shadow: var(--hc-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease;
    z-index: 9999;
    font-family: 'Montserrat', sans-serif;
    color: var(--hc-text);
}
.hc-panel.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header */
.hc-header {
    padding: 20px 22px 16px;
    background: #1c1a17;
    color: #f5efe2;
    border-bottom: 1px solid rgba(201, 169, 110, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.hc-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hc-header-eyebrow {
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--hc-gold);
}
.hc-header-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.1;
}
.hc-close {
    background: transparent;
    border: 0;
    color: #f5efe2;
    cursor: pointer;
    padding: 6px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    line-height: 0;
}
.hc-close:hover { opacity: 1; }

/* Message stream */
.hc-stream {
    flex: 1;
    overflow-y: auto;
    padding: 20px 18px 12px;
    background: var(--hc-bg);
    scrollbar-width: thin;
    scrollbar-color: var(--hc-line) transparent;
}
.hc-stream::-webkit-scrollbar { width: 6px; }
.hc-stream::-webkit-scrollbar-thumb {
    background: var(--hc-line);
    border-radius: 3px;
}

.hc-msg {
    margin-bottom: 12px;
    max-width: 86%;
    font-size: 13.5px;
    line-height: 1.55;
    letter-spacing: 0.01em;
    animation: hc-fade-in 0.3s ease;
}
.hc-msg-bot {
    background: #fff;
    border: 1px solid var(--hc-line);
    color: var(--hc-text);
    padding: 10px 14px;
    border-radius: 2px;
    align-self: flex-start;
}
.hc-msg-user {
    background: var(--hc-gold-soft);
    color: var(--hc-text);
    padding: 10px 14px;
    border-radius: 2px;
    margin-left: auto;
    text-align: right;
}
.hc-msg-row {
    display: flex;
}
.hc-msg-row.bot { justify-content: flex-start; }
.hc-msg-row.user { justify-content: flex-end; }

@keyframes hc-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Typing indicator */
.hc-typing {
    display: inline-flex;
    gap: 4px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--hc-line);
    border-radius: 2px;
}
.hc-typing span {
    width: 5px;
    height: 5px;
    background: var(--hc-muted);
    border-radius: 50%;
    animation: hc-bounce 1.2s infinite ease-in-out;
}
.hc-typing span:nth-child(2) { animation-delay: 0.15s; }
.hc-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes hc-bounce {
    0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

/* Quick reply chips */
.hc-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 6px;
}
.hc-chip {
    background: transparent;
    border: 1px solid var(--hc-gold);
    color: var(--hc-text);
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 7px 12px;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.hc-chip:hover {
    background: var(--hc-gold);
    color: #fff;
}

/* Handoff form */
.hc-handoff-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--hc-line);
    border-radius: 2px;
    margin-top: 4px;
}
.hc-handoff-form input,
.hc-handoff-form textarea {
    border: 1px solid var(--hc-line);
    background: var(--hc-bg);
    padding: 8px 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: var(--hc-text);
    border-radius: 2px;
    outline: none;
    transition: border-color 0.2s ease;
}
.hc-handoff-form input:focus,
.hc-handoff-form textarea:focus {
    border-color: var(--hc-gold);
}
.hc-handoff-form button {
    background: #1c1a17;
    color: #f5efe2;
    border: 0;
    padding: 9px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease;
}
.hc-handoff-form button:hover { background: #2a2620; }

/* Footer input */
.hc-input-row {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--hc-line);
    background: #fff;
    padding: 10px 12px;
    gap: 8px;
}
.hc-input {
    flex: 1;
    border: 0;
    background: transparent;
    font-family: 'Montserrat', sans-serif;
    font-size: 13.5px;
    color: var(--hc-text);
    outline: none;
    padding: 6px 4px;
}
.hc-input::placeholder { color: var(--hc-muted); }
.hc-send {
    background: transparent;
    border: 0;
    color: var(--hc-gold);
    cursor: pointer;
    padding: 6px;
    line-height: 0;
    transition: transform 0.2s ease;
}
.hc-send:hover { transform: translateX(2px); }
.hc-send:disabled { color: var(--hc-muted); cursor: not-allowed; }

.hc-footer-note {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 11px;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0.12em;
    color: var(--hc-muted);
    text-align: center;
    padding: 8px 10px 12px;
    background: #fff;
    white-space: nowrap;
}

/* Mobile: full-width panel on small screens */
@media (max-width: 480px) {
    .hc-panel {
        right: 8px;
        left: 8px;
        bottom: 8px;
        width: auto;
        max-width: none;
        height: calc(100vh - 16px);
        max-height: calc(100vh - 16px);
    }
    .hc-launcher {
        right: 16px;
        bottom: 16px;
        width: 54px;
        height: 54px;
        font-size: 26px;
    }
}
