/* Dr. Potato AI Chat Widget */

:root {
    --drp-beige: #F5EBDD;
    --drp-cream: #FAF6EE;
    --drp-blue: #3F61AA;
    --drp-blue-dark: #0E3763;
    --drp-text: #2C1B15;
    --drp-text-muted: rgba(2, 1, 34, 0.5);
    --drp-border-soft: rgba(44, 27, 21, 0.25);
    --drp-bubble-border: #DCE1E9;
    --drp-icon-gray: #6E7D93;
}

/* ============================================
   Inline Blurb Entry Point (closed state)
   ============================================ */

.drp-blurb {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 900;
    background: var(--drp-beige);
    border-radius: 30px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    padding: 62px 22px 27px;
    width: 250px;
}

.drp-blurb.is-hidden {
    display: none;
}

.drp-blurb-badge {
    position: absolute;
    top: -46px;
    left: -26px;
    width: 110px;
    height: auto;
    display: block;
}

.drp-blurb-text {
    font-family: minion-pro, serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 22px;
    color: var(--drp-text);
    margin: 0 0 14px 0;
}

.drp-blurb-form {
    display: flex;
    align-items: center;
    background: var(--drp-cream);
    border-radius: 50px;
    padding: 5px 5px 5px 15px;
    height: 34px;
    outline: none;
}

.drp-blurb-input,
.drp-blurb-input:focus {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    font-family: elza-text, sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 14px;
    color: var(--drp-text);
    min-width: 0;
    padding: 0;
}

.drp-blurb-input::placeholder {
    color: var(--drp-text-muted);
}

.drp-blurb-send {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: var(--drp-blue);
    color: var(--drp-cream);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    padding: 0;
}

.drp-blurb-send:hover {
    opacity: 0.85;
}

.drp-blurb-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.drp-blurb-send svg,
.drp-chat-send svg {
    display: block;
    stroke: var(--drp-cream);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.drp-blurb-send svg {
    width: 8px;
    height: 14px;
}

.drp-blurb-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: none;
    border: none;
    color: var(--drp-icon-gray);
    font-size: 28px;
    line-height: 1;
    padding: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.drp-blurb-close:hover {
    opacity: 0.7;
}

/* ============================================
   Open Chat Panel
   ============================================ */

.drp-chat-panel {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 901;
    width: 352px;
    max-height: 717px;
    background: var(--drp-beige);
    border-radius: 18px;
    box-shadow: 0 6px 42px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    overflow: visible;
}

.drp-chat-panel.is-open {
    display: flex;
}

/* Header */
.drp-chat-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--drp-beige);
    border-bottom: 1px solid var(--drp-border-soft);
    border-radius: 18px 18px 0 0;
    min-height: 58px;
}

.drp-chat-header-badge {
    position: absolute;
    top: -46px;
    left: -26px;
    width: 110px;
    height: auto;
    display: block;
}

.drp-chat-reset,
.drp-chat-close {
    background: none;
    border: none;
    color: var(--drp-icon-gray);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.drp-chat-reset {
    margin-left: auto;
    font-size: 13px;
}

.drp-chat-close {
    font-size: 18px;
}

.drp-chat-reset:hover,
.drp-chat-close:hover {
    opacity: 0.7;
}

/* Messages area */
.drp-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 260px;
    max-height: 537px;
    background: var(--drp-beige);
}

.drp-chat-msg {
    max-width: 85%;
    padding: 9px 13px;
    border-radius: 10px;
    font-family: elza-text, sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 22px;
    letter-spacing: -0.02em;
    word-wrap: break-word;
}

.drp-chat-msg.bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--drp-bubble-border);
    color: #000;
}

.drp-chat-msg.user {
    align-self: flex-end;
    background: var(--drp-blue-dark);
    color: #fff;
    font-weight: 500;
}

.drp-chat-msg a {
    color: var(--drp-blue-dark);
    text-decoration: underline;
}

.drp-chat-msg.user a {
    color: #fff;
}

.drp-chat-msg .drp-sources {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--drp-border-soft);
    font-size: 12px;
}

.drp-chat-msg .drp-sources strong {
    display: block;
    margin-bottom: 4px;
}

.drp-chat-msg .drp-sources a {
    display: block;
    font-size: 12px;
    margin-bottom: 2px;
}

/* Typing indicator */
.drp-typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: var(--drp-blue-dark);
    margin-left: 1px;
    animation: drp-blink 0.7s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes drp-blink {
    50% { opacity: 0; }
}

/* Input area — pill style */
.drp-chat-input-area {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 70px;
    padding: 7px 7px 7px 17px;
    margin: 0 16px 16px;
    height: 48px;
    gap: 0;
    outline: none;
}

.drp-chat-input,
.drp-chat-input:focus {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    font-family: elza-text, sans-serif;
    font-weight: 400;
    font-size: 13.6px;
    line-height: 16px;
    color: var(--drp-text);
    min-width: 0;
    padding: 4px 0;
}

.drp-chat-input::placeholder {
    color: var(--drp-text-muted);
}

.drp-chat-send {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    background: var(--drp-blue-dark);
    color: var(--drp-cream);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    padding: 0;
}

.drp-chat-send svg {
    width: 10px;
    height: 16px;
}

.drp-chat-send:hover {
    opacity: 0.85;
}

.drp-chat-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Error state */
.drp-chat-error {
    color: var(--color-palette-6);
    font-size: 13px;
    text-align: center;
    padding: 8px;
}

/* ============================================
   Mobile responsive
   ============================================ */

@media (max-width: 640px) {
    .drp-blurb-input,
    .drp-chat-input {
        font-size: 16px;
    }

    .drp-blurb {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 16px;
        padding: 62px 22px 22px;
    }

    .drp-chat-panel {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 8px;
        max-height: calc(100vh - 16px);
    }

    .drp-chat-messages {
        max-height: calc(100vh - 200px);
    }

    .drp-chat-close,
    .drp-chat-reset {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
        color: var(--drp-text);
    }

    .drp-chat-close {
        font-size: 28px;
    }

    .drp-chat-reset {
        font-size: 16px;
    }

    .drp-blurb-close {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
        color: var(--drp-text);
        top: 4px;
        right: 4px;
    }
}
