:root {
    --stella-cb-primary: #0d6efd;
    --stella-cb-primary-glow: rgba(13, 110, 253, 0.4);
    --stella-cb-bg: #ffffff;
    --stella-cb-text: #1e293b;
    --stella-cb-text-light: #64748b;
    --stella-cb-msg-bot: #f1f5f9;
    --stella-cb-msg-user: #0d6efd;
    --stella-cb-msg-user-text: #ffffff;
    --stella-cb-border: #e2e8f0;
    --stella-cb-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --stella-cb-radius: 16px;
    --stella-cb-radius-msg: 12px;
}

.stella-cb-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

.stella-cb-toggle {
    order: 1;
    background: transparent;
    border: none;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    width: 60px;
    height: 60px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.stella-cb-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.4);
}

.stella-cb-toggle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.02);
}

/* Panel Styles */
.stella-cb-panel {
    order: 2;
    width: 360px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: var(--stella-cb-bg);
    border-radius: var(--stella-cb-radius);
    box-shadow: var(--stella-cb-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: stella-cb-slide-up 0.3s ease-out;
    border: 1px solid var(--stella-cb-border);
}

.stella-cb-panel:not([hidden]) {
    display: flex;
}

@keyframes stella-cb-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.stella-cb-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%);
    padding: 20px 24px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stella-cb-header-info {
    display: flex;
    flex-direction: column;
}

.stella-cb-header-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.stella-cb-header-status {
    font-size: 12px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stella-cb-header-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #16c79a;
    border-radius: 50%;
}

.stella-cb-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.stella-cb-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

.stella-cb-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: var(--stella-cb-radius-msg);
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.stella-cb-msg.bot {
    align-self: flex-start;
    background: #fff;
    color: var(--stella-cb-text);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--stella-cb-border);
}

.stella-cb-msg.user {
    align-self: flex-end;
    background: var(--stella-cb-msg-user);
    color: var(--stella-cb-msg-user-text);
    border-bottom-right-radius: 4px;
}

/* Suggestion Buttons */
.stella-cb-suggest-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--stella-cb-text-light);
    margin: 8px 0 4px 0;
}

.stella-cb-suggest {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--stella-cb-border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--stella-cb-primary);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 6px;
}

.stella-cb-suggest:hover {
    background: var(--stella-cb-primary);
    color: #fff;
    border-color: var(--stella-cb-primary);
    transform: translateY(-1px);
}

.stella-cb-nav-row {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.stella-cb-nav-btn {
    flex: 1;
    margin: 0;
    justify-content: center;
    text-align: center;
}

/* Input Styles */
.stella-cb-input-wrap {
    padding: 16px;
    background: #fff;
    border-top: 1px solid var(--stella-cb-border);
    display: flex;
    gap: 12px;
}

.stella-cb-input-wrap input {
    flex: 1;
    border: 1px solid var(--stella-cb-border);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.stella-cb-input-wrap input:focus {
    border-color: var(--stella-cb-primary);
}

.stella-cb-send-btn {
    background: var(--stella-cb-primary);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

.stella-cb-send-btn:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.stella-cb-credit {
    font-size: 10px;
    text-align: center;
    color: var(--stella-cb-text-light);
    padding: 8px;
    background: #fff;
}

.stella-cb-credit a {
    color: var(--stella-cb-text-light);
    text-decoration: none;
    font-weight: 600;
}

/* Avatar Shapes */
.stella-cb-avatar-shape-round .stella-cb-toggle,
.stella-cb-avatar-shape-round .stella-cb-toggle img { border-radius: 50%; }

.stella-cb-avatar-shape-square .stella-cb-toggle,
.stella-cb-avatar-shape-square .stella-cb-toggle img { border-radius: 8px; }

.stella-cb-avatar-shape-rounded .stella-cb-toggle,
.stella-cb-avatar-shape-rounded .stella-cb-toggle img { border-radius: 16px; }

/* Scrollbar */
.stella-cb-messages::-webkit-scrollbar { width: 5px; }
.stella-cb-messages::-webkit-scrollbar-track { background: transparent; }
.stella-cb-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.stella-cb-messages::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
