/* ==========================================================================
   OfficeHub AI Copilot & Assistant - Stylesheet
   Luxury Dark Theme with Gemini Sparkle Accents (#0B1325, #FFB703, Google Gemini Gradients)
   ========================================================================== */

:root {
    --ai-primary: #FFB703;
    --ai-secondary: #FB8500;
    --ai-dark: #0B1325;
    --ai-darker: #070D19;
    --ai-card: #0F1C3F;
    --ai-gemini-grad: linear-gradient(135deg, #1A73E8 0%, #8E24AA 50%, #FFB703 100%);
    --ai-gemini-glow: 0 0 35px rgba(142, 36, 170, 0.4);
}

/* Floating AI Assistant Trigger Button */
#officehub-ai-trigger {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: #0B1325;
    border: 1.5px solid rgba(255, 183, 3, 0.4);
    border-radius: 9999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 183, 3, 0.25);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    direction: rtl;
}

#officehub-ai-trigger:hover {
    transform: translateY(-4px) scale(1.03);
    border-color: #FFB703;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7), 0 0 35px rgba(255, 183, 3, 0.4);
}

.ai-trigger-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--ai-gemini-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 1.15rem;
    box-shadow: 0 0 15px rgba(142, 36, 170, 0.5);
    position: relative;
    flex-shrink: 0;
}

.ai-pulse-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 11px;
    height: 11px;
    background: #10B981;
    border: 2px solid #0B1325;
    border-radius: 50%;
    box-shadow: 0 0 8px #10B981;
    animation: ai-pulse 2s infinite ease-in-out;
}

@keyframes ai-pulse {
    0% { transform: scale(0.9); opacity: 0.9; }
    50% { transform: scale(1.3); opacity: 0.4; }
    100% { transform: scale(0.9); opacity: 0.9; }
}

.ai-trigger-text {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.ai-trigger-title {
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.2;
}

.ai-trigger-sub {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    color: #FFB703;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Chat Drawer / Window */
#officehub-ai-drawer {
    position: fixed;
    bottom: 95px;
    right: 28px;
    width: 440px;
    max-width: calc(100vw - 36px);
    height: 650px;
    max-height: calc(100vh - 120px);
    background: rgba(11, 19, 37, 0.96);
    border: 1.5px solid rgba(255, 183, 3, 0.35);
    border-radius: 1.75rem;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.9), 0 0 45px rgba(255, 183, 3, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 99999;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    direction: rtl;
    overflow: hidden;
}

#officehub-ai-drawer.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Header */
.ai-drawer-header {
    padding: 18px 20px;
    background: rgba(7, 13, 25, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ai-drawer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--ai-gemini-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 1.25rem;
    box-shadow: 0 0 15px rgba(142, 36, 170, 0.4);
    flex-shrink: 0;
}

.ai-header-info h4 {
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0;
    line-height: 1.2;
}

.ai-header-info p {
    font-family: 'Cairo', sans-serif;
    font-size: 0.72rem;
    color: #94A3B8;
    margin: 2px 0 0 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-status-indicator {
    width: 7px;
    height: 7px;
    background: #10B981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px #10B981;
}

.ai-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-icon-btn:hover {
    background: rgba(255, 183, 3, 0.15);
    border-color: #FFB703;
    color: #FFB703;
}

/* Quick Suggestion Chips Carousel */
.ai-chips-container {
    padding: 12px 16px;
    background: rgba(15, 28, 63, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.ai-chips-container::-webkit-scrollbar {
    display: none;
}

.ai-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 183, 3, 0.25);
    border-radius: 9999px;
    color: #E2E8F0;
    font-family: 'Cairo', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ai-chip:hover {
    background: rgba(255, 183, 3, 0.15);
    border-color: #FFB703;
    color: #FFB703;
    transform: translateY(-1px);
}

/* Messages Area */
.ai-messages-list {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ai-messages-list::-webkit-scrollbar {
    width: 5px;
}
.ai-messages-list::-webkit-scrollbar-thumb {
    background: rgba(255, 183, 3, 0.3);
    border-radius: 9999px;
}

.ai-msg {
    display: flex;
    gap: 10px;
    max-width: 88%;
    animation: ai-msg-fade 0.25s ease-out;
}

@keyframes ai-msg-fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-msg.bot {
    align-self: flex-start;
}

.ai-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-msg-bubble {
    padding: 12px 15px;
    border-radius: 1.25rem;
    font-family: 'Cairo', sans-serif;
    font-size: 0.82rem;
    line-height: 1.6;
    word-break: break-word;
}

.ai-msg.bot .ai-msg-bubble {
    background: rgba(15, 28, 63, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #F8FAFC;
    border-bottom-right-radius: 0.35rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.ai-msg.user .ai-msg-bubble {
    background: linear-gradient(135deg, #FFB703 0%, #FB8500 100%);
    color: #070D19;
    font-weight: 700;
    border-bottom-left-radius: 0.35rem;
    box-shadow: 0 4px 15px rgba(255, 183, 3, 0.2);
}

.ai-msg-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ai-action-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    background: rgba(255, 183, 3, 0.12);
    border: 1px solid rgba(255, 183, 3, 0.3);
    border-radius: 8px;
    color: #FFB703;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ai-action-link:hover {
    background: #FFB703;
    color: #070D19;
    transform: translateY(-1px);
}

/* Typing Indicator */
.ai-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: rgba(15, 28, 63, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    width: fit-content;
    align-self: flex-start;
}

.ai-typing-dot {
    width: 6px;
    height: 6px;
    background: #FFB703;
    border-radius: 50%;
    animation: ai-bounce 1.4s infinite ease-in-out both;
}

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

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

/* Input Bar */
.ai-input-wrapper {
    padding: 14px 16px;
    background: rgba(7, 13, 25, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-input-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 28, 63, 0.6);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    padding: 6px 8px 6px 14px;
    transition: all 0.2s ease;
}

.ai-input-form:focus-within {
    border-color: #FFB703;
    box-shadow: 0 0 15px rgba(255, 183, 3, 0.25);
    background: rgba(15, 28, 63, 0.9);
}

.ai-input-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #FFFFFF;
    font-family: 'Cairo', sans-serif;
    font-size: 0.82rem;
}

.ai-input-field::placeholder {
    color: #64748B;
}

.ai-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFB703 0%, #FB8500 100%);
    border: none;
    color: #070D19;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ai-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(255, 183, 3, 0.5);
}

/* Settings Modal */
#ai-settings-modal {
    position: absolute;
    inset: 0;
    background: rgba(7, 13, 25, 0.95);
    backdrop-filter: blur(12px);
    z-index: 10;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 1.75rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
}

#ai-settings-modal.active {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    #officehub-ai-drawer {
        bottom: 80px;
        right: 12px;
        left: 12px;
        width: auto;
        height: 560px;
    }
    #officehub-ai-trigger {
        bottom: 18px;
        right: 18px;
        padding: 8px 14px;
    }
}
