/* ===============================
   OneZoro AI Chat Widget (Premium Dark Pro)
   =============================== */

/* Reset for widget only */
#oz-ai-btn,
#oz-ai-box,
#oz-ai-box * {
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Inline Link Styling */
.oz-link-text {
    color: #D32F2F; 
    font-weight: 600;
    text-decoration: underline; 
    transition: color 0.2s ease;
    background: transparent;
    padding: 0;
    margin: 0;
    display: inline;
}

.oz-link-text:hover {
    color: #b71c1c; 
    text-decoration: none;
}

/* Floating Chat Button - Premium Dark Default */
#oz-ai-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #0F121C;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999998;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s;
}

#oz-ai-btn:hover {
    transform: scale(1.05);
    background: #1A1D2A;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8), 0 0 12px rgba(255, 255, 255, 0.05);
}

/* FAB Icon Animations */
#oz-ai-btn svg {
    position: absolute;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.4s ease;
}

#oz-chat-icon {
    transform: scale(1) rotate(0deg);
    opacity: 1;
}

#oz-arrow-icon {
    transform: scale(0) rotate(-90deg);
    opacity: 0;
}

/* Active state for FAB when chat is open */
#oz-ai-btn.is-open {
    background: #02030D;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

#oz-ai-btn.is-open #oz-chat-icon {
    transform: scale(0) rotate(90deg);
    opacity: 0;
}

#oz-ai-btn.is-open #oz-arrow-icon {
    transform: scale(1) rotate(0deg);
    opacity: 1;
}

/* Main Chat Container - Premium Shadow, Border & ANIMATION */
#oz-ai-box {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 400px;
    height: 75vh;
    max-height: 650px;
    background: #02030D;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
    flex-direction: column;
    z-index: 9999999;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    
    /* Animation Setup (Replaces display:none) */
    display: flex;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.2), visibility 0.4s;
}

/* Class added via JS to trigger open animation */
#oz-ai-box.show-chat {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header - Premium Subtle Gradient & Glassy feel */
#oz-ai-header {
    background: #02030D; 
    color: #ffffff;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 2; 
}

.oz-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Avatar & Status Dot Setup */
.oz-avatar-wrapper {
    position: relative;
    display: flex;
}

.bot-avatar {
    background: #02030D; 
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; 
}

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

.oz-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: #00e676; 
    border: 2px solid #0A0C16; 
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.4); 
}

/* Header Text Styling */
.oz-header-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.oz-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.oz-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 3px;
    font-weight: 400;
}

.oz-close-btn {
    cursor: pointer;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s ease;
}

.oz-close-btn:hover {
    color: #ffffff;
}

/* Messages Area */
#oz-ai-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #02030D; 
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Custom Scrollbar */
#oz-ai-messages::-webkit-scrollbar {
    width: 5px;
}

#oz-ai-messages::-webkit-scrollbar-track {
    background: transparent;
}

#oz-ai-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

#oz-ai-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Message Layout */
.oz-msg-user {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.oz-msg-ai {
    display: flex;
    justify-content: flex-start;
    width: 100%;
}

.oz-msg-user span,
.oz-msg-ai span {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.5;
    max-width: 82%;
    word-wrap: break-word;
    letter-spacing: 0.2px;
}

/* User Bubble - Premium Red */
.oz-msg-user span {
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.2);
}

.oz-msg-ai span {
    background: #0F121C;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-bottom-left-radius: 4px;
}

/* Footer - Soft blend */
#oz-ai-footer {
    padding: 15px 20px;
    background: linear-gradient(0deg, #0A0C16 0%, #02030D 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 2;
}

.input-wrapper {
    display: flex;
    background: #0F121C;
    border-radius: 30px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    align-items: center;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: rgba(211, 47, 47, 0.8);
    background: #0F121C;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.15);
}

#oz-ai-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 12px;
    outline: none;
    font-size: 14.5px;
    color: #ffffff;
}

#oz-ai-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#oz-ai-send {
    width: 40px;
    height: 40px;
    background: #D32F2F;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.3);
}

#oz-ai-send:hover {
    transform: scale(1.08);
    background: #E53935;
    box-shadow: 0 6px 14px rgba(211, 47, 47, 0.5);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    height: 20px;
}

.typing-indicator div {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: oz-bounce 1.4s infinite ease-in-out both;
}

.typing-indicator div:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator div:nth-child(2) { animation-delay: -0.16s; }

@keyframes oz-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #oz-ai-box {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        border: none;
    }

    #oz-ai-btn {
        bottom: 15px;
        right: 15px;
        width: 60px;
        height: 60px;
    }
}