/* Premium Chatbot Styles - Realistic 3D Glass & Neon Edition */
:root {
    --chat-primary-gradient: linear-gradient(135deg, #00d2ff 0%, #bd00ff 100%);
    --chat-border-gradient: linear-gradient(135deg, rgba(255, 0, 255, 0.8) 0%, rgba(0, 255, 255, 0.8) 100%);
    --chat-bot-bg: rgba(10, 15, 25, 0.5);
    --chat-window-bg: rgba(10, 15, 25, 0.35); /* Highly transparent */
    --chat-neon-cyan: #00f2ff;
    --chat-neon-purple: #ff00ff;
}

.adople-chat-container {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
    pointer-events: none; /* Let clicks and scrolls pass through to the website */
}

/* GLOBAL AUTO-HIDING SCROLLBAR (For Windows/Linux) */
html::-webkit-scrollbar {
    width: 8px;
    background: transparent;
}
html::-webkit-scrollbar-track {
    background: transparent;
}
html::-webkit-scrollbar-thumb {
    background: transparent; /* Hidden by default */
    border-radius: 10px;
}
html.is-scrolling::-webkit-scrollbar-thumb {
    background: rgba(120, 120, 120, 0.5); /* Shows up when scrolling */
}
html.is-scrolling::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 120, 120, 0.8);
}
/* Firefox fallback */
html {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}
html.is-scrolling {
    scrollbar-color: rgba(120, 120, 120, 0.5) transparent;
}

/* REALISTIC 3D GLASS BUBBLE ORB */
.chat-orb {
    pointer-events: auto; /* Ensure the orb is still clickable */
    width: 65px;
    height: 65px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    
    /* Center is transparent/dark to let the backdrop filter work */
    background: radial-gradient(circle at 40% 40%, rgba(0, 0, 0, 0.1) 30%, rgba(0, 0, 0, 0.6) 80%);
    backdrop-filter: blur(8px);
    
    /* The extremely vibrant glowing edges exactly like the image */
    box-shadow: 
        /* Cyan top-left rim */
        inset 6px 6px 15px rgba(0, 242, 255, 1),
        inset 2px 2px 5px rgba(0, 242, 255, 0.8),
        
        /* Magenta bottom-right thick rim */
        inset -8px -8px 20px rgba(255, 0, 255, 1),
        inset -3px -3px 8px rgba(255, 0, 255, 0.8),
        
        /* Outer glow to match the environment */
        8px 8px 25px rgba(255, 0, 255, 0.6),
        -4px -4px 20px rgba(0, 242, 255, 0.4);
    
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: orb-float 3s infinite ease-in-out;
}

/* Sharp Specular Highlight (The perfect curved white reflection on top-left) */
.chat-orb::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 10px;
    width: 30px;
    height: 18px;
    border-radius: 50%;
    /* Creates a crescent moon shape for realistic glass reflection */
    box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.95);
    transform: rotate(-35deg);
    filter: blur(0.5px);
    pointer-events: none;
}

@keyframes orb-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.chat-orb svg {
    display: block; 
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* HIGHLY TRANSPARENT CHAT WINDOW WITH GRADIENT BORDER */
.chat-window {
    position: absolute;
    bottom: 0;
    right: 85px; 
    width: 330px; 
    height: 480px; 
    max-height: calc(100vh - 100px);
    background: var(--chat-window-bg);
    backdrop-filter: blur(25px) saturate(120%);
    border-radius: 22px;
    display: block !important; /* Absolute layout instead of flex */
    box-shadow: 0 30px 80px rgba(0,0,0,0.9);
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden; /* CRITICAL: Removes from hit-test tree entirely when closed */
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s;
    z-index: 1;
    overflow: hidden; /* Prevent anything from sticking out */
}

/* The Glowing Gradient Border for the Window */
.chat-window::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 22px; 
    padding: 1.5px; /* Border thickness */
    background: var(--chat-border-gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude; 
    pointer-events: none;
    z-index: 2;
}

.chat-window.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto !important; /* Auto is the correct HTML property, not 'all' */
    visibility: visible;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0s;
}

/* Header */
.chat-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 68px; /* Fixed height for absolute layout */
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.2); 
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    z-index: 10;
}

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

.header-avatar {
    width: 38px;
    height: 38px;
    background: #000;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--chat-neon-cyan);
    box-shadow: 0 0 10px rgba(0,255,255,0.3);
}

.header-avatar img {
    width: 22px;
}

.status-info h3 {
    margin: 0;
    font-size: 14px;
    color: white;
    font-weight: 600;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 8px #00ff88;
}

.status-row span {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
}

/* Messages */
.chat-messages {
    position: absolute;
    top: 68px;
    bottom: 70px; /* Space for input ONLY */
    left: 0;
    right: 0;
    height: auto !important; /* Override any previous fallbacks */
    padding: 20px;
    overflow-y: auto !important; /* AUTO means it only shows when needed */
    overflow-x: hidden !important;
    display: block !important; 
    z-index: 5 !important; 
    scroll-behavior: auto !important; 
    pointer-events: auto !important; 
    overscroll-behavior: contain !important; /* CRITICAL: Prevents background scrolling */
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Message Rows for Bulletproof Float Layout */
.message-row {
    display: block !important;
    width: 100% !important;
    clear: both !important;
    margin-bottom: 15px !important; /* Replaces flex gap */
    transform: none !important;
    text-align: left !important;
}
.message-row::after {
    content: "";
    display: table;
    clear: both;
}

.message-row.user .message {
    float: right !important;
}
.message-row.bot .message {
    float: left !important;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    font-size: 13.5px;
    line-height: 1.5;
    position: relative;
    display: inline-block !important;
    word-wrap: break-word !important; /* Safe wrapping */
    text-align: left !important;
    margin: 0 !important;
    /* Absolute Nuclear Reset for Rendering Bugs */
    transform: none !important;
    -webkit-transform: none !important;
    writing-mode: horizontal-tb !important;
    -webkit-writing-mode: horizontal-tb !important;
    direction: ltr !important;
}

/* Realistic Dark Glass Bot Message with Gradient Border */
.message.bot {
    color: #eee;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    background: linear-gradient(var(--chat-bot-bg), var(--chat-bot-bg)) padding-box,
                var(--chat-border-gradient) border-box;
    border: 1px solid transparent;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Vibrant Gradient User Message */
.message.user {
    color: white;
    border-radius: 18px;
    border-bottom-right-radius: 4px;
    background: var(--chat-primary-gradient);
    box-shadow: 0 5px 15px rgba(189, 0, 255, 0.4);
}

/* Input Box */
.chat-input-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    padding: 10px 15px 15px; 
    background: transparent;
    z-index: 10;
}

.input-wrapper {
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)) padding-box,
                var(--chat-border-gradient) border-box;
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between; 
    height: 42px; 
    transition: 0.2s;
    width: 100%;
}

.input-wrapper:focus-within {
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    outline: none;
    font-size: 14px;
    height: 100%;
    padding: 0;
    display: flex;
    align-items: center;
}

.send-icon {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: 0.2s;
}

.send-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}
