/* HYBS AI Helpdesk Chat Widget Styles */

/* Floating Launcher Button */
.hybs-chat-launcher {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00b4db, #0083b0);
    box-shadow: 0 4px 20px rgba(0, 180, 219, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    cursor: pointer;
    z-index: 9999;
    border: none;
    outline: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hybs-chat-launcher:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(0, 180, 219, 0.6);
}

.hybs-chat-launcher:active {
    transform: scale(0.95);
}

.hybs-chat-launcher i {
    font-size: 26px;
    transition: transform 0.3s ease;
}

.hybs-chat-launcher.active i {
    transform: rotate(90deg);
}

/* Launcher Pulse Effect */
.hybs-chat-launcher::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    opacity: 0.4;
    z-index: -1;
    animation: hybs-pulse 2s infinite;
}

@keyframes hybs-pulse {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Chat Widget Container */
.hybs-chat-container {
    position: fixed;
    right: 25px;
    bottom: 95px;
    width: 380px;
    height: 520px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    font-family: 'Exo 2', 'Source Sans Pro', sans-serif;
    transform: translateY(30px) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.19, 1, 0.22, 1);
}

.hybs-chat-container.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Chat Header */
.hybs-chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #0097A7, #00bcd4);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0, 151, 167, 0.15);
}

.hybs-chat-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hybs-chat-header-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
}

.hybs-chat-title-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
}

.hybs-chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 2px;
}

.hybs-chat-status-dot {
    width: 8px;
    height: 8px;
    background-color: #2ec4b6;
    border-radius: 50%;
    animation: hybs-dot-pulse 1.8s infinite;
}

@keyframes hybs-dot-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 196, 182, 0.7);
    }
    70% {
        box-shadow: 0 0 0 5px rgba(46, 196, 182, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(46, 196, 182, 0);
    }
}

.hybs-chat-close-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

.hybs-chat-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Chat Body / Messages Area */
.hybs-chat-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(244, 246, 248, 0.4);
}

/* Message Scrollbar */
.hybs-chat-body::-webkit-scrollbar {
    width: 6px;
}

.hybs-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.hybs-chat-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.hybs-chat-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Chat Bubbles */
.hybs-chat-message-row {
    display: flex;
    width: 100%;
}

.hybs-chat-message-row.user-msg {
    justify-content: flex-end;
}

.hybs-chat-message-row.ai-msg {
    justify-content: flex-start;
}

.hybs-chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.45;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.user-msg .hybs-chat-bubble {
    background: linear-gradient(135deg, #00bcd4, #0097a7);
    color: #ffffff;
    border-radius: 16px 16px 4px 16px;
}

.ai-msg .hybs-chat-bubble {
    background: #ffffff;
    color: #333333;
    border-radius: 16px 16px 16px 4px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.hybs-chat-msg-time {
    display: block;
    font-size: 10px;
    margin-top: 5px;
    text-align: right;
}

.user-msg .hybs-chat-msg-time {
    color: rgba(255, 255, 255, 0.75);
}

.ai-msg .hybs-chat-msg-time {
    color: #9e9e9e;
}

/* Empty State */
.hybs-chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 20px;
    color: #8898a5;
    gap: 15px;
}

.hybs-chat-empty-icon {
    font-size: 48px;
    color: #00bcd4;
    opacity: 0.7;
    animation: hybs-bounce 3s infinite ease-in-out;
}

@keyframes hybs-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.hybs-chat-empty-state h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #4a5568;
}

.hybs-chat-empty-state p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.4;
}

/* Chat Footer / Input Area */
.hybs-chat-footer {
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 10px;
    align-items: center;
}

.hybs-chat-input-wrapper {
    flex-grow: 1;
    position: relative;
}

.hybs-chat-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 13.5px;
    outline: none;
    transition: all 0.2s ease;
    background: #f8fafc;
    resize: none;
    height: 40px;
    line-height: 18px;
}

.hybs-chat-input:focus {
    border-color: #00bcd4;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

.hybs-chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00b4db, #0083b0);
    border: none;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.hybs-chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(0, 180, 219, 0.3);
}

.hybs-chat-send-btn:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Loading / Typing Indicator */
.hybs-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
}

.hybs-typing-dot {
    width: 6px;
    height: 6px;
    background-color: #00bcd4;
    border-radius: 50%;
    animation: hybs-typing-bounce 1.4s infinite ease-in-out both;
}

.hybs-typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.hybs-typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes hybs-typing-bounce {
    0%, 80%, 100% { 
        transform: scale(0);
    } 40% { 
        transform: scale(1);
    }
}

/* Responsive adjustment */
@media (max-width: 480px) {
    .hybs-chat-container {
        right: 15px;
        bottom: 85px;
        width: calc(100% - 30px);
        height: 450px;
    }
    .hybs-chat-launcher {
        right: 15px;
        bottom: 15px;
    }
}
