/* ==============================
   POSTBOT CHATBOT WIDGET STYLES
   ============================== */

/* Floating button */
#postbot-fab {
    position: fixed;
    bottom: 90px;
    right: 28px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8B1A1A, #d4a017);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(139, 26, 26, 0.5);
    z-index: 9990;
    border: 3px solid #ff0000;
    color: white;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: bot-pulse 2.5s infinite;
}

#postbot-fab:hover {
    transform: scale(1.12);
    box-shadow: 0 10px 32px rgba(139, 26, 26, 0.7);
}

@keyframes bot-pulse {

    0%,
    100% {
        box-shadow: 0 6px 24px rgba(139, 26, 26, 0.5);
    }

    50% {
        box-shadow: 0 6px 32px rgba(212, 160, 23, 0.7);
    }
}

#postbot-fab .bot-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background: #ff0000;
    border-radius: 50%;
    border: 2px solid white;
    animation: blink-badge 2s infinite;
}

@keyframes blink-badge {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Chat Window */
#postbot-window {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 380px;
    height: 540px;
    background: #1a0f0f;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212, 160, 23, 0.25);
    z-index: 9991;
    overflow: hidden;
    transform: scale(0.8) translateY(30px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#postbot-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Header */
#postbot-header {
    background: linear-gradient(135deg, #6B0F0F 0%, #8B1A1A 50%, #a02010 100%);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(212, 160, 23, 0.3);
    flex-shrink: 0;
}

.bot-avatar {
    width: 42px;
    height: 42px;
    background: rgba(212, 160, 23, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 2px solid rgba(212, 160, 23, 0.5);
    flex-shrink: 0;
}

.bot-info {
    flex: 1;
}

.bot-name {
    color: #d4a017;
    font-weight: 700;
    font-size: 15px;
}

.bot-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 5px;
}

.bot-status-dot {
    width: 7px;
    height: 7px;
    background: #ff0000;
    border-radius: 50%;
    display: inline-block;
    animation: blink-badge 2s infinite;
}

#postbot-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

#postbot-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Category bar */
#postbot-cats {
    display: flex;
    gap: 7px;
    padding: 10px 14px;
    overflow-x: auto;
    scrollbar-width: none;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#postbot-cats::-webkit-scrollbar {
    display: none;
}

.bot-cat-chip {
    white-space: nowrap;
    padding: 5px 12px;
    background: rgba(212, 160, 23, 0.1);
    border: 1px solid rgba(212, 160, 23, 0.25);
    border-radius: 30px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.bot-cat-chip:hover {
    background: rgba(212, 160, 23, 0.25);
    color: #d4a017;
    border-color: rgba(212, 160, 23, 0.5);
}

/* Messages area */
#postbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

#postbot-messages::-webkit-scrollbar {
    width: 4px;
}

#postbot-messages::-webkit-scrollbar-thumb {
    background: rgba(212, 160, 23, 0.3);
    border-radius: 4px;
}

/* Message bubbles */
.bot-msg,
.user-msg {
    display: flex;
    gap: 8px;
    animation: msg-in 0.3s ease;
}

@keyframes msg-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-msg {
    align-self: flex-start;
    max-width: 92%;
}

.user-msg {
    align-self: flex-end;
    flex-direction: row-reverse;
    max-width: 82%;
}

.bot-msg-avatar {
    width: 28px;
    height: 28px;
    background: rgba(212, 160, 23, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.bot-bubble,
.user-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
}

.bot-bubble {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 2px 14px 14px 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.user-bubble {
    background: linear-gradient(135deg, #8B1A1A, #6B0F0F);
    color: white;
    border-radius: 14px 2px 14px 14px;
}

/* Links inside bot bubble */
.bot-bubble a {
    color: #d4a017;
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 160, 23, 0.4);
}

.bot-bubble strong {
    color: #d4a017;
}

/* Answer card */
.bot-answer-card {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(212, 160, 23, 0.25);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 4px;
}

.bot-answer-header {
    background: rgba(212, 160, 23, 0.12);
    padding: 8px 12px;
    font-size: 11px;
    color: #d4a017;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bot-answer-body {
    padding: 12px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.6;
}

.bot-answer-body strong {
    color: #d4a017;
}

.bot-answer-links {
    padding: 8px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bot-link-btn {
    padding: 5px 12px;
    background: rgba(212, 160, 23, 0.15);
    border: 1px solid rgba(212, 160, 23, 0.35);
    border-radius: 20px;
    color: #d4a017;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.bot-link-btn:hover {
    background: rgba(212, 160, 23, 0.3);
}

.bot-contact-tag {
    padding: 6px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.bot-contact-tag span {
    color: #d4a017;
    font-weight: 700;
}

/* Suggestions */
.bot-suggestions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 6px;
}

.bot-suggestion-chip {
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.bot-suggestion-chip:hover {
    background: rgba(212, 160, 23, 0.15);
    border-color: rgba(212, 160, 23, 0.4);
    color: #d4a017;
}

/* Typing indicator */
.bot-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 2px 14px 14px 14px;
    width: fit-content;
}

.bot-typing span {
    width: 7px;
    height: 7px;
    background: rgba(212, 160, 23, 0.7);
    border-radius: 50%;
    animation: bounce-dot 1.4s infinite ease-in-out;
}

.bot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.bot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce-dot {

    0%,
    80%,
    100% {
        transform: scale(0.7);
        opacity: 0.5;
    }

    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Input area */
#postbot-input-area {
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
}

#postbot-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: white;
    font-size: 13.5px;
    padding: 10px 14px;
    resize: none;
    min-height: 38px;
    max-height: 100px;
    font-family: inherit;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.2s;
}

#postbot-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

#postbot-input:focus {
    border-color: rgba(212, 160, 23, 0.5);
}

#postbot-send {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #8B1A1A, #d4a017);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

#postbot-send:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(212, 160, 23, 0.4);
}

#postbot-send:active {
    transform: scale(0.95);
}

/* Responsive */
@media (max-width: 480px) {
    #postbot-window {
        width: 98vw;
        right: 1vw;
        bottom: 80px;
        height: 75vh;
    }

    #postbot-fab {
        bottom: 20px;
        right: 20px;
    }
}