#chat-horus-container {
    position: fixed;
    bottom: 24px;
    z-index: 99999;
    font-family: var(--chat-horus-font, sans-serif);
    font-size: var(--chat-horus-size, 14px);
    box-sizing: border-box;
}

#chat-horus-container.chat-horus-right {
    right: 24px;
}

#chat-horus-container.chat-horus-left {
    left: 24px;
}

#chat-horus-container * {
    box-sizing: border-box;
}

#chat-horus-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    position: absolute;
    bottom: 0;
}

.chat-horus-right #chat-horus-toggle-wrapper {
    right: 0;
    flex-direction: row;
}

.chat-horus-left #chat-horus-toggle-wrapper {
    left: 0;
    flex-direction: row-reverse;
}

#chat-horus-tooltip {
    background: #ffffff;
    color: #334155;
    padding: 10px 18px;
    border-radius: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-weight: 500;
    font-size: 0.95em;
    animation: tooltip-bounce 2s infinite ease-in-out;
    position: relative;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid #f1f5f9;
}

#chat-horus-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-style: solid;
    filter: drop-shadow(2px 0 2px rgba(0,0,0,0.05));
}

.chat-horus-right #chat-horus-tooltip::after {
    right: -6px;
    border-width: 6px 0 6px 6px;
    border-color: transparent transparent transparent #ffffff;
}

.chat-horus-left #chat-horus-tooltip::after {
    left: -6px;
    border-width: 6px 6px 6px 0;
    border-color: transparent #ffffff transparent transparent;
}

@keyframes tooltip-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.chat-horus-tooltip-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#chat-horus-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--chat-horus-primary);
    color: var(--chat-horus-secondary);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px 0 rgba(var(--chat-horus-rgb), 0.39);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

#chat-horus-toggle:hover {
    transform: scale(1.05);
}

#chat-horus-toggle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-horus-pulse {
    animation: chat-pulse 2s infinite;
}

@keyframes chat-pulse {
    0% { box-shadow: 0 0 0 0 rgba(var(--chat-horus-rgb), 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(var(--chat-horus-rgb), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--chat-horus-rgb), 0); }
}

#chat-horus-window {
    position: absolute;
    bottom: 80px;
    width: 360px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chat-fade-in 0.3s ease;
}

.chat-horus-right #chat-horus-window {
    right: 0;
    transform-origin: bottom right;
}

.chat-horus-left #chat-horus-window {
    left: 0;
    transform-origin: bottom left;
}

@keyframes chat-fade-in {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

#chat-horus-header {
    background: var(--chat-horus-primary);
    color: var(--chat-horus-secondary);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#chat-horus-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-horus-avatar, .chat-horus-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    object-fit: cover;
}

.chat-horus-titles {
    display: flex;
    flex-direction: column;
}

.chat-horus-title {
    font-weight: 600;
    font-size: 1.1em;
    line-height: 1.2;
}

.chat-horus-desc {
    font-size: 0.85em;
    opacity: 0.8;
    margin-top: 2px;
}

#chat-horus-close {
    background: none;
    border: none;
    color: var(--chat-horus-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#chat-horus-close:hover {
    opacity: 1;
}

#chat-horus-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

.chat-horus-msg {
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 85%;
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.4;
    animation: msg-appear 0.3s ease;
}

@keyframes msg-appear {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-horus-msg-user {
    background: var(--chat-horus-primary);
    color: var(--chat-horus-secondary);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-horus-msg-bot {
    background: #ffffff;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

#chat-horus-input-area {
    display: flex;
    padding: 16px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    align-items: center;
    gap: 10px;
}

#chat-horus-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    outline: none;
    font-family: inherit;
    font-size: inherit;
    transition: border-color 0.2s;
}

#chat-horus-input:focus {
    border-color: var(--chat-horus-primary);
}

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

#chat-horus-send:hover {
    transform: scale(1.05);
}

/* Typing Indicator */
.chat-horus-typing {
    display: flex;
    gap: 4px;
    padding: 16px !important;
    align-items: center;
    justify-content: center;
}

.chat-horus-typing span {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.chat-horus-typing span:nth-child(1) { animation-delay: -0.32s; }
.chat-horus-typing span:nth-child(2) { animation-delay: -0.16s; }

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

@media (max-width: 480px) {
    #chat-horus-window {
        width: calc(100vw - 32px);
        height: 500px;
        max-height: 70vh;
        bottom: 80px;
    }

    #chat-horus-container {
        bottom: 16px;
    }

    .chat-horus-right #chat-horus-container {
        right: 16px;
    }

    .chat-horus-left #chat-horus-container {
        left: 16px;
    }
}


