/* =====================================================
   GIXO HELPERBOT - AURORA DARK THEME
   AI Assistant with lighter dark backgrounds and vibrant accents
   ===================================================== */

/* ==========================================================================
   1. Floating Action Button (FAB)
   ========================================================================== */
.gixo-bot-fab {
    position: fixed !important;
    bottom: 2rem !important;
    right: 2rem !important;
    z-index: 1300 !important;
    background: linear-gradient(135deg, #00d9ff, #4bcffa) !important;
    box-shadow: 
        0 8px 24px rgba(0, 217, 255, 0.3),
        0 0 40px rgba(0, 217, 255, 0.2) !important;
    animation: pulse-glow 3s ease-in-out infinite;
    border: 1px solid rgba(0, 217, 255, 0.3);
}

.gixo-bot-fab:hover {
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 
        0 12px 32px rgba(0, 217, 255, 0.4),
        0 0 60px rgba(0, 217, 255, 0.3) !important;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 
            0 8px 24px rgba(0, 217, 255, 0.3),
            0 0 40px rgba(0, 217, 255, 0.2);
    }
    50% {
        box-shadow: 
            0 8px 32px rgba(0, 217, 255, 0.4),
            0 0 60px rgba(0, 217, 255, 0.3);
    }
}

/* ==========================================================================
   2. Chat Drawer Container
   ========================================================================== */
.gixo-bot-drawer {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 420px;
    height: 600px;
    max-height: calc(100vh - 8rem);
    z-index: 1299;
    display: flex;
    flex-direction: column;
    
    /* Aurora glass morphism with better visibility */
    background: rgba(36, 43, 71, 0.95) !important;
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 16px;
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(0, 217, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================================================
   3. Header Section
   ========================================================================== */
.gixo-bot-header {
    padding: 1.25rem;
    background: linear-gradient(to bottom, 
        rgba(26, 31, 58, 0.95), 
        rgba(26, 31, 58, 0.7));
    border-bottom: 1px solid rgba(0, 217, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gixo-bot-header .mud-typography-h6 {
    background: linear-gradient(135deg, #00d9ff, #4bcffa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    text-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}

/* ==========================================================================
   4. Messages Container
   ========================================================================== */
.gixo-bot-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

/* Custom scrollbar */
.gixo-bot-messages::-webkit-scrollbar {
    width: 6px;
}

.gixo-bot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.gixo-bot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 217, 255, 0.2);
    border-radius: 3px;
    transition: background 0.2s;
}

.gixo-bot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 217, 255, 0.4);
}

/* ==========================================================================
   5. Message Bubbles
   ========================================================================== */
.message-group {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-group.user {
    flex-direction: row-reverse;
}

.message-avatar {
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 217, 255, 0.2);
}

.message-bubble {
    max-width: 75%;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    font-size: 0.9375rem;
    line-height: 1.6;
    position: relative;
    word-wrap: break-word;
    transition: transform 0.2s ease;
}

.message-bubble:hover {
    transform: translateY(-1px);
}

/* Assistant messages - Better visibility */
.message-bubble.assistant {
    background: rgba(45, 54, 84, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #f8fafc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* User messages */
.message-bubble.user {
    background: linear-gradient(135deg, #00d9ff, #00a8cc);
    color: #1a1f3a;
    box-shadow: 
        0 4px 16px rgba(0, 217, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

/* Copy button */
.copy-button {
    position: absolute !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: rgba(26, 31, 58, 0.9) !important;
    color: #00d9ff !important;
    border: 1px solid rgba(0, 217, 255, 0.2) !important;
}

.message-bubble:hover .copy-button {
    opacity: 1;
}

/* ==========================================================================
   6. Typing Indicator
   ========================================================================== */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 1rem 1.25rem;
    background: rgba(45, 54, 84, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #00d9ff;
    border-radius: 50%;
    animation: typingPulse 1.4s infinite ease-in-out;
    box-shadow: 0 0 8px rgba(0, 217, 255, 0.6);
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingPulse {
    0%, 60%, 100% {
        transform: scale(0.7);
        opacity: 0.5;
    }
    30% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
   7. Suggestions Section
   ========================================================================== */
.gixo-bot-suggestions {
    padding: 1rem 1.5rem;
    background: rgba(26, 31, 58, 0.6);
    border-top: 1px solid rgba(0, 217, 255, 0.2);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suggestion-chip {
    padding: 0.5rem 1rem;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 20px;
    font-size: 0.875rem;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.suggestion-chip:hover {
    background: rgba(0, 217, 255, 0.2);
    border-color: rgba(0, 217, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.3);
    color: #f8fafc;
}

/* ==========================================================================
   8. Input Area
   ========================================================================== */
.gixo-bot-input {
    padding: 1rem 1.5rem;
    background: rgba(26, 31, 58, 0.8);
    border-top: 1px solid rgba(0, 217, 255, 0.2);
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.bot-textarea .mud-input-root {
    background: rgba(255, 255, 255, 0.06) !important;
    border-radius: 12px !important;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.bot-textarea .mud-input-root:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(0, 217, 255, 0.2);
}

.bot-textarea .mud-input-root.mud-focused {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(0, 217, 255, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1) !important;
}

.bot-textarea textarea {
    color: #f8fafc !important;
    padding: 0.75rem !important;
    font-size: 0.9375rem !important;
    line-height: 1.5 !important;
}

.bot-textarea .mud-input-underline:before {
    display: none !important;
}

/* Send button styling */
.gixo-bot-input .mud-button-root {
    background: var(--gixo-primary) !important;
    color: var(--gixo-background) !important;
    min-width: 40px !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.3);
}

.gixo-bot-input .mud-button-root:hover {
    background: var(--gixo-primary-light) !important;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.4);
}

/* ==========================================================================
   9. Responsive Design
   ========================================================================== */
@media (max-width: 640px) {
    .gixo-bot-drawer {
        right: 1rem;
        left: 1rem;
        width: auto;
        bottom: 5rem;
        height: calc(100vh - 6rem);
    }
    
    .gixo-bot-fab {
        bottom: 1rem !important;
        right: 1rem !important;
    }
    
    .message-bubble {
        max-width: 85%;
    }
}

/* ==========================================================================
   10. High Contrast Mode
   ========================================================================== */
[data-contrast="high"] .gixo-bot-drawer {
    background: #000000 !important;
    backdrop-filter: none !important;
    border: 2px solid #ffffff !important;
}

[data-contrast="high"] .gixo-bot-header {
    background: #000000 !important;
    border-bottom: 2px solid #ffffff !important;
}

[data-contrast="high"] .message-bubble.assistant {
    background: #000000 !important;
    border: 2px solid #00ffff !important;
    color: #ffffff !important;
}

[data-contrast="high"] .message-bubble.user {
    background: #00ffff !important;
    color: #000000 !important;
    border: none !important;
}

[data-contrast="high"] .suggestion-chip {
    background: #000000 !important;
    border: 2px solid #00ffff !important;
    color: #00ffff !important;
}

[data-contrast="high"] .suggestion-chip:hover {
    background: #00ffff !important;
    color: #000000 !important;
}

[data-contrast="high"] .typing-dot {
    background: #00ffff !important;
    box-shadow: none !important;
}

[data-contrast="high"] .gixo-bot-input {
    background: #000000 !important;
    border-top: 2px solid #ffffff !important;
}

[data-contrast="high"] .bot-textarea .mud-input-root {
    background: #000000 !important;
    border: 2px solid #ffffff !important;
}

[data-contrast="high"] .bot-textarea .mud-input-root.mud-focused {
    border-color: #00ffff !important;
    box-shadow: none !important;
}

/* ==========================================================================
   11. Message Content Styling
   ========================================================================== */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #f8fafc;
}

.message-bubble p {
    margin: 0.5rem 0;
}

.message-bubble code {
    background: rgba(0, 217, 255, 0.2);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875em;
    color: #66e9ff;
    border: 1px solid rgba(0, 217, 255, 0.3);
}

.message-bubble pre {
    background: rgba(26, 31, 58, 0.6);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem 0;
    overflow-x: auto;
}

.message-bubble pre code {
    background: none;
    padding: 0;
    border: none;
}

.message-bubble ul,
.message-bubble ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-bubble li {
    margin: 0.25rem 0;
}

.message-bubble strong {
    font-weight: 600;
    color: #66e9ff;
}

.message-bubble a {
    color: #00d9ff;
    text-decoration: underline;
}

.message-bubble a:hover {
    color: #66e9ff;
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.5);
}

/* Message timestamp */
.message-timestamp {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.message-group:hover .message-timestamp {
    opacity: 1;
}

/* ==========================================================================
   12. Loading States
   ========================================================================== */
.gixo-bot-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.gixo-bot-loading .mud-progress-circular {
    color: var(--gixo-primary) !important;
}

/* Skeleton loader for messages */
.message-skeleton {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.5rem 0;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(90deg, 
        var(--gixo-surface) 25%, 
        rgba(0, 217, 255, 0.1) 50%, 
        var(--gixo-surface) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-bubble {
    flex: 1;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(90deg, 
        var(--gixo-surface) 25%, 
        rgba(0, 217, 255, 0.1) 50%, 
        var(--gixo-surface) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* ==========================================================================
   13. Special Effects
   ========================================================================== */

/* Glow effect for new messages */
@keyframes newMessageGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 217, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 217, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 217, 255, 0);
    }
}

.message-bubble.new-message {
    animation: newMessageGlow 0.5s ease-out;
}

/* Hover effect for interactive elements */
.gixo-bot-drawer .mud-icon-button:hover {
    color: var(--gixo-primary) !important;
    background: rgba(0, 217, 255, 0.1) !important;
    transform: rotate(90deg);
}

/* Easter egg: Rainbow text on special commands */
@keyframes rainbow {
    0% { color: #ff6b6b; }
    16% { color: #ffd93d; }
    33% { color: #26de81; }
    50% { color: #00d9ff; }
    66% { color: #4bcffa; }
    83% { color: #a78bfa; }
    100% { color: #ff6b6b; }
}

.rainbow-text {
    animation: rainbow 3s linear infinite;
    font-weight: 600;
}

/* ==========================================================================
   End of GIXO HelperBot Aurora Dark Styles
   ========================================================================== */
