/* ==========================================================================
   MR. PHUOC AI ASSISTANT - FLOATING WIDGET STYLES
   Modern Glassmorphism & Cyber-Educational Theme
   ========================================================================== */

:root {
    --ai-primary: #1cb0f6;
    --ai-primary-glow: rgba(28, 176, 246, 0.45);
    --ai-secondary: #58cc02;
    --ai-secondary-glow: rgba(88, 204, 2, 0.35);
    --ai-accent: #ff9600;
    --ai-bg-glass: rgba(18, 28, 34, 0.94);
    --ai-border: rgba(255, 255, 255, 0.14);
    --ai-text-main: #f8fafc;
    --ai-text-sub: #94a3b8;
    --ai-user-bubble: linear-gradient(135deg, #0284c7 0%, #1cb0f6 100%);
    --ai-bot-bubble: rgba(255, 255, 255, 0.07);
    --ai-shadow: 0 16px 45px rgba(0, 0, 0, 0.55), 0 0 25px rgba(28, 176, 246, 0.2);
}

/* ==========================================================================
   1. FLOATING ACTION BUTTON (TRIGGER)
   ========================================================================== */
#mrphuoc-ai-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: block !important;
    visibility: visible !important;
    pointer-events: auto !important;
    font-family: 'Be Vietnam Pro', 'Montserrat', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

/* Safe positioning when bottom navigation bar is visible on mobile */
body:has(.bottom-nav:not(.hidden)) #mrphuoc-ai-container,
body:has(#bottom-nav:not(.hidden)) #mrphuoc-ai-container {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 600px) {
    #mrphuoc-ai-container {
        right: 14px;
        bottom: 20px;
    }
    .ai-welcome-bubble {
        width: min(240px, calc(100vw - 32px)) !important;
        max-width: calc(100vw - 32px) !important;
        right: 0 !important;
        bottom: 70px !important;
        padding: 9px 12px !important;
    }
    .ai-welcome-bubble-text {
        font-size: 0.78rem !important;
    }
    body:has(.bottom-nav:not(.hidden)) #mrphuoc-ai-container,
    body:has(#bottom-nav:not(.hidden)) #mrphuoc-ai-container {
        bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    }
}

/* AI Launcher Button */
.ai-launcher-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1cb0f6 0%, #0284c7 50%, #58cc02 100%);
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.5), 0 0 16px rgba(88, 204, 2, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    padding: 0;
    outline: none;
}

.ai-launcher-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 30px rgba(2, 132, 199, 0.65), 0 0 24px rgba(88, 204, 2, 0.5);
}

.ai-launcher-btn:active {
    transform: scale(0.95);
}

/* Avatar Image inside Launcher */
.ai-launcher-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    pointer-events: none;
}

.ai-launcher-icon {
    font-size: 26px;
    color: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    transition: transform 0.3s ease;
}

/* Pulse animation ring */
.ai-launcher-btn::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(28, 176, 246, 0.6), rgba(88, 204, 2, 0.6));
    z-index: -1;
    animation: ai-pulse-ring 2.8s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

@keyframes ai-pulse-ring {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.22);
        opacity: 0;
    }
    100% {
        transform: scale(1.22);
        opacity: 0;
    }
}

/* Sparkle badge on button */
.ai-launcher-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff9600;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #131f24;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    animation: ai-bounce 2s infinite ease-in-out;
}

@keyframes ai-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Welcome tooltip bubble */
.ai-welcome-bubble {
    position: absolute;
    bottom: 74px;
    right: 0;
    width: 260px;
    max-width: calc(100vw - 32px);
    background: rgba(19, 31, 36, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(28, 176, 246, 0.4);
    border-radius: 16px;
    padding: 10px 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 15px rgba(28, 176, 246, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: normal;
    word-break: normal;
    cursor: pointer;
    animation: ai-fade-in-up 0.4s ease forwards;
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 10;
}

.ai-welcome-bubble:hover {
    transform: translateY(-2px);
    border-color: var(--ai-primary);
}

.ai-welcome-bubble-text {
    font-size: 0.82rem;
    color: #ffffff;
    font-weight: 500;
    line-height: 1.35;
    word-break: normal;
    flex: 1;
}

.ai-welcome-bubble-text span {
    color: var(--ai-primary);
    font-weight: 700;
    display: inline;
}

.ai-welcome-bubble-close {
    background: none;
    border: none;
    color: var(--ai-text-sub);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.ai-welcome-bubble-close:hover {
    color: #ffffff;
}

.ai-welcome-bubble::after {
    content: '';
    position: absolute;
    bottom: -7px;
    right: 24px;
    width: 14px;
    height: 14px;
    background: rgba(19, 31, 36, 0.95);
    border-right: 1px solid rgba(28, 176, 246, 0.4);
    border-bottom: 1px solid rgba(28, 176, 246, 0.4);
    transform: rotate(45deg);
}

/* ==========================================================================
   2. MAIN CHAT WINDOW
   ========================================================================== */
.ai-chat-window {
    position: absolute;
    bottom: 74px;
    right: 0;
    width: 380px;
    height: 560px;
    max-width: calc(100vw - 28px);
    max-height: calc(82vh - 80px);
    background: var(--ai-bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--ai-border);
    border-radius: 22px;
    box-shadow: var(--ai-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.25s;
    visibility: hidden;
    opacity: 0;
    transform: scale(0.85) translateY(20px);
}

.ai-chat-window.active {
    visibility: visible;
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Chat Header */
.ai-chat-header {
    background: linear-gradient(180deg, rgba(28, 176, 246, 0.15) 0%, rgba(19, 31, 36, 0.8) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ai-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-header-avatar-wrap {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1cb0f6, #58cc02);
    padding: 2px;
    box-shadow: 0 0 10px rgba(28, 176, 246, 0.4);
    flex-shrink: 0;
}

.ai-header-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #131f24;
}

.ai-header-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #58cc02;
    border: 2px solid #131f24;
    box-shadow: 0 0 6px #58cc02;
}

.ai-header-titles {
    display: flex;
    flex-direction: column;
}

.ai-header-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
}

.ai-header-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(28, 176, 246, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(28, 176, 246, 0.35);
}

.ai-header-subtitle {
    font-size: 0.72rem;
    color: var(--ai-text-sub);
    font-weight: 500;
}

/* Header Action Buttons */
.ai-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.ai-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.ai-action-btn.btn-close:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   3. CHAT MESSAGES BODY
   ========================================================================== */
.ai-chat-body {
    flex: 1;
    padding: 14px 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* Custom modern scrollbar */
.ai-chat-body::-webkit-scrollbar {
    width: 5px;
}
.ai-chat-body::-webkit-scrollbar-track {
    background: transparent;
}
.ai-chat-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
.ai-chat-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Message Wrapper */
.ai-msg-row {
    display: flex;
    gap: 8px;
    max-width: 90%;
    animation: ai-fade-in-up 0.25s ease forwards;
}

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

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

/* Message Avatar */
.ai-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Message Bubble */
.ai-msg-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.88rem;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
    user-select: text;
    -webkit-user-select: text;
}

.ai-msg-row.user .ai-msg-bubble {
    background: var(--ai-user-bubble);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.ai-msg-row.bot .ai-msg-bubble {
    background: var(--ai-bot-bubble);
    color: var(--ai-text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
    backdrop-filter: blur(10px);
}

/* Message Time & Audio button */
.ai-msg-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    font-size: 0.7rem;
    color: var(--ai-text-sub);
}

.ai-msg-row.user .ai-msg-meta {
    justify-content: flex-end;
    color: rgba(255, 255, 255, 0.7);
}

.ai-tts-btn, .ai-copy-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--ai-text-sub);
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.ai-tts-btn:hover, .ai-copy-btn:hover {
    background: rgba(28, 176, 246, 0.25);
    color: #ffffff;
}

/* Markdown formatting inside Bot bubble */
.ai-msg-bubble strong {
    color: #38bdf8;
    font-weight: 700;
}

.ai-msg-bubble em {
    color: #a5b4fc;
    font-style: italic;
}

.ai-msg-bubble code {
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 6px;
    border-radius: 5px;
    font-family: 'Consolas', monospace;
    font-size: 0.82rem;
    color: #fcd34d;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-msg-bubble pre {
    background: rgba(0, 0, 0, 0.45);
    padding: 10px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 8px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-msg-bubble pre code {
    background: none;
    padding: 0;
    border: none;
    color: #e2e8f0;
}

.ai-msg-bubble ul, .ai-msg-bubble ol {
    margin: 6px 0;
    padding-left: 18px;
}

.ai-msg-bubble li {
    margin-bottom: 4px;
}

.ai-msg-bubble p {
    margin: 4px 0;
}

.ai-msg-bubble p:first-child {
    margin-top: 0;
}

.ai-msg-bubble p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   4. QUICK SUGGESTION CHIPS
   ========================================================================== */
.ai-suggestions-container {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    scrollbar-width: none;
}
.ai-suggestions-container::-webkit-scrollbar {
    display: none;
}

.ai-chip {
    background: rgba(28, 176, 246, 0.12);
    border: 1px solid rgba(28, 176, 246, 0.3);
    color: #bae6fd;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-chip:hover {
    background: rgba(28, 176, 246, 0.28);
    color: #ffffff;
    transform: translateY(-1px);
    border-color: rgba(28, 176, 246, 0.6);
}

/* ==========================================================================
   5. INPUT & CONTROLS FOOTER
   ========================================================================== */
.ai-chat-footer {
    padding: 10px 14px 12px;
    background: rgba(19, 31, 36, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.ai-input-wrap {
    flex: 1;
    position: relative;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ai-input-wrap:focus-within {
    border-color: var(--ai-primary);
    box-shadow: 0 0 0 3px rgba(28, 176, 246, 0.2);
    background: rgba(255, 255, 255, 0.09);
}

.ai-textarea {
    width: 100%;
    max-height: 100px;
    min-height: 22px;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.88rem;
    line-height: 1.4;
    resize: none;
    padding: 2px 0;
}

.ai-textarea::placeholder {
    color: #64748b;
}

.ai-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1cb0f6 0%, #0284c7 100%);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
    font-size: 14px;
}

.ai-send-btn:hover:not(:disabled) {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.6);
}

.ai-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   6. TYPING INDICATOR
   ========================================================================== */
.ai-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--ai-bot-bubble);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.ai-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ai-primary);
    animation: ai-typing-bounce 1.3s infinite ease-in-out;
}

.ai-typing-dot:nth-child(1) { animation-delay: 0s; }
.ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes ai-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

@keyframes ai-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   7. RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (max-width: 480px) {
    .ai-chat-window {
        width: calc(100vw - 20px);
        right: -4px;
        height: 520px;
        max-height: 75vh;
        border-radius: 18px;
    }
    .ai-launcher-btn {
        width: 54px;
        height: 54px;
    }
}

/* ==========================================================================
   8. INTERACTIVE ACTION CARDS (COPILOT ACTION HUB)
   ========================================================================== */
.ai-action-card {
    margin-top: 10px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.92));
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), 0 0 15px rgba(28, 176, 246, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: ai-fade-in-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    overflow: hidden;
}

.ai-action-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1cb0f6, #58cc02, #ff9600);
}

.ai-action-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.ai-action-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid currentColor;
}

.ai-action-badge.bug {
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

.ai-action-badge.question {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
}

.ai-action-badge.nav {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
}

.ai-action-badge.setting {
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
}

.ai-action-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
}

.ai-action-card-body {
    margin: 8px 0 12px 0;
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.45;
}

.ai-action-card-preview {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid #38bdf8;
    border-radius: 8px;
    padding: 8px 10px;
    margin-top: 6px;
    font-size: 0.79rem;
    color: #e2e8f0;
}

.ai-action-card-preview.bug-preview {
    border-left-color: #ef4444;
}

.ai-action-card-preview.question-preview {
    border-left-color: #f59e0b;
}

.ai-action-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.ai-action-btn-primary {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.4);
}

.ai-action-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0369a1, #1d4ed8);
    transform: translateY(-1.5px);
    box-shadow: 0 5px 14px rgba(2, 132, 199, 0.6);
}

.ai-action-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.ai-action-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.ai-action-btn-secondary {
    background: rgba(255, 255, 255, 0.07);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-action-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.ai-action-success-badge {
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #34d399;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    animation: ai-fade-in-up 0.25s ease forwards;
}

/* ==========================================================================
   9. DISNEY MAGIC LIGHT THEME ([data-theme="light"]) FOR AI ASSISTANT
   Frosted crystal pearl white glass, Disney sky blue accents, high contrast text
   ========================================================================== */

/* 1. Welcome Tooltip Bubble in Light Theme */
[data-theme="light"] .ai-welcome-bubble {
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1.5px solid rgba(2, 132, 199, 0.35) !important;
    box-shadow: 0 12px 32px rgba(2, 132, 199, 0.16), 0 2px 10px rgba(0, 0, 0, 0.05), 0 0 16px rgba(251, 191, 36, 0.25) !important;
}

[data-theme="light"] .ai-welcome-bubble:hover {
    border-color: #0284c7 !important;
    box-shadow: 0 16px 36px rgba(2, 132, 199, 0.22), 0 0 20px rgba(2, 132, 199, 0.3) !important;
}

[data-theme="light"] .ai-welcome-bubble-text {
    color: #0f2b48 !important;
    font-weight: 600 !important;
}

[data-theme="light"] .ai-welcome-bubble-text span {
    color: #0284c7 !important;
    font-weight: 800 !important;
}

[data-theme="light"] .ai-welcome-bubble-close {
    color: #64748b !important;
}

[data-theme="light"] .ai-welcome-bubble-close:hover {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

[data-theme="light"] .ai-welcome-bubble::after {
    background: rgba(255, 255, 255, 0.96) !important;
    border-right: 1.5px solid rgba(2, 132, 199, 0.35) !important;
    border-bottom: 1.5px solid rgba(2, 132, 199, 0.35) !important;
}

/* 2. Chat Window in Light Theme */
[data-theme="light"] .ai-chat-window {
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1.5px solid rgba(2, 132, 199, 0.25) !important;
    box-shadow: 0 20px 50px rgba(2, 132, 199, 0.18), 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}

/* Header */
[data-theme="light"] .ai-chat-header {
    background: linear-gradient(180deg, rgba(224, 242, 254, 0.95) 0%, rgba(240, 247, 255, 0.98) 100%) !important;
    border-bottom: 1.5px solid rgba(2, 132, 199, 0.16) !important;
}

[data-theme="light"] .ai-header-title {
    color: #0f2b48 !important;
}

[data-theme="light"] .ai-header-subtitle {
    color: #475569 !important;
}

[data-theme="light"] .ai-header-badge {
    background: rgba(2, 132, 199, 0.12) !important;
    color: #0284c7 !important;
    border-color: rgba(2, 132, 199, 0.3) !important;
}

[data-theme="light"] .ai-action-btn {
    background: rgba(2, 132, 199, 0.08) !important;
    border-color: rgba(2, 132, 199, 0.18) !important;
    color: #475569 !important;
}

[data-theme="light"] .ai-action-btn:hover {
    background: rgba(2, 132, 199, 0.18) !important;
    color: #0284c7 !important;
}

[data-theme="light"] .ai-action-btn.btn-close:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

/* Chat Body & Messages */
[data-theme="light"] .ai-chat-body {
    background: rgba(248, 250, 252, 0.6) !important;
}

[data-theme="light"] .ai-chat-body::-webkit-scrollbar-thumb {
    background: rgba(2, 132, 199, 0.2) !important;
}

[data-theme="light"] .ai-chat-body::-webkit-scrollbar-thumb:hover {
    background: rgba(2, 132, 199, 0.35) !important;
}

/* User Message */
[data-theme="light"] .ai-msg-row.user .ai-msg-bubble {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3) !important;
}

/* Bot Message */
[data-theme="light"] .ai-msg-row.bot .ai-msg-bubble {
    background: #ffffff !important;
    color: #0f2b48 !important;
    border: 1.5px solid rgba(2, 132, 199, 0.18) !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08) !important;
}

[data-theme="light"] .ai-msg-bubble strong {
    color: #0284c7 !important;
}

[data-theme="light"] .ai-msg-bubble em {
    color: #7c3aed !important;
}

[data-theme="light"] .ai-msg-bubble code {
    background: rgba(2, 132, 199, 0.08) !important;
    color: #0369a1 !important;
    border-color: rgba(2, 132, 199, 0.2) !important;
}

[data-theme="light"] .ai-msg-bubble pre {
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: rgba(2, 132, 199, 0.2) !important;
}

[data-theme="light"] .ai-msg-meta {
    color: #64748b !important;
}

[data-theme="light"] .ai-msg-row.user .ai-msg-meta {
    color: rgba(255, 255, 255, 0.85) !important;
}

[data-theme="light"] .ai-tts-btn,
[data-theme="light"] .ai-copy-btn {
    background: rgba(2, 132, 199, 0.08) !important;
    color: #475569 !important;
    border: 1px solid rgba(2, 132, 199, 0.15) !important;
}

[data-theme="light"] .ai-tts-btn:hover,
[data-theme="light"] .ai-copy-btn:hover {
    background: rgba(2, 132, 199, 0.2) !important;
    color: #0284c7 !important;
}

/* Suggestions Container & Chips */
[data-theme="light"] .ai-suggestions-container {
    background: rgba(240, 247, 255, 0.9) !important;
    border-top: 1px solid rgba(2, 132, 199, 0.15) !important;
}

[data-theme="light"] .ai-chip {
    background: #ffffff !important;
    border: 1px solid rgba(2, 132, 199, 0.25) !important;
    color: #0369a1 !important;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.08) !important;
}

[data-theme="light"] .ai-chip:hover {
    background: #e0f2fe !important;
    border-color: #0284c7 !important;
    color: #0284c7 !important;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.18) !important;
}

/* Footer & Input */
[data-theme="light"] .ai-chat-footer {
    background: rgba(255, 255, 255, 0.98) !important;
    border-top: 1.5px solid rgba(2, 132, 199, 0.15) !important;
}

[data-theme="light"] .ai-input-wrap {
    background: #f0f7ff !important;
    border: 1.5px solid rgba(2, 132, 199, 0.22) !important;
}

[data-theme="light"] .ai-input-wrap:focus-within {
    border-color: #0284c7 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2) !important;
}

[data-theme="light"] .ai-textarea {
    color: #0f2b48 !important;
}

[data-theme="light"] .ai-textarea::placeholder {
    color: #94a3b8 !important;
}

/* Interactive Action Cards in Light Mode */
[data-theme="light"] .ai-action-card {
    background: #ffffff !important;
    border: 1.5px solid rgba(2, 132, 199, 0.22) !important;
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.12) !important;
}

[data-theme="light"] .ai-action-card-title {
    color: #0f2b48 !important;
}

[data-theme="light"] .ai-action-card-body {
    color: #334155 !important;
}

[data-theme="light"] .ai-action-card-preview {
    background: #f0f7ff !important;
    border: 1px solid rgba(2, 132, 199, 0.16) !important;
    color: #0f2b48 !important;
}

[data-theme="light"] .ai-action-btn-secondary {
    background: rgba(2, 132, 199, 0.08) !important;
    color: #475569 !important;
    border: 1px solid rgba(2, 132, 199, 0.22) !important;
}

[data-theme="light"] .ai-action-btn-secondary:hover {
    background: rgba(2, 132, 199, 0.18) !important;
    color: #0284c7 !important;
}

/* Typing Indicator in Light Mode */
[data-theme="light"] .ai-typing-indicator {
    background: #ffffff !important;
    border: 1px solid rgba(2, 132, 199, 0.18) !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08) !important;
}

