/*!
 * Optimus Sitemap AI Pro - Studio Iceberg 2026
 * Chatbot widget styles
 */

#osap-chat-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--osap-cb-button, #2b6cb0);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

#osap-chat-button:hover {
    transform: scale(1.06);
}

#osap-chat-button svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

#osap-chat-panel {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 130px);
    background: var(--osap-cb-bg, #ffffff);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
    z-index: 99999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#osap-chat-panel.osap-open {
    display: flex;
}

#osap-chat-header {
    background: var(--osap-cb-button, #2b6cb0);
    color: var(--osap-cb-text, #ffffff);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

#osap-chat-header .osap-chat-title {
    font-weight: 600;
    font-size: 15px;
}

#osap-chat-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
}

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

#osap-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--osap-cb-bg, #ffffff);
}

.osap-msg {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.osap-msg-user {
    align-self: flex-end;
    background: var(--osap-cb-user, #2b6cb0);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.osap-msg-bot {
    align-self: flex-start;
    background: var(--osap-cb-system, #f0f2f5);
    color: #1a202c;
    border-bottom-left-radius: 4px;
}

.osap-msg-sources {
    align-self: flex-start;
    font-size: 12px;
    margin-top: -4px;
}

.osap-msg-sources a {
    color: var(--osap-cb-button, #2b6cb0);
    text-decoration: none;
    display: inline-block;
    margin: 2px 6px 2px 0;
    border: 1px solid currentColor;
    border-radius: 10px;
    padding: 2px 8px;
}

.osap-msg-sources a:hover {
    text-decoration: underline;
}

.osap-typing {
    align-self: flex-start;
    color: #718096;
    font-size: 13px;
    font-style: italic;
}

#osap-chat-input-bar {
    display: flex;
    border-top: 1px solid #e2e8f0;
    padding: 10px;
    gap: 8px;
    flex-shrink: 0;
    background: var(--osap-cb-bg, #ffffff);
}

#osap-chat-input {
    flex: 1;
    border: 1px solid #cbd5e0;
    border-radius: 20px;
    padding: 9px 14px;
    font-size: 14px;
    outline: none;
    resize: none;
    max-height: 80px;
}

#osap-chat-input:focus {
    border-color: var(--osap-cb-button, #2b6cb0);
}

#osap-chat-send {
    background: var(--osap-cb-button, #2b6cb0);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#osap-chat-send:disabled {
    opacity: 0.5;
    cursor: default;
}

#osap-chat-send svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}
