/* ============================================
   INTEGRATED HOME + CHAT LAYOUT
   Full-screen chat with integrated stats and tools
   ============================================ */

/* ============================================
   FULL-SCREEN CHAT LAYOUT
   ============================================ */
.home-fullscreen-chat {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-fullscreen {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.chat-container-full {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 0 16px;
    min-height: 0;
}

/* Full Chat Header */
.chat-header-full {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--theme-border, rgba(148, 163, 184, 0.15));
    flex-shrink: 0;
}

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

.chat-header-full .chat-header-info h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--theme-text-primary, white);
}

.chat-header-full .chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Welcome State with Stats and Tools */
.chat-welcome-full {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 20px;
    text-align: center;
    animation: fade-in 0.3s ease;
}

/* Stats Row in Welcome */
.welcome-stats-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-chip-full {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 18px;
    background: var(--theme-surface, rgba(30, 41, 59, 0.6));
    border: 1px solid var(--theme-border, rgba(148, 163, 184, 0.15));
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 85px;
}

.stat-chip-full:hover {
    background: rgba(var(--theme-accent-rgb), 0.15);
    border-color: var(--theme-primary);
    transform: translateY(-2px);
}

.stat-value-full {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label-full {
    font-size: 0.7rem;
    color: var(--theme-text-secondary, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Tools Section in Welcome */
.welcome-tools-section {
    margin-bottom: 20px;
    width: 100%;
    max-width: 420px;
}

.welcome-tools-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--theme-text-secondary, #94a3b8);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.welcome-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.tool-chip-full {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 10px;
    background: var(--theme-surface, rgba(30, 41, 59, 0.5));
    border: 1px solid var(--theme-border, rgba(148, 163, 184, 0.1));
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-chip-full:hover {
    background: rgba(var(--theme-accent-rgb), 0.1);
    border-color: rgba(var(--theme-primary-rgb), 0.3);
    transform: translateY(-2px);
}

.tool-icon-full {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-icon-full svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.tool-name-full {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--theme-text-primary, white);
}

/* Affirmation in Welcome */
.welcome-affirmation {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 10px;
    margin-bottom: 16px;
    max-width: 420px;
}

.welcome-affirmation svg {
    color: #fbbf24;
    fill: currentColor;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.welcome-affirmation span {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--theme-text-primary, white);
}

/* Welcome Compact (hide header from ChatWelcome) */
.welcome-compact {
    padding-top: 0;
}

.welcome-compact .welcome-icon,
.welcome-compact .welcome-title,
.welcome-compact .welcome-subtitle {
    display: none;
}

/* ============================================
   LIGHT THEME (Cloud) Overrides
   ============================================ */
.theme-cloud .stat-chip-full {
    background: white;
    border-color: rgba(30, 58, 95, 0.1);
}

.theme-cloud .stat-chip-full:hover {
    background: rgba(var(--theme-accent-rgb), 0.05);
}

.theme-cloud .stat-label-full {
    color: #64748b;
}

.theme-cloud .tool-chip-full {
    background: white;
    border-color: rgba(30, 58, 95, 0.1);
}

.theme-cloud .tool-chip-full:hover {
    background: rgba(var(--theme-accent-rgb), 0.05);
}

.theme-cloud .tool-name-full {
    color: #1e3a5f;
}

.theme-cloud .welcome-affirmation {
    background: rgba(251, 191, 36, 0.08);
}

.theme-cloud .welcome-affirmation span {
    color: #1e3a5f;
}

/* Hide scrollbars but keep scroll functionality */
.home-sidebar,
.chat-messages {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.home-sidebar::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

/* ============================================
   SKELETON LOADING STATES
   ============================================ */
.skeleton {
    position: relative;
    overflow: hidden;
    pointer-events: none;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.15) 50%, 
        transparent 100%);
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.skeleton .skeleton-text {
    color: transparent !important;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Chat Avatar */
.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-avatar svg {
    fill: white;
}

/* Icon Button */
.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: var(--theme-surface, rgba(30, 41, 59, 0.5));
    color: var(--theme-text-secondary, #94a3b8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: rgba(var(--theme-accent-rgb), 0.15);
    color: var(--theme-primary-ink, var(--theme-primary));
}

.icon-btn.active {
    background: var(--theme-primary);
    color: white;
}

.icon-btn svg {
    fill: currentColor;
}

/* Provider Select */
.provider-select {
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--theme-surface, rgba(30, 41, 59, 0.5));
    border: 1px solid var(--theme-border, rgba(148, 163, 184, 0.2));
    color: var(--theme-text-primary, white);
    font-size: 0.85rem;
    cursor: pointer;
}

.theme-cloud .provider-select {
    background: white;
    color: #1e3a5f;
}

/* Mobile Responsive for Full-Screen Chat */
@media (max-width: 768px) {
    .chat-container-full {
        padding: 0 12px;
    }
    
    .welcome-stats-row {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat-chip-full {
        min-width: 90px;
        padding: 12px 16px;
    }
    
    .stat-value-full {
        font-size: 1.5rem;
    }
    
    .welcome-tools-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .tool-chip-full {
        padding: 12px 8px;
    }
    
    .tool-icon-full {
        width: 36px;
        height: 36px;
    }
    
    .tool-name-full {
        font-size: 0.7rem;
    }
    
    .chat-welcome-full {
        padding: 20px 12px;
    }
}

.skeleton .skeleton-icon {
    background: rgba(255, 255, 255, 0.1);
}

/* Cloud theme skeleton */
.theme-cloud .skeleton .skeleton-text {
    background: rgba(30, 58, 95, 0.1);
}

.theme-cloud .skeleton .skeleton-icon {
    background: rgba(30, 58, 95, 0.1);
}

.theme-cloud .skeleton::after {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 100%);
}

/* ============================================
   AFFIRMATION CARD
   ============================================ */
.affirmation-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.affirmation-card.clickable {
    cursor: pointer;
}

.affirmation-card.clickable:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.affirmation-icon {
    width: 18px;
    height: 18px;
    color: #fbbf24;
    flex-shrink: 0;
}

.affirmation-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    font-style: italic;
}

/* Light theme (Cloud) */
.theme-cloud .affirmation-card {
    background: rgba(var(--theme-primary-rgb), 0.08);
    border-color: rgba(var(--theme-primary-rgb), 0.15);
}

.theme-cloud .affirmation-card.clickable:hover {
    background: rgba(var(--theme-primary-rgb), 0.12);
    border-color: rgba(var(--theme-primary-rgb), 0.25);
}

.theme-cloud .affirmation-text {
    color: #475569;
}

/* Main Layout Container */
.home-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    height: calc(100vh - 60px); /* Account for header */
    gap: 0;
    position: relative;
    overflow: hidden;
}

/* Left Sidebar - Navigation & Stats */
.home-sidebar {
    background: var(--theme-surface);
    border-right: 1px solid var(--theme-border);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    transition: all 0.3s ease;
    height: 100%;
}

/* Mobile Panel Toggle - only visible on mobile */
.mobile-panel-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
}

.mobile-panel-toggle svg {
    fill: currentColor;
}

/* Compact Hero Section */
.hero-section-compact {
    margin-bottom: 20px;
}

.hero-title-compact {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--theme-text-primary);
}

.search-wrapper-compact {
    margin-bottom: 8px;
}

/* Minimal search box styling for sidebar */
.search-wrapper-compact .unified-search-wrapper {
    max-width: 100%;
}

.search-wrapper-compact .unified-search-container {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: none;
    backdrop-filter: blur(8px);
}

.search-wrapper-compact .unified-search-container.focused {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--theme-accent, rgba(255, 255, 255, 0.3));
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.search-wrapper-compact .unified-search-container.expanded {
    border-radius: 12px 12px 0 0;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.search-wrapper-compact .search-input-wrapper {
    padding: 8px 4px;
}

.search-wrapper-compact .unified-search-input {
    font-size: 1rem;
}

/* Compact Stats */
.quick-stats-section-compact {
    margin-bottom: 20px;
}

.quick-stats-row {
    display: flex;
    gap: 8px;
}

.stat-chip {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: var(--theme-bg-secondary);
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stat-chip:hover {
    background: var(--theme-primary-soft);
    border-color: var(--theme-primary);
    transform: translateY(-2px);
}

.stat-chip .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-primary-ink, var(--theme-primary));
    line-height: 1;
}

.stat-chip .stat-label {
    font-size: 0.7rem;
    color: var(--theme-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Compact Tools Section */
.tools-section-compact {
    margin-bottom: 12px;
}

.section-title-compact {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--theme-text-secondary);
    margin: 0 0 8px;
}

.tools-grid-compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.tool-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: var(--theme-bg-secondary);
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tool-chip-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.tool-chip-icon svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.tool-chip-name {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--theme-text-primary);
    text-align: center;
    line-height: 1.2;
}

/* Compact Categories */
.categories-section-compact {
    margin-bottom: 20px;
}

.categories-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-chip-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--theme-bg-secondary);
    border: 1px solid var(--theme-border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--theme-text-primary);
    transition: all 0.2s ease;
}

.category-chip-compact:hover {
    background: var(--theme-primary-soft);
    border-color: var(--theme-primary);
}

.category-chip-compact svg {
    width: 16px;
    height: 16px;
    fill: var(--theme-primary);
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--theme-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-link-compact {
    font-size: 0.85rem;
    color: var(--theme-primary-ink, var(--theme-primary));
    text-decoration: none;
    font-weight: 500;
}

.dashboard-link-compact:hover {
    text-decoration: underline;
}

/* ============================================
   RIGHT PANEL - CHAT
   ============================================ */
.chat-panel {
    display: flex;
    flex-direction: row;
    background: var(--theme-page-bg);
    min-height: 0;
    position: relative;
    gap: 0;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Conversation Sidebar in Chat Panel */
.chat-panel .conversation-sidebar {
    flex-shrink: 0;
    height: 100%;
    border-radius: 0;
    border-right: 1px solid var(--theme-border);
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
    display: none;
}

/* Chat Header - Integrated Version */
.chat-header-integrated {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--theme-surface);
    border-bottom: 1px solid var(--theme-border);
}

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

/* History Button */
.history-btn {
    position: relative;
}

.history-btn.active {
    background: var(--theme-primary-soft);
}

.history-btn.active svg {
    fill: var(--theme-primary);
}


.chat-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-avatar svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.chat-header-info h2 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    color: var(--theme-text-primary);
}

.provider-badge {
    font-size: 0.65rem;
    color: var(--theme-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.provider-select {
    padding: 6px 12px;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    background: var(--theme-bg-secondary);
    color: var(--theme-text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.provider-select:focus {
    outline: none;
    border-color: var(--theme-primary);
}

.provider-select option {
    background: #1e293b;
    color: #f1f5f9;
    padding: 8px 12px;
}

.provider-select option:hover,
.provider-select option:checked {
    background: #334155;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--theme-bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--theme-primary-soft);
}

.icon-btn svg {
    fill: var(--theme-text-secondary);
}

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

/* ============================================
   CHAT MESSAGE BUBBLES
   ============================================ */
.message-wrapper {
    display: flex;
    gap: 12px;
    max-width: 100%;
    animation: messageSlideIn 0.3s ease;
    transition: transform 0.2s ease;
}

.message-wrapper:hover {
    transform: translateX(2px);
}

.message-wrapper.user:hover {
    transform: translateX(-2px);
}

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

.message-wrapper.user {
    margin-left: auto;
    flex-direction: row-reverse;
    max-width: 80%;
}

.message-wrapper.assistant {
    margin-right: auto;
    max-width: 95%;
}

/* Show message actions on hover */
.message-wrapper.assistant:hover .message-actions .message-action-btn {
    opacity: 1;
}

.avatar-container {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.assistant-avatar {
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
    color: white;
}

.entity-avatar {
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.user-avatar {
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
}

.message-sender {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--theme-text-secondary);
    padding-left: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Read Aloud Button on Messages */
.read-aloud-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(var(--theme-accent-rgb), 0.1);
    border-radius: 50%;
    cursor: pointer;
    color: var(--theme-primary-ink, var(--theme-primary));
    transition: all 0.2s ease;
    margin-left: auto;
    opacity: 0.7;
}

.read-aloud-btn:hover {
    background: rgba(var(--theme-accent-rgb), 0.2);
    opacity: 1;
    transform: scale(1.1);
}

.read-aloud-btn.reading {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    animation: pulse-speaking 1s ease-in-out infinite;
}

.read-aloud-btn.reading .speaking-icon {
    animation: speaker-pulse 0.5s ease-in-out infinite;
}

@keyframes pulse-speaking {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% { 
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
}

@keyframes speaker-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.85); }
}

/* Message Action Buttons Container */
.message-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.message-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.message-action-btn:hover {
    background: rgba(var(--theme-accent-rgb), 0.1);
    color: var(--theme-primary-ink, var(--theme-primary));
    opacity: 1;
}

.message-action-btn.active {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    opacity: 1;
    animation: pulse-speaking 1s ease-in-out infinite;
}

.message-action-btn.active .speaking-icon {
    animation: speaker-pulse 0.5s ease-in-out infinite;
}

.message-action-btn.copied {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    opacity: 1;
}

/* Reaction buttons */
.message-action-btn.reaction-btn {
    opacity: 0.4;
}

.message-action-btn.reaction-btn:hover {
    opacity: 1;
}

.message-action-btn.reaction-btn.reacted {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    opacity: 1;
}

.message-action-btn.reaction-btn.reacted.negative {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.message-bubble {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 0.9375rem;
    line-height: 1.6;
    word-wrap: break-word;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    position: relative;
}

.user-bubble {
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 16px rgba(var(--theme-accent-rgb), 0.25);
}

.assistant-bubble {
    background: var(--theme-surface, white);
    color: var(--theme-text-primary, #1e293b);
    border: 1px solid var(--theme-border, #e2e8f0);
    border-bottom-left-radius: 6px;
    backdrop-filter: blur(8px);
}

/* Message Footer - Time + Credits */
.message-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 4px;
}

.message-time {
    font-size: 0.7rem;
    color: var(--theme-text-muted, #94a3b8);
}

/* Credits Badge */
.credits-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 500;
}

.credits-badge svg {
    flex-shrink: 0;
}

.credits-badge.free {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

/* Dark theme credits badge */
.theme-space .credits-badge,
.theme-winter .credits-badge,
.theme-nature .credits-badge,
.theme-ocean .credits-badge {
    background: rgba(245, 158, 11, 0.2);
}

.theme-space .credits-badge.free,
.theme-winter .credits-badge.free,
.theme-nature .credits-badge.free,
.theme-ocean .credits-badge.free {
    background: rgba(34, 197, 94, 0.2);
}

/* Model Badge - Shows which AI model generated the response */
.model-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(var(--theme-accent-rgb), 0.1);
    color: var(--theme-primary-ink, var(--theme-primary));
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Dark theme model badge */
.theme-space .model-badge,
.theme-winter .model-badge,
.theme-nature .model-badge,
.theme-ocean .model-badge {
    background: rgba(var(--theme-accent-rgb), 0.2);
    color: var(--theme-accent);
}

/* Response Time Badge - Shows how fast the AI responded */
.response-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Dark theme response time badge */
.theme-space .response-time-badge,
.theme-winter .response-time-badge,
.theme-nature .response-time-badge,
.theme-ocean .response-time-badge {
    background: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
}

/* Fast response (< 1s) gets a subtle highlight */
.response-time-badge.fast {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.theme-space .response-time-badge.fast,
.theme-winter .response-time-badge.fast,
.theme-nature .response-time-badge.fast,
.theme-ocean .response-time-badge.fast {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.message-text {
    white-space: pre-wrap;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 16px 20px !important;
    min-width: 70px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

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

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

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Image Message */
.image-message {
    position: relative;
}

.image-message img {
    max-width: 100%;
    border-radius: 12px;
    display: block;
}

.image-action {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.image-message:hover .image-action {
    opacity: 1;
}

/* Image Footer with model badge */
.image-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px 0;
}

.image-model-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(var(--theme-accent-rgb), 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

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

.image-footer .image-action {
    position: static;
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.1);
}

.image-footer .image-action:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

/* Image Prompt Display */
.image-prompt {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    line-height: 1.4;
}

.image-prompt .prompt-label {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    margin-right: 4px;
}

.image-prompt .prompt-text {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

/* Light theme adjustments */
.theme-cloud .image-prompt {
    background: rgba(0, 0, 0, 0.05);
    border-top-color: rgba(0, 0, 0, 0.1);
}

.theme-cloud .image-prompt .prompt-label {
    color: #64748b;
}

.theme-cloud .image-prompt .prompt-text {
    color: #475569;
}

.theme-cloud .image-model-badge {
    color: var(--theme-primary-ink, var(--theme-primary));
    background: rgba(var(--theme-accent-rgb), 0.15);
}

.theme-cloud .image-footer .image-action {
    background: rgba(0, 0, 0, 0.1);
    color: #475569;
}

/* Image Error Placeholder */
.image-error-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: var(--theme-surface-secondary, #f1f5f9);
    border: 2px dashed var(--theme-border, #e2e8f0);
    border-radius: 12px;
    text-align: center;
    min-width: 200px;
    min-height: 150px;
    gap: 8px;
    color: var(--theme-text-muted, #94a3b8);
}

.error-icon {
    color: var(--theme-text-muted, #94a3b8);
    fill: currentColor;
}

.error-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--theme-text-secondary, #64748b);
}

.error-desc {
    font-size: 0.8rem;
}

/* JSON Message */
.json-message {
    background: #1e1e1e;
    border-radius: 12px;
    overflow: hidden;
}

.json-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #2d2d2d;
    color: #9cdcfe;
    font-size: 0.75rem;
    font-weight: 600;
}

.json-header svg {
    fill: currentColor;
}

.copy-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: #9cdcfe;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.copy-btn svg {
    fill: currentColor;
}

.json-message pre {
    margin: 0;
    padding: 14px;
    overflow-x: auto;
    font-size: 0.8rem;
    line-height: 1.5;
}

.json-message code {
    color: #ce9178;
    font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
}

/* Dark Theme Chat Adjustments */
.theme-space .assistant-bubble,
.theme-winter .assistant-bubble,
.theme-nature .assistant-bubble,
.theme-ocean .assistant-bubble {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

.theme-space .image-error-placeholder,
.theme-winter .image-error-placeholder,
.theme-nature .image-error-placeholder,
.theme-ocean .image-error-placeholder {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Cloud Theme Chat Adjustments */
.theme-cloud .assistant-bubble {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(30, 58, 95, 0.1);
    color: #1e293b;
    box-shadow: 0 2px 12px rgba(30, 58, 95, 0.08);
}

.theme-cloud .message-sender {
    color: #475569;
}

.theme-cloud .image-error-placeholder {
    background: rgba(241, 245, 249, 0.9);
    border-color: rgba(30, 58, 95, 0.15);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 900px) {
    .home-layout {
        grid-template-columns: 1fr;
        height: calc(100vh - 60px);
    }
    
    /* On mobile, show either sidebar OR chat based on toggle */
    .home-sidebar {
        display: none;
        height: 100%;
    }
    
    .home-sidebar.mobile-visible {
        display: flex;
    }
    
    .chat-panel {
        display: flex;
        height: 100%;
    }
    
    .chat-panel.mobile-hidden {
        display: none;
    }
    
    .mobile-panel-toggle {
        display: flex;
    }
    
    /* Mobile Chat History Sidebar */
    .sidebar-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 100;
        animation: fadeIn 0.2s ease;
    }
    
    .conversation-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 101;
        border-radius: 0 16px 16px 0;
        max-width: 85vw;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

@media (max-width: 480px) {
    .tools-grid-compact {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-stats-row {
        flex-wrap: wrap;
    }
    
    .stat-chip {
        flex: 1 1 calc(33% - 8px);
        min-width: 80px;
    }
}

/* ============================================
   DARK THEME ADJUSTMENTS
   ============================================ */
.theme-space .home-sidebar,
.theme-winter .home-sidebar,
.theme-nature .home-sidebar,
.theme-ocean .home-sidebar {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(12px);
}

.theme-space .chat-header-integrated,
.theme-winter .chat-header-integrated,
.theme-nature .chat-header-integrated,
.theme-ocean .chat-header-integrated {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(12px);
}

/* Dark theme for conversation sidebar */
.theme-space .conversation-sidebar,
.theme-winter .conversation-sidebar,
.theme-nature .conversation-sidebar,
.theme-ocean .conversation-sidebar {
    background: rgba(30, 41, 59, 0.98);
    border-color: rgba(255, 255, 255, 0.1);
}

.theme-space .sidebar-header,
.theme-winter .sidebar-header,
.theme-nature .sidebar-header,
.theme-ocean .sidebar-header {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

.theme-space .sidebar-title,
.theme-winter .sidebar-title,
.theme-nature .sidebar-title,
.theme-ocean .sidebar-title {
    color: #f1f5f9;
}

.theme-space .sidebar-btn,
.theme-winter .sidebar-btn,
.theme-nature .sidebar-btn,
.theme-ocean .sidebar-btn {
    color: #94a3b8;
}

.theme-space .sidebar-btn:hover,
.theme-winter .sidebar-btn:hover,
.theme-nature .sidebar-btn:hover,
.theme-ocean .sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

.theme-space .conversation-item,
.theme-winter .conversation-item,
.theme-nature .conversation-item,
.theme-ocean .conversation-item {
    border-color: rgba(255, 255, 255, 0.05);
}

.theme-space .conversation-item:hover,
.theme-winter .conversation-item:hover,
.theme-nature .conversation-item:hover,
.theme-ocean .conversation-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.theme-space .conversation-item.active,
.theme-winter .conversation-item.active,
.theme-nature .conversation-item.active,
.theme-ocean .conversation-item.active {
    background: rgba(var(--theme-accent-rgb), 0.15);
    border-color: rgba(var(--theme-accent-rgb), 0.3);
}

.theme-space .conversation-title,
.theme-winter .conversation-title,
.theme-nature .conversation-title,
.theme-ocean .conversation-title {
    color: #f1f5f9;
}

.theme-space .conversation-date,
.theme-winter .conversation-date,
.theme-nature .conversation-date,
.theme-ocean .conversation-date {
    color: #94a3b8;
}

.theme-space .sidebar-usage,
.theme-winter .sidebar-usage,
.theme-nature .sidebar-usage,
.theme-ocean .sidebar-usage {
    border-color: rgba(255, 255, 255, 0.1);
}

.theme-space .stat-chip,
.theme-space .tool-chip,
.theme-space .category-chip-compact,
.theme-winter .stat-chip,
.theme-winter .tool-chip,
.theme-winter .category-chip-compact,
.theme-nature .stat-chip,
.theme-nature .tool-chip,
.theme-nature .category-chip-compact,
.theme-ocean .stat-chip,
.theme-ocean .tool-chip,
.theme-ocean .category-chip-compact {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.theme-space .stat-chip:hover,
.theme-space .tool-chip:hover,
.theme-space .category-chip-compact:hover,
.theme-winter .stat-chip:hover,
.theme-winter .tool-chip:hover,
.theme-winter .category-chip-compact:hover,
.theme-nature .stat-chip:hover,
.theme-nature .tool-chip:hover,
.theme-nature .category-chip-compact:hover,
.theme-ocean .stat-chip:hover,
.theme-ocean .tool-chip:hover,
.theme-ocean .category-chip-compact:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   ☁️ CLOUD THEME - Light Mode Contrast Fixes
   Enhanced text visibility on light backgrounds
   ============================================ */
.theme-cloud .home-sidebar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    border-right: 1px solid rgba(30, 58, 95, 0.12);
}

.theme-cloud .section-title-compact {
    color: #1e3a5f;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Tool Chips - Solid backgrounds for better visibility */
.theme-cloud .tool-chip {
    background: #ffffff;
    border: 1px solid rgba(30, 58, 95, 0.2);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.1);
}

.theme-cloud .tool-chip:hover {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.theme-cloud .tool-chip-name {
    color: #1e293b;
    font-weight: 600;
}

/* Stat Chips - Solid backgrounds for better visibility */
.theme-cloud .stat-chip {
    background: #ffffff;
    border: 1px solid rgba(30, 58, 95, 0.2);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.1);
}

.theme-cloud .stat-chip:hover {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.theme-cloud .stat-chip .stat-value {
    color: #1e3a5f;
    font-weight: 800;
    text-shadow: none;
}

.theme-cloud .stat-chip .stat-label {
    color: #475569;
    font-weight: 600;
}

.theme-cloud .category-chip-compact {
    background: #ffffff;
    border: 1px solid rgba(30, 58, 95, 0.2);
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.1);
}

.theme-cloud .category-chip-compact:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

.theme-cloud .affirmation-card {
    background: #ffffff;
    border: 1px solid rgba(30, 58, 95, 0.15);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.08);
}

.theme-cloud .affirmation-text {
    color: #334155;
}

.theme-cloud .hero-title-compact {
    color: #1e3a5f;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
}

.theme-cloud .gradient-text {
    background: linear-gradient(135deg, var(--theme-primary-hover), var(--theme-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

/* UnifiedSearchBar Cloud-theme override block retired 2026-04 along with the
   UnifiedSearchBar/Overlay components themselves. Ctrl+K now opens the FAB
   chat (see Pages/Shared/Assistant.razor) which has its own theme handling.
   See DECISIONS.md → "2026-04: UnifiedSearch retirement + Ctrl+K → FAB chat". */

/* ============================================
   ☁️ CLOUD THEME - Chat Panel Readability
   Enhanced contrast for chat header and panel
   ============================================ */
.theme-cloud .chat-panel {
    background: linear-gradient(180deg, rgba(224, 242, 254, 0.5) 0%, rgba(186, 230, 253, 0.3) 100%);
}

.theme-cloud .chat-header-integrated {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(30, 58, 95, 0.15);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.06);
}

.theme-cloud .chat-header-info h2 {
    color: #1e293b;
    font-weight: 700;
}

.theme-cloud .provider-badge {
    color: #3b82f6;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.theme-cloud .provider-select {
    background: #ffffff;
    border-color: rgba(30, 58, 95, 0.2);
    color: #1e293b;
    font-weight: 500;
}

.theme-cloud .provider-select:focus {
    border-color: #3b82f6;
}

.theme-cloud .icon-btn {
    background: #ffffff;
    border: 1px solid rgba(30, 58, 95, 0.15);
}

.theme-cloud .icon-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

.theme-cloud .icon-btn svg {
    fill: #475569;
}

/* Chat messages area background */
.theme-cloud .chat-messages {
    background: transparent;
}

/* ============================================
   🔮 MYSTIC THEME - Enhanced Readability
   Improved contrast and font styling for 
   better visibility on dark purple backgrounds
   ============================================ */

/* Sidebar Background */
.theme-mystic .home-sidebar {
    background: rgba(26, 10, 46, 0.95);
    backdrop-filter: blur(16px);
    border-right: 1px solid rgba(249, 115, 22, 0.2);
}

/* Hero Title - Larger, bolder, better contrast */
.theme-mystic .hero-title-compact {
    font-size: 1.35rem;
    font-weight: 700;
    color: #faf5ff;
    text-shadow: 0 2px 12px rgba(249, 115, 22, 0.3);
    letter-spacing: -0.01em;
}

/* Gradient text - Orange/gold magical glow */
.theme-mystic .gradient-text {
    background: linear-gradient(135deg, #f97316 0%, #fbbf24 50%, #f97316 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.4));
}

/* Stats Section */
.theme-mystic .stat-chip {
    background: rgba(45, 27, 78, 0.8);
    border: 1px solid rgba(249, 115, 22, 0.25);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.theme-mystic .stat-chip:hover {
    background: rgba(60, 35, 100, 0.9);
    border-color: rgba(249, 115, 22, 0.5);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.2);
    transform: translateY(-3px);
}

.theme-mystic .stat-chip .stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #f97316;
    text-shadow: 0 0 20px rgba(249, 115, 22, 0.5);
}

.theme-mystic .stat-chip .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #e9d5ff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 1;
}

/* Section Titles */
.theme-mystic .section-title-compact {
    font-size: 0.75rem;
    font-weight: 700;
    color: #c4b5fd;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 12px rgba(196, 181, 253, 0.3);
}

/* Tool Chips */
.theme-mystic .tool-chip {
    background: rgba(45, 27, 78, 0.8);
    border: 1px solid rgba(124, 58, 237, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.theme-mystic .tool-chip:hover {
    background: rgba(60, 35, 100, 0.9);
    border-color: rgba(249, 115, 22, 0.5);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.2);
    transform: translateY(-2px);
}

.theme-mystic .tool-chip-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: #faf5ff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Affirmation Card */
.theme-mystic .affirmation-card {
    background: rgba(45, 27, 78, 0.7);
    border: 1px solid rgba(249, 115, 22, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.theme-mystic .affirmation-card.clickable:hover {
    background: rgba(60, 35, 100, 0.8);
    border-color: rgba(249, 115, 22, 0.4);
}

.theme-mystic .affirmation-text {
    font-size: 0.9rem;
    color: #e9d5ff;
    font-weight: 500;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Chat Header */
.theme-mystic .chat-header-integrated {
    background: rgba(26, 10, 46, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(249, 115, 22, 0.2);
}

.theme-mystic .chat-header-info h2 {
    color: #faf5ff;
    font-weight: 600;
}

.theme-mystic .provider-badge {
    color: #c4b5fd;
}

/* Chat Avatar */
.theme-mystic .chat-avatar {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 0 16px rgba(249, 115, 22, 0.4);
}

/* Provider Select */
.theme-mystic .provider-select {
    background: rgba(45, 27, 78, 0.8);
    border-color: rgba(124, 58, 237, 0.3);
    color: #faf5ff;
}

.theme-mystic .provider-select:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

/* Icon Buttons */
.theme-mystic .icon-btn {
    background: rgba(45, 27, 78, 0.8);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.theme-mystic .icon-btn:hover {
    background: rgba(249, 115, 22, 0.2);
    border-color: rgba(249, 115, 22, 0.4);
}

.theme-mystic .icon-btn svg {
    fill: #c4b5fd;
}

.theme-mystic .icon-btn:hover svg {
    fill: #f97316;
}

/* Assistant Chat Bubble */
.theme-mystic .assistant-bubble {
    background: rgba(45, 27, 78, 0.9);
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: #faf5ff;
}

/* Search wrapper adjustments */
.theme-mystic .search-wrapper-compact .unified-search-container {
    background: rgba(45, 27, 78, 0.8);
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.theme-mystic .search-wrapper-compact .unified-search-container.focused {
    background: rgba(60, 35, 100, 0.9);
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.theme-mystic .unified-search-input {
    color: #faf5ff;
}

.theme-mystic .unified-search-input::placeholder {
    color: #a78bfa;
}

/* Mobile Toggle Button */
.theme-mystic .mobile-panel-toggle {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3);
}

.theme-mystic .mobile-panel-toggle:hover {
    box-shadow: 0 6px 24px rgba(249, 115, 22, 0.5);
}

/* ============================================
   AI ESCALATION PROMPT (Chat Panel)
   Shown when RAG confidence is low
   ============================================ */
.ai-escalation-prompt-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px;
    margin: 16px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 16px;
    animation: fade-in 0.3s ease;
}

.ai-escalation-prompt-chat .prompt-icon {
    color: #f59e0b;
}

.ai-escalation-prompt-chat .prompt-icon svg {
    fill: currentColor;
}

.ai-escalation-prompt-chat .prompt-content {
    text-align: center;
}

.ai-escalation-prompt-chat .prompt-title {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--theme-text-primary, #1e3a5f);
}

.ai-escalation-prompt-chat .prompt-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: var(--theme-text-secondary, #64748b);
}

.ai-escalation-prompt-chat .prompt-actions {
    display: flex;
    gap: 12px;
}

.ai-escalation-prompt-chat .btn-ai-yes {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-escalation-prompt-chat .btn-ai-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--theme-accent-rgb), 0.4);
}

.ai-escalation-prompt-chat .btn-ai-yes svg {
    fill: currentColor;
}

.ai-escalation-prompt-chat .btn-ai-no {
    padding: 10px 20px;
    background: transparent;
    color: var(--theme-text-secondary, #64748b);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.25);
    border-radius: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-escalation-prompt-chat .btn-ai-no:hover {
    background: rgba(var(--theme-accent-rgb), 0.05);
    border-color: rgba(var(--theme-accent-rgb), 0.4);
}

/* Dark theme variants for AI escalation prompt */
.theme-space .ai-escalation-prompt-chat,
.theme-winter .ai-escalation-prompt-chat,
.theme-nature .ai-escalation-prompt-chat,
.theme-ocean .ai-escalation-prompt-chat,
.theme-mystic .ai-escalation-prompt-chat,
.theme-tron .ai-escalation-prompt-chat {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(245, 158, 11, 0.06));
    border-color: rgba(251, 191, 36, 0.2);
}

.theme-space .ai-escalation-prompt-chat .prompt-title,
.theme-winter .ai-escalation-prompt-chat .prompt-title,
.theme-nature .ai-escalation-prompt-chat .prompt-title,
.theme-ocean .ai-escalation-prompt-chat .prompt-title,
.theme-mystic .ai-escalation-prompt-chat .prompt-title,
.theme-tron .ai-escalation-prompt-chat .prompt-title {
    color: var(--theme-text-primary, white);
}

.theme-space .ai-escalation-prompt-chat .btn-ai-no,
.theme-winter .ai-escalation-prompt-chat .btn-ai-no,
.theme-nature .ai-escalation-prompt-chat .btn-ai-no,
.theme-ocean .ai-escalation-prompt-chat .btn-ai-no,
.theme-mystic .ai-escalation-prompt-chat .btn-ai-no,
.theme-tron .ai-escalation-prompt-chat .btn-ai-no {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--theme-text-secondary, #94a3b8);
}

.theme-space .ai-escalation-prompt-chat .btn-ai-no:hover,
.theme-winter .ai-escalation-prompt-chat .btn-ai-no:hover,
.theme-nature .ai-escalation-prompt-chat .btn-ai-no:hover,
.theme-ocean .ai-escalation-prompt-chat .btn-ai-no:hover,
.theme-mystic .ai-escalation-prompt-chat .btn-ai-no:hover,
.theme-tron .ai-escalation-prompt-chat .btn-ai-no:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   SOURCE BADGES (Chat Messages)
   ============================================ */
.message-sender .source-badge {
    margin-left: 6px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.message-sender .source-badge.knowledge {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.12));
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.message-sender .source-badge.ai {
    background: linear-gradient(135deg, rgba(var(--theme-accent-rgb), 0.15), rgba(219, 39, 119, 0.12));
    color: var(--theme-accent);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.25);
}
