/* SciVoices Cosmo – floating chatbot styles */

.scv-cosmo-root {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
}

/* Bubble button */
.scv-cosmo-bubble {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid #F0642B; /* orange */
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.scv-cosmo-bubble img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
}

/* Panel */
.scv-cosmo-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    max-height: 480px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    display: none;
    overflow: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.scv-cosmo-panel.scv-cosmo-open {
    display: flex;
    flex-direction: column;
}

/* Header */
.scv-cosmo-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    background: #f6f6f6;
}
.scv-cosmo-header img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
}
.scv-cosmo-title {
    flex: 1;
    line-height: 1.1;
}
.scv-cosmo-title strong {
    display: block;
    font-size: 14px;
}
.scv-cosmo-title span {
    font-size: 11px;
    color: #777;
}
.scv-cosmo-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
}

/* Messages */
.scv-cosmo-messages {
    flex: 1;
    padding: 8px 10px;
    overflow-y: auto;
    background: #ffffff;
}
.scv-cosmo-message {
    margin-bottom: 8px;
    max-width: 90%;
}
.scv-cosmo-name {
    font-size: 11px;
    margin-bottom: 2px;
}
.scv-cosmo-bubble-text {
    border-radius: 14px;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.35;
}

/* User vs bot */
.scv-cosmo-msg-user {
    margin-left: auto;
    text-align: right;
}
.scv-cosmo-msg-user .scv-cosmo-name {
    text-align: right;
}
.scv-cosmo-msg-user .scv-cosmo-bubble-text {
    background: #F0642B;
    color: #fff;
}
.scv-cosmo-msg-bot {
    margin-right: auto;
}
.scv-cosmo-msg-bot .scv-cosmo-bubble-text {
    background: #F2F2F2;
}

/* Typing dots */
.scv-cosmo-typing .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #999;
    margin: 0 2px;
    animation: scv-cosmo-bounce 1s infinite ease-in-out;
}
.scv-cosmo-typing .dot:nth-child(2) { animation-delay: 0.15s; }
.scv-cosmo-typing .dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes scv-cosmo-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-3px); opacity: 1; }
}

/* Input row */
.scv-cosmo-input-row {
    border-top: 1px solid #eee;
    padding: 8px;
    background: #fafafa;
    display: flex;
    gap: 6px;
}
.scv-cosmo-input {
    flex: 1;
    resize: none;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 13px;
    padding: 6px 8px;
}
.scv-cosmo-send {
    background: #F0642B;
    border: none;
    color: #fff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
}
.scv-cosmo-send:hover {
    background: #d75224;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .scv-cosmo-root {
        bottom: 10px;
        right: 10px;
    }
    .scv-cosmo-panel {
        width: 90vw;
        max-height: 70vh;
        right: -5px;
    }
}
