/* Modern AI Chatbot CSS */
:root {
    --cb-primary: #ffbe33;
    --cb-secondary: #2c2d3f;
    --cb-text-dark: #333;
    --cb-text-light: #fff;
    --cb-bg-glass: rgba(255, 255, 255, 0.9);
    --cb-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

#chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Open Sans', sans-serif;
}

/* Welcome Message Bubble */
.cb-welcome-msg {
    position: absolute;
    bottom: 85px;
    right: 5px;
    background: #fff;
    padding: 12px 20px 12px 15px;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    color: var(--cb-secondary);
    display: none;
    z-index: 10001;
    border-left: 4px solid var(--cb-primary);
    animation: cb-bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cb-welcome-msg::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 25px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
}

.cb-msg-close {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

@keyframes cb-bounce-in {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Floating Button */
.cb-float-btn {
    width: 70px;
    height: 70px;
    background: #111;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 190, 51, 0.45), 0 8px 32px rgba(0,0,0,0.35);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: 2.5px solid var(--cb-primary);
    overflow: hidden;
}

.cb-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(255, 190, 51, 0.65), 0 10px 36px rgba(0,0,0,0.4);
}

.cb-float-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.cb-float-btn .cb-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff4757;
    color: white;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 10px;
    border: 2px solid white;
    display: none;
}

/* Pulse Animation */
.cb-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--cb-primary);
    opacity: 0.5;
    animation: cb-pulse-anim 2s infinite;
    z-index: -1;
}

@keyframes cb-pulse-anim {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Chat Window */
.cb-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: var(--cb-bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    box-shadow: var(--cb-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: cb-scale-in 0.3s ease-out;
}

@keyframes cb-scale-in {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Header */
.cb-header {
    padding: 20px;
    background: linear-gradient(to right, var(--cb-secondary), #41436a);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cb-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cb-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--cb-primary);
    background: white;
    overflow: hidden;
}

.cb-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cb-status-wrap {
    display: flex;
    flex-direction: column;
}

.cb-assistant-name {
    font-weight: 700;
    font-size: 16px;
}

.cb-status {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.9;
}

.cb-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
}

.cb-header-controls {
    display: flex;
    gap: 15px;
    font-size: 18px;
}

.cb-header-controls i {
    cursor: pointer;
    transition: opacity 0.2s;
}

.cb-header-controls i:hover {
    opacity: 0.7;
}

/* Body */
.cb-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(244, 247, 246, 0.5);
}

/* Scrollbar */
.cb-body::-webkit-scrollbar { width: 5px; }
.cb-body::-webkit-scrollbar-track { background: transparent; }
.cb-body::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }

/* Messages */
.cb-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    animation: cb-fade-up 0.3s ease-out;
}

@keyframes cb-fade-up {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.cb-msg-bot {
    align-self: flex-start;
    background: white;
    color: var(--cb-text-dark);
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.cb-msg-user {
    align-self: flex-end;
    background: var(--cb-secondary);
    color: white;
    border-bottom-right-radius: 2px;
}

.cb-time {
    font-size: 10px;
    margin-top: 5px;
    display: block;
    opacity: 0.6;
}

/* Typing Indicator */
.cb-typing {
    display: none;
    align-self: flex-start;
    padding: 10px 15px;
}

.cb-typing span {
    width: 6px;
    height: 6px;
    background: #aaa;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: cb-typing-anim 1.4s infinite both;
}

.cb-typing span:nth-child(2) { animation-delay: 0.2s; }
.cb-typing span:nth-child(3) { animation-delay: 0.4s; }

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

/* Quick Actions & Suggestions */
.cb-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.cb-opt-btn {
    background: white;
    border: 1px solid var(--cb-primary);
    color: var(--cb-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cb-opt-btn:hover {
    background: var(--cb-primary);
    color: var(--cb-secondary);
}

/* Rich Content */
.cb-answer-img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 10px;
}

.cb-action-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--cb-primary);
    color: var(--cb-secondary) !important;
    padding: 10px;
    border-radius: 10px;
    margin-top: 10px;
    font-weight: 700;
    text-decoration: none !important;
}

/* Footer Input */
.cb-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

#cb-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 5px;
}

.cb-send-btn {
    color: var(--cb-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.cb-send-btn:hover {
    color: var(--cb-primary);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #chatbot-widget {
        bottom: 20px;
        right: 20px;
    }
    .cb-window {
        width: calc(100vw - 40px);
        height: 70vh;
        bottom: 75px;
    }
}
