﻿:root {
    --Whistle-primary: #D97706;
    /* Vibrant Orange */
    --Whistle-secondary: #34302E;
    /* Dark Grey/Brown for User Bubble */
    --Whistle-bg-dark: #1C1917;
    /* rgb(28 25 23) as requested */
    --Whistle-text-light: #ffffff;
    --Whistle-text-muted: #6b7280;
    --Whistle-input-bg: #121212;
    --Whistle-border-dark: rgba(255, 255, 255, 0.05);
}

/* Force Material Symbols Font */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined' !important;
    font-weight: normal !important;
    font-style: normal !important;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

#Whistle-chat-widget * {
    box-sizing: border-box;
}

#Whistle-chat-widget {
    position: fixed;
    bottom: 15px;
    right: 15px;
    width: 575px;
    height: 490px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    background: #1c1c1c;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 9999999999;
    transform: translateY(120%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    border: 1px solid var(--Whistle-border-dark);
}

/* Responsive adjustments */
@media screen and (max-width: 620px) {
    #Whistle-chat-widget {
        width: calc(100vw - 20px) !important;
        height: min(600px, calc(100vh - 20px)) !important;
        bottom: 10px !important;
        right: 10px !important;
        border-radius: 20px !important;
    }
}

@media screen and (max-width: 480px) {
    #Whistle-chat-widget {
        width: 100% !important;
        height: 100% !important;
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
        max-width: 100% !important;
        max-height: 100% !important;
    }
}

#Whistle-chat-widget.open {
    transform: translateY(0);
}

/* Header */
#Whistle-chat-header {
    background: #1C1917;
    /* Matches design color precisely */
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.Whistle-header-left {
    display: flex;
    align-items: center;
}

.Whistle-header-info h1 {
    font-size: 16px;
    font-weight: 400;
    margin: 0;
    color: var(--Whistle-text-light);
}

/* Hide header sub-elements as per design */
.Whistle-avatar-circle,
.Whistle-header-info p {
    display: none !important;
}

.Whistle-header-actions {
    display: flex;
    gap: 12px;
}

.Whistle-header-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--Whistle-text-light);
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 4px;
}

.Whistle-header-btn:hover {
    opacity: 1;
    background: transparent !important;
    box-shadow: none !important;
}

/* Chat Messages Area */
#Whistle-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    background: rgb(41 37 36 / 0.5);
}

#Whistle-chat-messages::-webkit-scrollbar {
    width: 4px;
}

#Whistle-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Message Structure */
#Whistle-chat-messages .message {
    display: flex;
    gap: 12px;
    width: 100%;
    padding: 15px;
}

#Whistle-chat-messages .message.bot {
    align-self: flex-start;
}

#Whistle-chat-messages .message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.Whistle-avatar-small {
    width: 36px;
    height: 36px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

#Whistle-chat-messages .message-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 95%;
}

.Whistle-bot-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--Whistle-text-muted);
    margin: 0;
}

.message.user .Whistle-bot-name {
    text-align: right;
}

.message-bubble {
    padding: 14px 20px;
    font-size: 15px;
    line-height: 1.5;
}

.bot-bubble {
    background: #ffffff;
    color: #1c1719;
    border-radius: 2px 20px 20px 20px;
}

.user-bubble {
    background: var(--Whistle-secondary);
    color: #ffffff;
    border-radius: 20px 20px 2px 20px;
}

/* Bot bubble content structure */
.bot-bubble p {
    margin: 0 0 8px 0;
}

.bot-bubble p:last-child {
    margin-bottom: 0;
}

.bot-bubble ol.cwai-list {
    margin: 8px 0 8px 0;
    padding-left: 22px;
    list-style-type: decimal;
    /* always show 1. 2. 3. */
}

.bot-bubble ol.cwai-list li {
    margin-bottom: 12px;
    line-height: 1.55;
    display: list-item;
    /* preserve the ::marker (number) — never use flex here */
}

.bot-bubble ol.cwai-list li:last-child {
    margin-bottom: 0;
}

/* Recipe title (bold part of numbered item) */
.cwai-item-title {
    font-weight: 600;
    font-size: 0.95em;
    line-height: 1.4;
    display: block;
    /* stack title above description */
}

/* Description text below the title */
.cwai-item-desc {
    font-size: 15px;
    color: #1c1719;
    line-height: 1.5;
    display: block;
}

/* Bullet list */
.bot-bubble ul.cwai-list {
    padding-left: 20px;
    list-style-type: disc;
}

.bot-bubble ul.cwai-list li {
    margin-bottom: 6px;
    line-height: 1.55;
}

/* Inline heading (### in AI markdown) */
.bot-bubble .cwai-heading {
    font-size: 0.95em;
    font-weight: 700;
    margin: 10px 0 4px;
    color: #ffffff;
}

.bot-bubble a.cwai-link {
    color: #56b8f5;
    text-decoration: none;
    word-break: break-all;
    font-size: 15px;
}

.bot-bubble a.cwai-link:hover {
    text-decoration: underline;
}

/* Copy Response Button — dark circle, icon-only */
.cwai-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: rgba(40, 40, 40, 0.85);
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease, transform 0.15s ease;
    margin-top: 6px;
    flex-shrink: 0;
    padding: 0;
}

#Whistle-chat-messages .message:hover .cwai-copy-btn,
#Whistle-chat-messages .cwai-copy-btn:focus {
    opacity: 1;
}

#Whistle-chat-messages .cwai-copy-btn:hover {
    background: rgba(60, 60, 60, 0.95);
    transform: scale(1.08);
}

.cwai-copy-btn:active {
    transform: scale(0.95);
}

.cwai-copy-btn .cwai-copy-icon {
    font-size: 15px;
    line-height: 1;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

/* Copied state — keep visible, icon becomes a check */
.cwai-copy-btn.cwai-copied {
    background: rgba(40, 40, 40, 0.85);
    opacity: 1;
}

.cwai-copy-btn.cwai-copied .cwai-copy-icon {
    color: #4ade80;
}

/* Blinking block cursor loader */
.cwai-cursor-blink {
    width: 14px;
    height: 28px;
    background: #ffffff;
    border-radius: 3px;
    animation: cwai-cursor-flash 1s step-start infinite;
    margin-top: 4px;
}

@keyframes cwai-cursor-flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Inline typewriter cursor — trails text during reveal */
.cwai-inline-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #ffffff;
    border-radius: 1px;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cwai-cursor-flash 0.65s step-start infinite;
}

/* Footer & Input */
#Whistle-chat-footer {
    background: rgb(41 37 36 / 0.5);
    background: #2f2f2f;
    position: relative;
    display: flex;
    align-items: center;
    padding-bottom: 16px;
    background: rgb(41 37 36 / 0.5);
}

.Whistle-input-pill-container {
    background: #222;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 31px;
    border-radius: 26px;
    border: 1px solid #4f4f4f32;
    width: 100%;
    font-size: 15px;
    font-weight: 400;
    color: #ffffff;
}

#Whistle-chat-input {
    flex: 1;
    background: transparent;
    border: none !important;
    box-shadow: none !important;
    padding: 12px 0;
    color: #ffffff;
    font-size: 15px;
    outline: none;
}

#Whistle-chat-input::placeholder {
    color: var(--Whistle-text-muted);
    font-weight: 600;
}

#Whistle-chat-send {
    background: rgb(217 119 6 / 1);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
    flex-shrink: 0;
    padding: 0;
}

#Whistle-chat-send:hover:not(:disabled) {
    background: #f59e0b;
}

#Whistle-chat-send:disabled {
    background: rgb(217 119 6 / 0.5);
    cursor: not-allowed;
    transform: none;
}

#Whistle-chat-send .material-symbols-outlined {
    font-size: 22px;
    color: #fff;
}

/* Timer shown in send button during response */
#Whistle-chat-send .Whistle-timer {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

#Whistle-chat-send.loading {
    cursor: not-allowed;
    opacity: 0.9;
}

/* Disabled input while waiting */
#Whistle-chat-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Toggle Button */
#Whistle-chat-toggle {
    position: fixed !important;
    bottom: 15px !important;
    right: 15px !important;
    width: 84px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--Whistle-primary);
    color: white;
    border-radius: 50% !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 9999999 !important;
    cursor: pointer !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#Whistle-chat-toggle:hover {
    transform: scale(1.1);
}

#Whistle-chat-toggle .material-symbols-outlined {
    font-size: 32px;
    animation: Whistle-heartbeat 3s ease-in-out infinite;
}

/* Also apply heartbeat to custom image icons */
#Whistle-chat-toggle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: Whistle-heartbeat 1.6s infinite;
}

/* Pause heartbeat on hover so scale feels clean */
#Whistle-chat-toggle:hover .material-symbols-outlined,
#Whistle-chat-toggle:hover img {
    animation-play-state: paused;
}

#Whistle-chat-label {
    position: fixed;
    bottom: 105px;
    right: 15px;
    background: #1C1917;
    color: #ffffff;
    font-weight: 400;
    letter-spacing: 0.01em;
    z-index: 9999999999;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    max-width: 200px;
    font-size: 13px;
    margin-bottom: 15px;
    padding: 10px 15px;
    line-height: 1.5;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.15);
}

/* No caret arrow — clean pill style */
#Whistle-chat-label::after {
    display: none;
}

@keyframes Whistle-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes Whistle-heartbeat {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.08);
    }

    40% {
        transform: scale(0.98);
    }

    60% {
        transform: scale(1.06);
    }

    100% {
        transform: scale(1);
    }
}

body.Whistle-open #Whistle-chat-toggle,
body.Whistle-open #Whistle-chat-label {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Full Width Support */
body.Whistle-full-width #Whistle-chat-widget {
    width: 100% !important;
    height: 100% !important;
    bottom: 0 !important;
    right: 0 !important;
    border-radius: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

#Whistle-chat-widget.maximized {
    width: 100% !important;
    height: 100% !important;
    bottom: 0 !important;
    right: 0 !important;
    border-radius: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* ── Chip Rows (Starters + Suggestions) ─────────────────────────── */
.cwai-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 14px 16px;
    animation: cwai-chips-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Starters sit flush after the welcome bubble */
.cwai-chips-row.cwai-starters {
    padding-top: 4px;
}

/* Suggestions sit flush after the last bot bubble */
.cwai-chips-row.cwai-suggestions {
    padding-top: 2px;
    padding-left: 68px;
    /* align under bot bubble (avatar width + gap) */
}

.cwai-chip {
    background: transparent;
    border: 1.5px solid rgba(217, 119, 6, 0.6);
    color: rgba(217, 119, 6, 0.9);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease,
        border-color 0.2s ease, transform 0.15s ease,
        box-shadow 0.2s ease;
    text-align: left;
    line-height: 1.4;
    white-space: nowrap;
}

.cwai-chip:hover {
    background: var(--Whistle-primary, #d97706);
    border-color: var(--Whistle-primary, #d97706);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
}

.cwai-chip:active {
    transform: translateY(0);
}

/* Starter chips: slightly smaller, more muted */
.cwai-starter-chip {
    font-size: 12px;
    opacity: 0.85;
}

@keyframes cwai-chips-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Clear / New Chat button (in header) ─────────────────────────── */
#Whistle-clear-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--Whistle-text-light, #fff);
    opacity: 0.45;
    transition: opacity 0.2s;
    padding: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-family: inherit;
}

#Whistle-clear-btn:hover {
    opacity: 1;
    background: transparent !important;
    box-shadow: none !important;
}

#Whistle-clear-btn .material-symbols-outlined {
    font-size: 18px;
}