* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light theme (default - matching Lumo.AI design) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fc;
    --bg-tertiary: #ffffff;
    --bg-sidebar: #f8f9fc;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --border-light: #f0f0f5;
    --accent-color: #5C55FB;
    --accent-light: #7f63ed;
    --accent-gradient: linear-gradient(135deg, #5C55FB 0%, #6555fb 50%, #9b8ef7 100%);
    --hover-color: #f3f4f6;
    --user-bubble-bg: linear-gradient(135deg, #5C55FB 0%, #8B5CF6 100%);
    --user-bubble-text: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* Dark theme */
body.dark-theme {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16162a;
    --bg-sidebar: #1a1a2e;
    --bg-card: #1e1e32;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;
    --border-color: #2d2d44;
    --border-light: #252540;
    --hover-color: #252540;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.5;
}

/* ============================================
   LOGIN PAGE - Style Lumo.AI
   ============================================ */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
    animation: gradientMove 20s ease-in-out infinite;
}

@keyframes gradientMove {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-5%, -5%); }
}

.login-box {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border-light);
    position: relative;
    z-index: 1;
}

.login-box h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-box .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.error {
    color: #ef4444;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.85rem;
}

/* ============================================
   CHAT CONTAINER - Layout Principal
   ============================================ */
.chat-container {
    display: flex;
    height: 100vh;
    background: var(--bg-primary);
}

/* ============================================
   SIDEBAR - Style Lumo.AI
   ============================================ */
.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-light);
    padding: 0;
}

/* Logo Header */
.sidebar-logo {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
}

.sidebar-logo span {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-header {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Navigation Menu */
.sidebar-nav {
    padding: 1rem 0.75rem;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.875rem;
    text-decoration: none;
    margin: 5px 0;
}

.nav-item:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgb(92 85 251 / 10%);
    color: var(--accent-color);
    
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active svg {
    opacity: 1;
}

/* Theme Toggle - Pill Style */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    padding: 4px;
    gap: 0;
    border: 1px solid var(--border-color);
}

.theme-option {
    flex: 1;
}

.theme-toggle .theme-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
    gap: 0.375rem;
}

.theme-option.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.theme-option svg {
    width: 14px;
    height: 14px;
}

/* New Chat Button */
.btn-new-chat {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.btn-new-chat:hover {
    border-color: var(--accent-color);
    background: rgba(124, 58, 237, 0.05);
}

.btn-new-chat .icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    color: white;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

/* Conversations List */
.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
}

.conversation-item {
    padding: 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: all 0.15s ease;
    position: relative;
}

.conversation-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversation-item:hover {
    background: var(--hover-color);
}

.conversation-item.active {
    background: rgba(124, 58, 237, 0.1);
}

.conversation-item.active .conversation-title {
    color: var(--accent-color);
    font-weight: 500;
}

.conversation-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.conversation-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.btn-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    opacity: 0;
    transition: all 0.15s ease;
    border-radius: 4px;
}

.conversation-item:hover .btn-delete {
    opacity: 1;
}

.btn-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.username {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.btn-logout svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   MAIN CHAT AREA
   ============================================ */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
    position: relative;
}

/* Bouton menu mobile (caché par défaut) */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 100;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.mobile-menu-btn:hover {
    background: var(--bg-secondary);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.mobile-menu-btn svg {
    width: 22px;
    height: 22px;
    color: var(--text-primary);
}

/* Overlay sidebar (caché par défaut) */
.sidebar-overlay {
    display: none;
}

/* Top Header Bar */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-primary);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 0.5rem 1rem;
    width: 300px;
}

.search-bar input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.875rem;
    width: 100%;
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.btn-premium {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--accent-color);
    border-radius: var(--radius-full);
    color: var(--accent-color);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-premium:hover {
    background: rgba(124, 58, 237, 0.1);
}

.btn-premium svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   WELCOME SCREEN - Style Lumo.AI
   ============================================ */
.welcome-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
    position: relative;
}

.welcome-avatar {
    width: 200px;
    height: 200px;
    filter: drop-shadow(0 8px 32px rgba(124, 58, 237, 0.25));
    margin-bottom: 1.5rem;

    transition: transform 0.3s ease;
}

.welcome-avatar:hover {
    transform: scale(1.05);
}

.welcome-screen h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-screen h1 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-screen > p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

/* Quick Actions Cards */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    max-width: 600px;
}

.quick-action-card {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.quick-action-card:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.quick-action-card svg {
    width: 18px;
    height: 18px;
    color: var(--accent-color);
}

.quick-action-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(92 85 251 / 10%);
    border-radius: 6px;
    color: var(--accent-color);
    font-size: 12px;
}

/* ============================================
   CHAT AREA & MESSAGES
   ============================================ */
.chat-area {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.5rem;
}

.message {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    max-width: 800px;
    margin: 0 auto 1rem;
    width: 100%;
}

/* Assistant Message */
.message.assistant {
    flex-direction: row;
    align-items: flex-start;
}

.message.assistant .message-avatar {
width: 40px;
    height: 40px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    /* background: var(--accent-gradient); */
    /* box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25); */
    margin-top: 18px;
}

.message-avatar .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message.assistant .message-content {
    flex: 1;
    line-height: 1.7;
    padding: 0.75rem 0;
}

.message.assistant .message-text {
    background: var(--bg-secondary);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    border-top-left-radius: 4px;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.message-content ul {
    list-style: none;
    padding-left: 1.5em;
}

.message-content ul li {
    position: relative;
    margin-bottom: 0.4em;
}

.message-content ul li::before {
    content: '';
    position: absolute;
    left: -1.2em;
    top: 0.55em;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid var(--accent-color);
    border-radius: 1px;
}

/* User Message */
.message.user {
    flex-direction: row-reverse;
    align-items: flex-start;
}

.message.user .message-avatar {
    display: none;
}

.message.user .message-content {
    max-width: 70%;
    margin-left: auto;
}

.message.user .message-text {
    background: var(--user-bubble-bg);
    color: var(--user-bubble-text);
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-lg);
    border-top-right-radius: 4px;
    display: inline-block;
    max-width: 100%;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.message-text {
     white-space: normal; 
    word-wrap: break-word;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 0.375rem;
    padding: 0.75rem 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: typing 1.4s infinite;
    opacity: 0.6;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: scale(0.8);
        opacity: 0.4;
    }
    30% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   INPUT AREA - Style Lumo.AI
   ============================================ */
.input-area {
    padding: 1.25rem 2rem 2rem;
    background: var(--bg-primary);
}

.input-area form {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Row with textarea and send button */
.input-row {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    width: 100%;
}

.input-area textarea {
    flex: 1;
    padding: 0.5rem 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: none;
    font-family: inherit;
    max-height: 150px;
    overflow-y: auto;
    line-height: 1.5;
}

.input-area textarea:focus {
    outline: none;
}

.input-area textarea::placeholder {
    color: var(--text-muted);
}

/* Input Actions - Now below the textarea */
.input-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.input-action-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.input-action-btn:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.input-action-btn svg {
    width: 16px;
    height: 16px;
}

.btn-send {
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

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

.btn-send svg {
    width: 18px;
    height: 18px;
}

.icon-send {
    display: none;
}

/* ============================================
   RECENT PROMPTS SIDEBAR
   ============================================ */
.recent-prompts-panel {
    width: 280px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-light);
    padding: 1.5rem;
    overflow-y: auto;
    display: none; /* Hidden by default, can be toggled */
}

.recent-prompts-panel.visible {
    display: block;
}

.recent-prompts-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recent-prompts-title svg {
    width: 16px;
    height: 16px;
    color: var(--accent-color);
}

.recent-prompt-item {
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.recent-prompt-item:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-sm);
}

.recent-prompt-item h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    line-height: 1.4;
}

.recent-prompt-item p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .recent-prompts-panel {
        display: none !important;
    }
}

@media (max-width: 768px) {
    /* Container mobile : on garde le flex mais on gère le slide */
    .chat-container {
        position: relative;
        overflow-x: hidden;
        display: flex;
    }

    /* Sidebar mobile : slide depuis la gauche */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
    }

    /* Overlay sombre quand sidebar ouverte */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.visible {
        display: block;
        opacity: 1;
    }

    /* Chat main prend toute la largeur */
    .chat-main {
        width: 100%;
        min-width: 100%;
    }

    /* Bouton hamburger visible en mobile */
    .mobile-menu-btn {
        display: flex !important;
    }

    /* Cacher le texte des boutons d'action en mobile */
    .input-action-btn .btn-label {
        display: none;
    }

    .message {
        padding: 0.75rem;
    }

    .input-area {
        padding: 1rem;
    }

    .welcome-screen h1 {
        font-size: 2rem;
    }

    .quick-actions {
        flex-direction: column;
        align-items: center;
    }

    .search-bar {
        width: 100%;
        max-width: 200px;
    }
}

/* ============================================
   DATA COMPONENTS (compatibility)
   ============================================ */
.message.has-data .message-content,
.message.has-chart .message-content {
    max-width: 100%;
}

.message-data {
    width: 100%;
}

/* ============================================
   MARKDOWN STYLES
   ============================================ */
.message-text h1,
.message-text h2,
.message-text h3,
.message-text h4,
.message-text h5,
.message-text h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

.message-text h1 {
    font-size: 1.75em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.3em;
}

.message-text h2 {
    font-size: 1.5em;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.3em;
}

.message-text h3 {
    font-size: 1.25em;
}

.message-text h4 {
    font-size: 1.1em;
}

.message-text h5,
.message-text h6 {
    font-size: 1em;
}

.message-text p {
    margin-bottom: 1em;
    line-height: 1.6;
}

.message-text strong {
    font-weight: 600;
    color: var(--text-primary);
}

.message-text em {
    font-style: italic;
}

.message-text ul,
.message-text ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

.message-text ul {
    list-style: none;
}

.message-text ol {
    list-style-type: decimal;
}

.message-text li {
    margin-bottom: 0.5em;
    line-height: 1.6;
}

.message-text li > p {
    margin-bottom: 0.5em;
}

.message-text blockquote {
    margin: 1em 0;
    padding: 0.75em 1em;
    border-left: 4px solid var(--accent-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.message-text code {
    padding: 0.2em 0.4em;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.9em;
}

.message-text pre {
    margin: 1em 0;
    padding: 1em;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.message-text pre code {
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.message-text a {
    color: var(--accent-color);
    text-decoration: none;
}

.message-text a:hover {
    text-decoration: underline;
}

.message-text hr {
    margin: 2em 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

.message-text table {
    width: 100%;
    margin: 1em 0;
    border-collapse: collapse;
}

.message-text table th,
.message-text table td {
    padding: 0.75em;
    border: 1px solid var(--border-color);
    text-align: left;
}

.message-text table th {
    background: var(--bg-secondary);
    font-weight: 600;
}

/* Premier élément sans marge top */
.message-text > *:first-child {
    margin-top: 0;
}

/* Dernier élément sans marge bottom */
.message-text > *:last-child {
    margin-bottom: 0;
}

/* ==============================================
   RIGHT SIDEBAR - Recent Conversations
   ============================================== */
.sidebar-right {
    width: 300px;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-right-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-right-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.conversation-count {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.recent-conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.conversation-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.conversation-item:hover {
    background: var(--hover-color);
    border-color: var(--border-color);
}

.conversation-item.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.conversation-item.active .conversation-title,
.conversation-item.active .conversation-snippet,
.conversation-item.active .conversation-time {
    color: white !important;
}

.conversation-preview {
    margin-bottom: 0.5rem;
}

.conversation-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-snippet {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.conversation-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.875rem;
}


/* ==============================================
   CHAT PAGE STYLES
   ============================================== */
.chat-page {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ==============================================
   CONVERSATIONS PAGE STYLES
   ============================================== */
.conversations-page {
    padding: 2rem;
    height: 100%;
    overflow-y: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-count {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.btn-new-conversation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-new-conversation:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

.btn-new-conversation svg {
    width: 18px;
    height: 18px;
}

.page-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    flex: 1;
    max-width: 400px;
}

.search-box svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-box input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.875rem;
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.sort-buttons {
    display: flex;
    gap: 0.5rem;
}

.sort-buttons button {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sort-buttons button:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.sort-buttons button.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.sort-buttons button svg {
    width: 14px;
    height: 14px;
}

.conversations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.conversation-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.conversation-card:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.conversation-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.conversation-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.conversation-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.btn-delete-conv {
    background: transparent;
    border: none;
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
}

.conversation-card:hover .btn-delete-conv {
    opacity: 1;
}

.btn-delete-conv:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.btn-delete-conv svg {
    width: 16px;
    height: 16px;
}

.conversation-card-body {
    margin-bottom: 1rem;
}

.conversation-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.conversation-card-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.conversation-card-created {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.empty-state-large {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-state-large svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

.empty-state-large h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.empty-state-large p {
    font-size: 0.9rem;
    margin: 0 0 1.5rem 0;
}

/* ==============================================
   USERS PAGE STYLES
   ============================================== */
.users-page {
    padding: 2rem;
    height: 100%;
    overflow-y: auto;
}

.admin-content {
    max-width: 1200px;
    margin: 0 auto;
}

.access-denied {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
}

.access-denied h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.access-denied p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.users-table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th {
    background: var(--bg-secondary);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.users-table td {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin {
    background: #10b981;
    color: white;
}

.badge-user {
    background: #6b7280;
    color: white;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit, .btn-delete {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-edit {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-edit:hover {
    background: var(--accent-color);
    color: white;
}

.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.btn-delete:hover {
    background: #ef4444;
    color: white;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.success-message {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-secondary:hover {
    background: var(--hover-color);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-wrapper label {
    cursor: pointer;
}

/* ==============================================
   SETTINGS PAGE STYLES
   ============================================== */
.settings-page {
    padding: 2rem;
    height: 100%;
    overflow-y: auto;
}

.settings-sections {
    max-width: 700px;
    margin: 0 auto;
}

.settings-section {
    margin-bottom: 2rem;
}

.settings-section h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid var(--border-color);
}

.profile-details h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.profile-details p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
}

.profile-role {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.profile-role.admin {
    background: #10b981;
    color: white;
}

.profile-role.user {
    background: #6b7280;
    color: white;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}

.setting-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-item:first-child {
    padding-top: 0;
}

.setting-info h4 {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.setting-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    border-radius: var(--radius-full);
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-gradient);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.setting-select {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

.about-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.about-logo img {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
}

.about-details h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.about-details p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.about-description {
    margin-top: 0.5rem !important;
}

.settings-actions {
    margin-top: 2rem;
    text-align: center;
}

/* ==============================================
   VOICE RECORDER STYLES
   ============================================== */
.voice-recorder {
    position: relative;
}

.voice-btn {
    transition: all 0.2s ease;
}

.voice-btn.recording {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    animation: pulse-recording 1.5s infinite;
}

.voice-btn.recording svg {
    color: #ef4444;
}

.voice-btn.transcribing {
    opacity: 0.7;
    cursor: wait;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.voice-btn .spinner {
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
    margin-bottom: 0;
}

@keyframes pulse-recording {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.voice-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.voice-modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.voice-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.voice-modal-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
}

.voice-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.voice-modal-body p {
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.voice-modal-note {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.voice-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.voice-error-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid #ef4444;
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
}

.voice-error-toast svg {
    width: 20px;
    height: 20px;
    color: #ef4444;
    flex-shrink: 0;
}

.voice-error-toast span {
    color: var(--text-primary);
    font-size: 0.875rem;
}

.voice-error-toast button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    margin-left: 0.5rem;
}

/* ==============================================
   DEEP THINK BUTTON STYLES
   ============================================== */
.deep-think-btn {
    transition: all 0.2s ease;
}

.deep-think-btn.active {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border-color: #f59e0b;
}

.deep-think-btn.active svg {
    color: #f59e0b;
}

/* ==============================================
   SEARCH BUTTON STYLES
   ============================================== */
.search-btn {
    transition: all 0.2s ease;
}

.search-btn.active {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border-color: #3b82f6;
}

.search-btn.active svg {
    color: #3b82f6;
}

/* Academic sub-button */
.academic-btn {
    transition: all 0.2s ease;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin-left: 0.25rem;
}

.academic-btn.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: #10b981;
}

/* ==============================================
   SOURCES BLOCK STYLES
   ============================================== */
.message-sources {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.sources-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sources-title svg {
    width: 14px;
    height: 14px;
}

.sources-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.source-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    max-width: 250px;
}

.source-item:hover {
    background: var(--hover-color);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.source-item .source-number {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 0.7rem;
}

.source-item .source-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-item svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    opacity: 0.6;
}

/* Search message sources */
.message-search .search-sources {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.search-sources .sources-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.search-sources .sources-header svg {
    width: 14px;
    height: 14px;
    color: var(--accent-color);
}

.search-sources .sources-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-sources .source-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.2s ease;
}

.search-sources .source-item:hover {
    background: var(--hover-color);
    border-color: var(--accent-color);
}

.search-sources .source-index {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.search-sources .source-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow: hidden;
}

.search-sources .source-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-sources .source-domain {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==============================================
   ROUTER LINK STYLES
   ============================================== */
.nav-item {
    text-decoration: none;
}

a.nav-item {
    color: var(--text-secondary);
}

a.nav-item:hover {
    color: var(--text-primary);
}

a.nav-item.active {
    color: var(--accent-color);
}

/* Quick action cards as links */
a.quick-action-card {
    text-decoration: none;
    color: var(--text-primary);
}
