/* Professional Green Palette - Premium Refresh */
:root {
    --ai-primary: #10b981;
    --ai-primary-dark: #064e3b;
    --ai-bg: rgba(255, 255, 255, 0.98);
    --ai-glass: rgba(255, 255, 255, 0.85);
    --ai-text: #0f172a;
    --ai-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --ai-accent: #6366f1;
}

.support-ai-bubble {
    display: none; /* Hidden as per user request, moved to navbar */
}

.support-ai-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: var(--ai-bg);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 32px;
    box-shadow: var(--ai-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    user-select: none;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

@media (max-width: 480px) {
    .support-ai-window {
        width: 100%;
        right: 0;
        bottom: 0;
        height: 85vh;
        border-radius: 32px 32px 0 0;
    }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.support-ai-header {
    background: linear-gradient(135deg, #064e3b 0%, #10b981 100%);
    padding: 20px 24px;
    color: white;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    border-radius: 32px 32px 0 0;
    cursor: move;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-actions button, .header-actions i {
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s;
    font-size: 16px;
    background: none;
    border: none;
    color: white;
}

.header-actions button:hover, .header-actions i:hover {
    opacity: 1;
    transform: scale(1.1);
}

.chat-settings-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 100;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.settings-content {
    padding: 12px 20px;
}

.settings-content label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.settings-content select {
    width: 100%;
}

/* Chat Body & Messages */
.support-ai-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message-wrapper {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-wrapper {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.ai-wrapper {
    align-self: flex-start;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.ai-avatar { background: rgba(16, 185, 129, 0.1); color: var(--ai-primary); border: 1px solid rgba(16, 185, 129, 0.2); }
.user-avatar { background: rgba(99, 102, 241, 0.1); color: var(--ai-accent); border: 1px solid rgba(99, 102, 241, 0.2); }

.message-bubble {
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 14.5px;
    line-height: 1.6;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.ai-message {
    background: #f8fafc;
    color: #334155;
    border-top-left-radius: 4px;
    border: 1px solid #f1f5f9;
}

.user-message {
    background: linear-gradient(135deg, var(--ai-primary), var(--ai-primary-dark));
    color: white;
    border-top-right-radius: 4px;
}

.ai-typing {
    font-size: 13px;
    color: #64748b;
    padding: 12px 24px;
    display: none;
    font-weight: 500;
}

.quick-chips {
    padding: 12px 20px;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    scroll-behavior: smooth;
    padding-bottom: 16px; /* Space for scrollbar */
    cursor: grab;
    user-select: none;
}

.quick-chips.active {
    cursor: grabbing;
}


.quick-chips::-webkit-scrollbar {
    height: 4px;
}

.quick-chips::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.quick-chips::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.quick-chips::-webkit-scrollbar-thumb:hover {
    background: var(--ai-primary);
}


.chip {
    padding: 6px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.chip:hover {
    background: var(--ai-primary);
    border-color: var(--ai-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* Toast Notification System */
.ai-toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.ai-toast {
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(8px);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: all 0.3s ease;
}

@keyframes toastIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.ai-toast.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

.ai-toast i {
    color: #10b981;
}

/* Footer Styling - Separate Elements Design */
.support-ai-footer {
    padding: 20px 24px;
    background: white;
    border-top: 1px solid #f1f5f9;
}

.chat-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.support-ai-input-fixed {
    flex: 1;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    color: #1e293b !important;
    outline: none !important;
    height: 48px !important;
    transition: all 0.2s !important;
}

.support-ai-input-fixed:focus {
    background: white !important;
    border-color: var(--ai-primary) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.support-ai-mic-fixed {
    width: 48px !important;
    height: 48px !important;
    border-radius: 16px !important;
    background: #f1f5f9 !important;
    border: none !important;
    color: #64748b !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

.support-ai-mic-fixed:hover { background: #e2e8f0 !important; color: #1e293b !important; }
.support-ai-mic-fixed.recording { background: #fee2e2 !important; color: #ef4444 !important; animation: pulseRed 1.5s infinite; }

@keyframes pulseRed {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.support-ai-send-fixed {
    width: 48px !important;
    height: 48px !important;
    border-radius: 16px !important;
    background: var(--ai-accent) !important;
    border: none !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
}

.support-ai-send-fixed:hover { transform: translateY(-2px) !important; box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4) !important; }

/* Analytical Widgets */
.ai-widget-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 10px 0;
    width: 100%;
}

.ai-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 16px;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    animation: aiWidgetIn 0.5s cubic-bezier(0.23, 1, 0.32, 1) both;
}

.ai-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.ai-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ai-card-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.ai-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    font-size: 14px;
}

.ai-card-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 4px 0;
}

.ai-card-subtext {
    font-size: 11px;
    color: #64748b;
}

/* Dark Mode adjustment for AI cards inside light bubble */
.ai-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.ai-progress-group {
    margin-top: 12px;
}

.ai-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 6px;
    font-weight: 600;
    color: #475569;
}

.ai-progress-track {
    height: 6px;
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
}

.ai-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mini List */
.ai-mini-list {
    margin-top: 10px;
}

.ai-mini-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.ai-mini-item:last-child { border-bottom: none; }

.ai-mini-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.ai-mini-info {
    flex: 1;
}

.ai-mini-name {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.ai-mini-date {
    font-size: 11px;
    color: #94a3b8;
}

@keyframes aiWidgetIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
