/* Garden City chat assistant (theme: var(--primary-color)) */

#gc-chatbot {
    --gc-chat-offset: 85px;
    position: fixed;
    right: 22px;
    bottom: var(--gc-chat-offset);
    z-index: 99990;
    font-family: var(--body-font, "Inter", sans-serif);
}

#gc-chatbot.gc-chatbot-raised {
    --gc-chat-offset: 160px;
}

/* ---------- toggle button ---------- */

#gc-chatbot-toggle {
    position: relative;
    width: 60px;
    height: 60px;
    border: 0;
    border-radius: 50%;
    background: var(--primary-color, #805231);
    color: #fff;
    box-shadow: 0 10px 30px rgba(var(--primary-color-rgb, 128, 82, 49), .45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .25s ease, box-shadow .25s ease;
}

#gc-chatbot-toggle:hover {
    transform: scale(1.06);
}

#gc-chatbot-toggle .gc-chatbot-icon-open,
#gc-chatbot-toggle .gc-chatbot-icon-close {
    font-size: 22px;
    position: absolute;
    transition: opacity .2s ease, transform .2s ease;
}

#gc-chatbot-toggle .gc-chatbot-icon-close {
    opacity: 0;
    transform: scale(.5) rotate(-90deg);
}

#gc-chatbot.open #gc-chatbot-toggle .gc-chatbot-icon-open {
    opacity: 0;
    transform: scale(.5) rotate(90deg);
}

#gc-chatbot.open #gc-chatbot-toggle .gc-chatbot-icon-close {
    opacity: 1;
    transform: scale(1) rotate(0);
}

.gc-chatbot-ping {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ff5a5f;
    border: 2px solid #fff;
    animation: gc-chatbot-pulse 1.8s ease-in-out infinite;
}

#gc-chatbot.open .gc-chatbot-ping,
#gc-chatbot.gc-chatbot-seen .gc-chatbot-ping {
    display: none;
}

@keyframes gc-chatbot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: .7; }
}

/* ---------- chat window ---------- */

#gc-chatbot-window {
    position: absolute;
    right: 0;
    bottom: 76px;
    width: 370px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 160px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(.98);
    transform-origin: bottom right;
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}

#gc-chatbot.open #gc-chatbot-window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.gc-chatbot-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px;
    background: var(--primary-color, #805231);
    background-image: linear-gradient(135deg, var(--primary-color, #805231), #5f3c22);
    color: #fff;
}

.gc-chatbot-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    padding: 4px;
    object-fit: contain;
    flex: 0 0 auto;
}

.gc-chatbot-header-text {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.gc-chatbot-header-text strong {
    display: block;
    font-family: var(--heading-font, serif);
    font-size: 17px;
    font-weight: 600;
}

.gc-chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: .85;
}

.gc-chatbot-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
}

.gc-chatbot-header button {
    background: rgba(255, 255, 255, .12);
    border: 0;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    flex: 0 0 auto;
    transition: background .2s ease;
}

.gc-chatbot-header button:hover {
    background: rgba(255, 255, 255, .25);
}

/* ---------- body / messages ---------- */

.gc-chatbot-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 14px;
    background: #f7f3ef;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gc-msg {
    display: flex;
    flex-direction: column;
    max-width: 88%;
    animation: gc-msg-in .25s ease;
}

@keyframes gc-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.gc-msg-bot {
    align-self: flex-start;
}

.gc-msg-user {
    align-self: flex-end;
}

.gc-bubble {
    padding: 11px 15px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.55;
}

.gc-msg-bot .gc-bubble {
    background: #fff;
    color: #2b2b2b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.gc-msg-bot .gc-bubble a {
    color: var(--primary-color, #805231);
    font-weight: 600;
    text-decoration: underline;
}

.gc-msg-user .gc-bubble {
    background: var(--primary-color, #805231);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.gc-typing-bubble {
    display: flex;
    gap: 4px;
    padding: 14px 16px;
}

.gc-typing-bubble span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #b9aa9f;
    animation: gc-typing 1s infinite ease-in-out;
}

.gc-typing-bubble span:nth-child(2) { animation-delay: .15s; }
.gc-typing-bubble span:nth-child(3) { animation-delay: .3s; }

@keyframes gc-typing {
    0%, 60%, 100% { transform: translateY(0); opacity: .5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.gc-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

.gc-option-btn {
    text-align: left;
    background: #fff;
    border: 1px solid rgba(var(--primary-color-rgb, 128, 82, 49), .35);
    color: var(--primary-color, #805231);
    font-size: 13.5px;
    font-weight: 500;
    padding: 9px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .15s ease;
}

.gc-option-btn:hover {
    background: var(--primary-color, #805231);
    color: #fff;
    transform: translateX(2px);
}

.gc-option-btn:disabled {
    opacity: .55;
    cursor: default;
    transform: none;
}

/* ---------- message input ---------- */

.gc-chatbot-input-row {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(0, 0, 0, .06);
    background: #fff;
}

#gc-chatbot-input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 20px;
    padding: 9px 16px;
    font-size: 13.5px;
    font-family: inherit;
    color: #2b2b2b;
    outline: none;
    transition: border-color .2s ease;
}

#gc-chatbot-input:focus {
    border-color: var(--primary-color, #805231);
}

.gc-chatbot-input-row button {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: var(--primary-color, #805231);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .2s ease;
}

.gc-chatbot-input-row button:hover {
    opacity: .88;
}

/* ---------- footer quick actions ---------- */

.gc-chatbot-footer {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(0, 0, 0, .06);
    background: #fff;
}

.gc-chatbot-quick {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f7f3ef;
    border: 0;
    color: var(--primary-color, #805231);
    font-size: 12.5px;
    font-weight: 600;
    padding: 9px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .2s ease;
}

.gc-chatbot-quick:hover {
    background: rgba(var(--primary-color-rgb, 128, 82, 49), .15);
}

@media only screen and (max-width: 992px) {
    #gc-chatbot {
        right: 14px;
        --gc-chat-offset: 14px;
    }
}

@media (max-width: 480px) {
    #gc-chatbot {
        right: 14px;
    }
    #gc-chatbot-toggle {
        width: 54px;
        height: 54px;
    }
    #gc-chatbot-window {
        right: -10px;
        width: calc(100vw - 20px);
        height: calc(100vh - 140px);
        bottom: 68px;
    }
}
