/*
 * Christbot Stylesheet
 */

#christbot-widget-container {
    --blood: #b91c1c;
    --blood-dark: #7f1d1d;
    --font-serif: 'Cinzel', serif;
    --font-sans: 'Inter', sans-serif;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2147483647; /* Ensure it is above EVERYTHING */
}

/* Floating Action Button */
#christbot-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--blood);
    border: 2px solid #000;
    box-shadow: 0 0 20px rgba(185,28,28,0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s;
}

#christbot-toggle:hover {
    transform: scale(1.1) rotate(5deg);
    background-color: var(--blood-dark);
}

#christbot-toggle svg {
    width: 32px;
    height: 32px;
    fill: #fff;
    stroke: none;
}

/* Chat Window */
#christbot-window {
    display: none;
    position: absolute;
    bottom: 84px;
    right: 0;
    width: 360px;
    height: 520px;
    background-color: #050505;
    /* Comedic Satanic Background Pattern */
    background-image: 
        linear-gradient(rgba(5, 5, 5, 0.85), rgba(5, 5, 5, 0.95)),
        url('https://images.unsplash.com/photo-1517487881594-2787fef5ebf7?q=80&w=1964&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    border: 1px solid var(--blood-dark);
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.9);
    flex-direction: column;
    overflow: hidden;
    font-family: var(--font-sans);
    transform-origin: bottom right;
}

#christbot-window.active {
    display: flex;
    animation: christbotSlideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes christbotSlideUp {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header */
#christbot-header {
    background-color: rgba(10, 0, 0, 0.85);
    padding: 16px 20px;
    border-bottom: 1px solid rgba(185,28,28,0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(5px);
}

#christbot-header h3 {
    margin: 0;
    color: #fff;
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
}

#christbot-header h3 svg {
    color: var(--blood);
    stroke-width: 2.5;
}

#christbot-close {
    background: none;
    border: none;
    color: #999;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s, transform 0.2s;
}

#christbot-close:hover {
    color: var(--blood);
    transform: rotate(90deg);
}

/* Messages Area */
#christbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Scrollbar Customization for messages */
#christbot-messages::-webkit-scrollbar {
    width: 6px;
}
#christbot-messages::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
}
#christbot-messages::-webkit-scrollbar-thumb {
    background: var(--blood-dark);
    border-radius: 10px;
}
#christbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--blood);
}

/* Message Bubbles */
.christbot-msg-wrapper {
    display: flex;
    width: 100%;
}

.christbot-msg-wrapper.bot { justify-content: flex-start; }
.christbot-msg-wrapper.user { justify-content: flex-end; }

.christbot-msg {
    max-width: 85%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #eee;
    border-radius: 16px;
    word-wrap: break-word;
}

.christbot-msg-wrapper.bot .christbot-msg {
    background-color: rgba(69, 10, 10, 0.6);
    border: 1px solid rgba(185, 28, 28, 0.3);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.christbot-msg-wrapper.user .christbot-msg {
    background-color: rgba(40, 40, 40, 0.9);
    border: 1px solid rgba(80, 80, 80, 0.5);
    border-bottom-right-radius: 4px;
}

/* Input Area */
#christbot-input-area {
    padding: 16px;
    background-color: rgba(10, 0, 0, 0.9);
    border-top: 1px solid rgba(185,28,28,0.3);
    display: flex;
    gap: 10px;
}

#christbot-input {
    flex: 1;
    background-color: rgba(24, 24, 27, 0.8);
    border: 1px solid #3f3f46;
    color: #fff;
    border-radius: 24px;
    padding: 10px 16px;
    outline: none;
    font-family: var(--font-sans);
    font-size: 14px;
    transition: border-color 0.3s;
}

#christbot-input::placeholder {
    color: #71717a;
}

#christbot-input:focus {
    border-color: var(--blood);
}

#christbot-send {
    background-color: var(--blood);
    color: #fff;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

#christbot-send:hover {
    background-color: var(--blood-dark);
    transform: scale(1.05);
}

#christbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#christbot-send svg {
    stroke-width: 2.5;
}

/* Typing Indicator */
.christbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 14px;
    align-items: center;
}
.christbot-typing span {
    width: 6px;
    height: 6px;
    background-color: var(--blood);
    border-radius: 50%;
    animation: christbotBounce 1.4s infinite ease-in-out both;
}
.christbot-typing span:nth-child(1) { animation-delay: -0.32s; }
.christbot-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes christbotBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Responsive */
@media (max-width: 480px) {
    #christbot-widget-container {
        bottom: 16px;
        right: 16px;
    }
    
    #christbot-window {
        bottom: 76px;
        width: calc(100vw - 32px);
        height: 65vh;
        max-height: 500px;
    }
}
