/* patch.css */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    min-height: 100vh;
}

/* ── Floating toggle button (pill shape) ───────────────────── */
#chat-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 22px;
    height: 50px;
    background: #003366;
    color: white;
    border: none;
    border-radius: 25px;          /* pill — fully curved left & right edges */
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 16px rgba(0, 51, 102, 0.45);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    z-index: 9998;
}
#chat-toggle-btn:hover {
    background: #002244;
    box-shadow: 0 6px 20px rgba(0, 51, 102, 0.55);
    transform: translateY(-1px);
}
#chat-toggle-btn.hidden {
    display: none;
}

/* ── Chat container (floating widget) ──────────────────────── */
#chat-container {
    position: fixed;
    bottom: 88px;                  /* sits above the toggle button */
    right: 24px;
    width: 460px;
    height: 620px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dcdcdc;
    z-index: 9999;

    /* hidden state */
    visibility: hidden;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.25s ease, transform 0.25s ease,
                visibility 0s linear 0.25s;
}
#chat-container.open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease,
                visibility 0s linear 0s;
}

/* ── Header ────────────────────────────────────────────────── */
#chat-header {
    background-color: #003366;
    color: white;
    padding: 12px 14px;
    font-weight: bold;
    font-size: 15px;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
#notify-btn,
#home-btn,
#minimize-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    padding: 5px 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
#notify-btn:hover,
#home-btn:hover,
#minimize-btn:hover {
    background: rgba(255,255,255,0.3);
    color: white;
}

/* ── Chat box ───────────────────────────────────────────────── */
#chat-box {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    background-color: #f9fbfd;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.message {
    padding: 9px 13px;
    border-radius: 8px;
    max-width: 85%;
    font-size: 13.5px;
    line-height: 1.45;
    word-wrap: break-word;
}
.bot-msg {
    background-color: #e6f0fa;
    color: #002244;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}
.user-msg {
    background-color: #e2f7e3;
    color: #1b4d22;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

/* ── Main menu ──────────────────────────────────────────────── */
.quick-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 2px 0;
    align-self: flex-start;
}
.menu-btn {
    background: white;
    border: 1px solid #003366;
    border-radius: 16px;
    padding: 5px 13px;
    cursor: pointer;
    font-size: 12.5px;
    color: #003366;
    font-weight: 500;
    transition: all 0.18s ease;
}
.menu-btn:hover {
    background: #003366;
    color: white;
}

/* ── PII collection menu ────────────────────────────────────── */
.pii-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 2px 0;
    align-self: flex-start;
    max-width: 95%;
}
.pii-menu.disabled {
    opacity: 0.4;
    pointer-events: none;
}
.pii-btn {
    background: white;
    border: 1px solid #0066cc;
    border-radius: 16px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 12px;
    color: #0066cc;
    font-weight: 500;
    transition: all 0.18s ease;
}
.pii-btn:hover {
    background: #0066cc;
    color: white;
}
.pii-btn.done-btn {
    border-color: #006633;
    color: #006633;
}
.pii-btn.done-btn:hover {
    background: #006633;
    color: white;
}
.pii-btn.skip-btn {
    border-color: #999;
    color: #999;
}
.pii-btn.skip-btn:hover {
    background: #999;
    color: white;
}

/* ── Notify team prompt ─────────────────────────────────────── */
.notify-prompt {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-self: flex-start;
    margin: 2px 0;
}
.notify-prompt.disabled {
    opacity: 0.4;
    pointer-events: none;
}
.notify-yes-btn {
    background: #003366 !important;
    color: white !important;
    border-color: #003366 !important;
}
.notify-yes-btn:hover {
    background: #002244 !important;
}
.notify-no-btn {
    border-color: #999 !important;
    color: #999 !important;
}
.notify-no-btn:hover {
    background: #999 !important;
    color: white !important;
}

/* ── Message feedback (thumbs up / down) ────────────────────── */
.feedback-row {
    display: flex;
    align-items: center;
    gap: 5px;
    align-self: flex-start;
    margin-top: -6px;
    padding-left: 4px;
}
.feedback-label {
    font-size: 11px;
    color: #999;
}
.feedback-btn {
    background: none;
    border: none;
    border-radius: 5px;
    padding: 3px 5px;
    cursor: pointer;
    color: #ccc;
    display: flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}
.feedback-btn:hover:not(:disabled) {
    color: #666;
    background: #f0f4f8;
}
.feedback-btn.voted-up {
    color: #16a34a;
}
.feedback-btn.voted-down {
    color: #dc2626;
}
.feedback-btn:disabled:not(.voted-up):not(.voted-down) {
    opacity: 0.3;
    cursor: default;
}
.feedback-thanks {
    font-size: 11px;
    color: #006633;
    font-weight: 500;
}

/* ── Links ──────────────────────────────────────────────────── */
.chat-link {
    display: inline-block;
    margin-top: 7px;
    color: #0056b3;
    text-decoration: underline;
    font-weight: bold;
    font-size: 13px;
}

/* ── Input area ─────────────────────────────────────────────── */
#input-area {
    display: flex;
    padding: 10px 12px;
    background: white;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}
#user-input {
    flex: 1;
    padding: 10px 13px;
    border: 1px solid #ccc;
    border-radius: 6px;
    outline: none;
    font-size: 13.5px;
}
#user-input:focus {
    border-color: #003366;
}
#send-btn {
    padding: 10px 18px;
    background: #003366;
    color: white;
    border: none;
    border-radius: 6px;
    margin-left: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13.5px;
    transition: background 0.18s;
}
#send-btn:hover  { background: #002244; }
#send-btn:disabled { background: #7a9cc0; cursor: not-allowed; }
