/* Variables CSS */
:root {
    /* Thème sombre par défaut */
    --primary-color: #6c5ce7;
    --primary-hover: #5a4fcf;
    --secondary-color: #a29bfe;
    --accent-color: #fd79a8;
    --success-color: #00b894;
    --warning-color: #fdcb6e;
    --error-color: #e17055;
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --secondary-bg: #0f3460;
    --text-primary: #ffffff;
    --text-secondary: #b2bec3;
    --border-color: #2d3748;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    
    --bg-tertiary: #0f3460;
    --bg-card: #1e2749;
    --bg-input: #2c3e50;
    
    --text-muted: #7f8c8d;
    
    --border-radius: 12px;
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Thème Matrix */
[data-theme="matrix"] {
    --primary-color: #00ff41;
    --primary-hover: #00cc34;
    --secondary-color: #39ff14;
    --accent-color: #ff4444;
    --success-color: #00ff41;
    --warning-color: #ffff00;
    --error-color: #ff0000;
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --secondary-bg: #1a1a1a;
    --text-primary: #00ff41;
    --text-secondary: #39ff14;
    --border-color: #00ff41;
    --shadow: 0 4px 6px rgba(0, 255, 65, 0.3);
    --gradient: linear-gradient(135deg, #000000, #0a0a0a, #00ff41);
}

/* Thème Metal Gear Solid */
[data-theme="mgs"] {
    --primary-color: #ff6600;
    --primary-hover: #e55a00;
    --secondary-color: #ffaa00;
    --accent-color: #00ccff;
    --success-color: #00ff88;
    --warning-color: #ffdd00;
    --error-color: #ff3333;
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --secondary-bg: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #ff6600;
    --shadow: 0 4px 6px rgba(255, 102, 0, 0.3);
    --gradient: linear-gradient(135deg, #1a1a1a, #2a2a2a, #ff6600);
}

/* Thème Crash Team Racing */
[data-theme="ctr"] {
    --primary-color: #ff6b35;
    --primary-hover: #e55a2b;
    --secondary-color: #ffa726;
    --accent-color: #42a5f5;
    --success-color: #66bb6a;
    --warning-color: #ffee58;
    --error-color: #ef5350;
    --bg-primary: #1a0d00;
    --bg-secondary: #2d1b0e;
    --secondary-bg: #3d2817;
    --text-primary: #ffffff;
    --text-secondary: #ffcc80;
    --border-color: #5d4037;
    --shadow: 0 4px 6px rgba(255, 107, 53, 0.3);
    --gradient: linear-gradient(135deg, #ff6b35, #ffa726, #42a5f5);
}

/* Thème Mario Bros */
[data-theme="mario"] {
    --primary-color: #dc143c;
    --primary-hover: #b91c3c;
    --secondary-color: #ff4500;
    --accent-color: #32cd32;
    --success-color: #228b22;
    --warning-color: #ffd700;
    --error-color: #8b0000;
    --bg-primary: #4169e1;
    --bg-secondary: #1e90ff;
    --secondary-bg: #87ceeb;
    --text-primary: #ffffff;
    --text-secondary: #f0f8ff;
    --border-color: #dc143c;
    --shadow: 0 4px 6px rgba(220, 20, 60, 0.3);
    --gradient: linear-gradient(135deg, #4169e1, #1e90ff, #dc143c);
}

/* Thème Sonic */
[data-theme="sonic"] {
    --primary-color: #0080ff;
    --primary-hover: #0066cc;
    --secondary-color: #40a0ff;
    --accent-color: #ffff00;
    --success-color: #00ff00;
    --warning-color: #ff8000;
    --error-color: #ff0040;
    --bg-primary: #001a33;
    --bg-secondary: #003366;
    --secondary-bg: #004d99;
    --text-primary: #ffffff;
    --text-secondary: #cce6ff;
    --border-color: #0080ff;
    --shadow: 0 4px 6px rgba(0, 128, 255, 0.3);
    --gradient: linear-gradient(135deg, #001a33, #003366, #0080ff);
}

/* Thème Streets of Rage */
[data-theme="sor"] {
    --primary-color: #ff0080;
    --primary-hover: #cc0066;
    --secondary-color: #ff4000;
    --accent-color: #ffff00;
    --success-color: #00ff80;
    --warning-color: #ff8040;
    --error-color: #ff0040;
    --bg-primary: #1a0033;
    --bg-secondary: #330066;
    --secondary-bg: #4d0099;
    --text-primary: #ffffff;
    --text-secondary: #ffccff;
    --border-color: #ff0080;
    --shadow: 0 4px 6px rgba(255, 0, 128, 0.3);
    --gradient: linear-gradient(135deg, #1a0033, #330066, #ff0080);
}

/* Thème clair */
[data-theme="light"] {
    --primary-color: #667eea;
    --primary-hover: #5a67d8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --error-color: #f56565;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --secondary-bg: #edf2f7;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

/* Thème Jimimygikado - Gaming Streamer */
[data-theme="jimi"] {
    --primary-color: #ff0080;
    --primary-hover: #e6006b;
    --secondary-color: #00ffff;
    --accent-color: #ffff00;
    --success-color: #00ff80;
    --warning-color: #ff8000;
    --error-color: #ff4040;
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a0a1a;
    --secondary-bg: #2a1a2a;
    --text-primary: #ffffff;
    --text-secondary: #ff80ff;
    --border-color: #ff0080;
    --shadow: 0 4px 6px rgba(255, 0, 128, 0.4);
    --gradient: linear-gradient(135deg, #ff0080, #00ffff, #ffff00);
}

/* Thème Blues for the Red Run - Blues Rock */
[data-theme="blues"] {
    --primary-color: #dc143c;
    --primary-hover: #b91c3c;
    --secondary-color: #4169e1;
    --accent-color: #ffd700;
    --success-color: #32cd32;
    --warning-color: #ff6347;
    --error-color: #ff1493;
    --bg-primary: #1c1c1c;
    --bg-secondary: #2c1c1c;
    --secondary-bg: #3c2c2c;
    --text-primary: #ffffff;
    --text-secondary: #dcdcdc;
    --border-color: #dc143c;
    --shadow: 0 4px 6px rgba(220, 20, 60, 0.4);
    --gradient: linear-gradient(135deg, #dc143c, #4169e1, #ffd700);
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: 
        background-color 0.5s ease,
        color 0.5s ease,
        border-color 0.5s ease,
        box-shadow 0.5s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Bouton retour à l'accueil */
.back-to-home {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.back-to-home:hover {
    background: rgba(102, 126, 234, 1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.back-to-home-text {
    display: none;
}

@media (min-width: 768px) {
    .back-to-home-text {
        display: inline;
    }
}

/* Header */
.header {
    background: rgba(30, 39, 73, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 2rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

.status-indicator.connected {
    background: rgba(46, 204, 113, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.status-indicator.disconnected {
    background: rgba(231, 76, 60, 0.1);
    border-color: var(--error-color);
    color: var(--error-color);
}

.settings-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.settings-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(90deg);
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 140px);
}

.main-content .container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    height: calc(100vh - 200px);
}

@media (max-width: 1024px) {
    .main-content .container {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* Chat Container */
.chat-container {
    background: rgba(30, 39, 73, 0.9);
    border-radius: var(--border-radius);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    margin: 20px 0;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px); /* Hauteur fixe pour le conteneur principal */
    min-height: 600px;
    max-height: 800px;
}

.chat-header {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-title i {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.chat-title h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.chat-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.control-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Bouton d'effacement d'historique - Style danger */
#clear-history {
    color: #ff4757;
    border-color: rgba(255, 71, 87, 0.3);
}

#clear-history:hover {
    background: rgba(255, 71, 87, 0.2);
    color: #ff3742;
    border-color: #ff4757;
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.4);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 320px); /* Hauteur fixe pour éviter le débordement */
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: messageSlideIn 0.3s ease-out;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

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

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--gradient);
    color: white;
}

.message.bot .message-avatar {
    background: var(--gradient);
    color: white;
}

.message-content {
    flex: 1;
    min-width: 0; /* Permet la compression du contenu */
}

.message.user .message-content {
    text-align: right;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.message.user .message-header {
    justify-content: flex-end;
}

.message-author {
    font-weight: 600;
    color: var(--text-secondary);
}

.message-text {
    background: rgba(102, 92, 231, 0.1);
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.6;
    word-break: break-word;
    max-width: 100%;
    overflow-wrap: break-word;
}

.message.user .message-text {
    background: var(--gradient);
    color: white;
    border: none;
}

.message-text p {
    margin-bottom: 8px;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text ul, .message-text ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-text li {
    margin-bottom: 4px;
}

.message-text code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
}

.welcome-message {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Chat Input */
.chat-input-container {
    background: rgba(30, 39, 73, 0.95);
    border-top: 1px solid var(--border-color);
    padding: 20px;
    margin-top: auto; /* Pousse l'input vers le bas */
    flex-shrink: 0; /* Empêche la compression */
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px;
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#message-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 120px;
    font-family: inherit;
}

#message-input::placeholder {
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    gap: 8px;
}

.action-btn, .send-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

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

.send-btn {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.send-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

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

.input-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.typing-indicator {
    color: var(--primary-color);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .sidebar {
        margin-top: 2rem;
    }
}

.sidebar-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.sidebar-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.sidebar-section h3 i {
    color: var(--primary-color);
}

/* Conversations */
.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1rem;
}

.conversation-item {
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

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

.conversation-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border-color: var(--primary-color);
}

.conversation-preview {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.conversation-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

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

.new-conversation-btn {
    width: 100%;
    padding: 12px;
    background: var(--gradient);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.new-conversation-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Suggestions */
.suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggestion-btn {
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-size: 0.9rem;
}

.suggestion-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateX(4px);
}

/* About Info */
.about-info p {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.badge {
    padding: 4px 8px;
    background: var(--gradient);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-hover);
    transform: scale(0.9);
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
}

.modal-close {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-secondary);
}

/* Settings */
.settings-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-info {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1.5rem;
}

.settings-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-info i {
    color: var(--primary-color);
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form-group input[type="range"] {
    -webkit-appearance: none;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
}

.form-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

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

/* About Modal */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.feature-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.feature-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-item h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.tech-info, .installation-guide {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.tech-info h4, .installation-guide h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.tech-info ul, .installation-guide ol {
    color: var(--text-secondary);
    line-height: 1.6;
}

.tech-info li, .installation-guide li {
    margin-bottom: 8px;
}

.installation-guide code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    color: var(--accent-color);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: 2rem;
}

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

.footer-left p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.footer-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-content .container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chat-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .chat-container {
        height: calc(100vh - 150px);
        margin: 10px;
        border-radius: 8px;
    }
    
    .chat-messages {
        max-height: calc(100vh - 280px);
        padding: 15px;
    }
    
    .message {
        margin-bottom: 15px;
    }
    
    .message-text {
        padding: 10px 12px;
        font-size: 0.9em;
    }
}

/* Scrollbar personnalisé */
*::-webkit-scrollbar {
    width: 8px;
}

*::-webkit-scrollbar-track {
    background: var(--bg-input);
}

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

*::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

/* Effets spéciaux pour les thèmes gaming */

/* Thème CTR - Effets de vitesse */
[data-theme="ctr"] .chat-container {
    position: relative;
}

[data-theme="ctr"] .chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(255, 107, 53, 0.1) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 30%, rgba(255, 167, 38, 0.1) 50%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

[data-theme="ctr"] .message.bot .message-avatar {
    animation: ctrPulse 2s infinite;
}

@keyframes ctrPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Thème MGS - Effets Matrix/Terminal */
[data-theme="mgs"] body {
    font-family: 'Courier New', monospace;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 255, 65, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(57, 255, 20, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, #000000 0%, #0a0a0a 100%);
}

[data-theme="mgs"] .chat-container {
    border: 2px solid var(--primary-color);
    box-shadow: 
        0 0 20px rgba(0, 255, 65, 0.3),
        inset 0 0 20px rgba(0, 255, 65, 0.1);
}

[data-theme="mgs"] .message.bot .message-text {
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
    animation: mgsGlow 3s infinite alternate;
}

[data-theme="mgs"] .message.bot .message-avatar {
    animation: mgsFlicker 4s infinite;
}

@keyframes mgsGlow {
    0% { box-shadow: 0 0 10px rgba(0, 255, 65, 0.2); }
    100% { box-shadow: 0 0 20px rgba(0, 255, 65, 0.4); }
}

@keyframes mgsFlicker {
    0%, 98% { opacity: 1; }
    99% { opacity: 0.8; }
    100% { opacity: 1; }
}

[data-theme="mgs"] .typing-indicator {
    color: var(--primary-color);
}

[data-theme="mgs"] .typing-indicator::after {
    content: ' ▋';
    animation: mgsCursor 1s infinite;
}

@keyframes mgsCursor {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Navbar des thèmes */
.theme-navbar {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.theme-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.8rem 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    min-width: 80px;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: var(--text-primary);
}

.theme-btn.active {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.2);
    color: var(--primary-color);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.theme-btn i {
    font-size: 1.2rem;
}

.theme-btn span {
    font-weight: 500;
    font-size: 0.8rem;
}

/* Styles spéciaux pour chaque thème */
.theme-btn[data-theme="mgs"] {
    border-color: #00ff41;
    color: #00ff41;
}

.theme-btn[data-theme="mgs"]:hover,
.theme-btn[data-theme="mgs"].active {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    color: #00ff41;
}

.theme-btn[data-theme="ctr"] {
    border-color: #ff6b35;
    color: #ff6b35;
}

.theme-btn[data-theme="ctr"]:hover,
.theme-btn[data-theme="ctr"].active {
    background: rgba(255, 107, 53, 0.2);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
    color: #ff6b35;
}

.theme-btn[data-theme="dark"] {
    border-color: #6c5ce7;
    color: #6c5ce7;
}

.theme-btn[data-theme="dark"]:hover,
.theme-btn[data-theme="dark"].active {
    background: rgba(108, 92, 231, 0.2);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.3);
    color: #6c5ce7;
}

.theme-btn[data-theme="light"] {
    border-color: #667eea;
    color: #667eea;
}

.theme-btn[data-theme="light"]:hover,
.theme-btn[data-theme="light"].active {
    background: rgba(102, 126, 234, 0.2);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    color: #667eea;
}

/* Styles pour Jimimygikado */
.theme-btn[data-theme="jimi"] {
    border-color: #ff0080;
    color: #ff0080;
}

.theme-btn[data-theme="jimi"]:hover,
.theme-btn[data-theme="jimi"].active {
    background: rgba(255, 0, 128, 0.2);
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.4);
    color: #ff0080;
    animation: jimiButtonPulse 2s infinite;
}

@keyframes jimiButtonPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 0, 128, 0.4); }
    50% { box-shadow: 0 0 30px rgba(0, 255, 255, 0.6); }
}

/* Styles pour Blues */
.theme-btn[data-theme="blues"] {
    border-color: #dc143c;
    color: #dc143c;
}

.theme-btn[data-theme="blues"]:hover,
.theme-btn[data-theme="blues"].active {
    background: rgba(220, 20, 60, 0.2);
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.4);
    color: #dc143c;
    animation: bluesButtonGroove 3s infinite ease-in-out;
}

@keyframes bluesButtonGroove {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(220, 20, 60, 0.4);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 25px rgba(65, 105, 225, 0.5);
        transform: scale(1.05);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .theme-selector {
        gap: 0.5rem;
    }
    
    .theme-btn {
        padding: 0.6rem 0.8rem;
        min-width: 70px;
    }
    
    .theme-btn span {
        font-size: 0.7rem;
    }
}

/* Thème Jimimygikado - Effets Gaming Streamer */
[data-theme="jimi"] body {
    background: 
        radial-gradient(circle at 25% 25%, rgba(255, 0, 128, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(0, 255, 255, 0.15) 0%, transparent 50%),
        linear-gradient(45deg, #0a0a0a 0%, #1a0a1a 100%);
}

[data-theme="jimi"] .chat-container {
    border: 2px solid var(--primary-color);
    box-shadow: 
        0 0 30px rgba(255, 0, 128, 0.4),
        inset 0 0 30px rgba(0, 255, 255, 0.1);
    animation: jimiPulse 4s infinite alternate;
}

[data-theme="jimi"] .message.bot .message-text {
    background: rgba(255, 0, 128, 0.1);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 0, 128, 0.3);
    animation: jimiGlow 2s infinite alternate;
}

[data-theme="jimi"] .message.bot .message-avatar {
    animation: jimiSpin 6s infinite linear;
}

@keyframes jimiPulse {
    0% { box-shadow: 0 0 30px rgba(255, 0, 128, 0.4), inset 0 0 30px rgba(0, 255, 255, 0.1); }
    100% { box-shadow: 0 0 50px rgba(255, 0, 128, 0.6), inset 0 0 50px rgba(0, 255, 255, 0.2); }
}

@keyframes jimiGlow {
    0% { box-shadow: 0 0 15px rgba(255, 0, 128, 0.3); }
    100% { box-shadow: 0 0 25px rgba(0, 255, 255, 0.5); }
}

@keyframes jimiSpin {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.1); }
    50% { transform: rotate(180deg) scale(1); }
    75% { transform: rotate(270deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Thème Blues - Effets Rock/Blues */
[data-theme="blues"] body {
    background: 
        radial-gradient(circle at 30% 40%, rgba(220, 20, 60, 0.2) 0%, transparent 60%),
        radial-gradient(circle at 70% 60%, rgba(65, 105, 225, 0.2) 0%, transparent 60%),
        linear-gradient(135deg, #1c1c1c 0%, #2c1c1c 100%);
}

[data-theme="blues"] .chat-container {
    border: 2px solid var(--primary-color);
    box-shadow: 
        0 0 25px rgba(220, 20, 60, 0.4),
        inset 0 0 25px rgba(65, 105, 225, 0.1);
}

[data-theme="blues"] .message.bot .message-text {
    background: rgba(220, 20, 60, 0.1);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 12px rgba(220, 20, 60, 0.3);
    animation: bluesRhythm 3s infinite ease-in-out;
}

[data-theme="blues"] .message.bot .message-avatar {
    animation: bluesGroove 4s infinite ease-in-out;
}

@keyframes bluesRhythm {
    0%, 100% { 
        box-shadow: 0 0 12px rgba(220, 20, 60, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 20px rgba(65, 105, 225, 0.4);
        transform: scale(1.02);
    }
}

@keyframes bluesGroove {
    0%, 100% { transform: rotate(-2deg) scale(1); }
    25% { transform: rotate(1deg) scale(1.05); }
    50% { transform: rotate(2deg) scale(1); }
    75% { transform: rotate(-1deg) scale(1.05); }
}

/* 🎮 NOUVEAUX CODECS SPÉCIAUX */

/* Thème SPEEDRUN-CODEC */
[data-theme="speedrun"] {
    --primary-color: #ff0000;
    --primary-hover: #cc0000;
    --secondary-color: #ffaa00;
    --accent-color: #00ff00;
    --success-color: #00ff88;
    --warning-color: #ffdd00;
    --error-color: #ff3333;
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a0a0a;
    --secondary-bg: #2a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #ffcccc;
    --border-color: #ff0000;
    --shadow: 0 4px 6px rgba(255, 0, 0, 0.5);
    --gradient: linear-gradient(135deg, #ff0000, #ffaa00, #00ff00);
}

[data-theme="speedrun"] body {
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 0, 0, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 255, 0, 0.15) 0%, transparent 50%),
        linear-gradient(45deg, #0a0a0a 0%, #1a0a0a 100%);
}

[data-theme="speedrun"] .chat-container {
    border: 2px solid var(--primary-color);
    box-shadow: 
        0 0 30px rgba(255, 0, 0, 0.6),
        inset 0 0 30px rgba(255, 170, 0, 0.1);
    animation: speedrunPulse 1.5s infinite alternate;
}

[data-theme="speedrun"] .message.bot .message-text {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
    animation: speedrunGlow 2s infinite alternate;
}

[data-theme="speedrun"] .message.bot .message-avatar {
    animation: speedrunSpin 3s infinite linear;
}

@keyframes speedrunPulse {
    0% { box-shadow: 0 0 30px rgba(255, 0, 0, 0.6), inset 0 0 30px rgba(255, 170, 0, 0.1); }
    100% { box-shadow: 0 0 50px rgba(255, 0, 0, 0.8), inset 0 0 50px rgba(0, 255, 0, 0.2); }
}

@keyframes speedrunGlow {
    0% { box-shadow: 0 0 15px rgba(255, 0, 0, 0.4); }
    100% { box-shadow: 0 0 25px rgba(0, 255, 0, 0.6); }
}

@keyframes speedrunSpin {
    0% { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(360deg) scale(1.1); }
}

/* Thème DRUNK-CODEC */
[data-theme="drunk"] {
    --primary-color: #ffaa00;
    --primary-hover: #cc8800;
    --secondary-color: #ff6600;
    --accent-color: #ffff00;
    --success-color: #88ff88;
    --warning-color: #ff8800;
    --error-color: #ff4444;
    --bg-primary: #1a0f00;
    --bg-secondary: #2a1a0a;
    --secondary-bg: #3a2a1a;
    --text-primary: #ffffff;
    --text-secondary: #ffddaa;
    --border-color: #ffaa00;
    --shadow: 0 4px 6px rgba(255, 170, 0, 0.4);
    --gradient: linear-gradient(135deg, #ffaa00, #ff6600, #ffff00);
}

[data-theme="drunk"] body {
    background: 
        radial-gradient(circle at 30% 70%, rgba(255, 170, 0, 0.2) 0%, transparent 60%),
        radial-gradient(circle at 70% 30%, rgba(255, 102, 0, 0.15) 0%, transparent 50%),
        linear-gradient(45deg, #1a0f00 0%, #2a1a0a 100%);
}

[data-theme="drunk"] .chat-container {
    border: 2px solid var(--primary-color);
    box-shadow: 
        0 0 25px rgba(255, 170, 0, 0.5),
        inset 0 0 25px rgba(255, 102, 0, 0.1);
    animation: drunkWobble 4s infinite ease-in-out;
}

[data-theme="drunk"] .message.bot .message-text {
    background: rgba(255, 170, 0, 0.1);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 12px rgba(255, 170, 0, 0.4);
    animation: drunkShake 3s infinite ease-in-out;
}

[data-theme="drunk"] .message.bot .message-avatar {
    animation: drunkDance 5s infinite ease-in-out;
}

@keyframes drunkWobble {
    0%, 100% { 
        transform: rotate(0deg) scale(1);
        box-shadow: 0 0 25px rgba(255, 170, 0, 0.5), inset 0 0 25px rgba(255, 102, 0, 0.1);
    }
    25% { 
        transform: rotate(-1deg) scale(1.02);
        box-shadow: 0 0 30px rgba(255, 102, 0, 0.6), inset 0 0 30px rgba(255, 255, 0, 0.15);
    }
    50% { 
        transform: rotate(1deg) scale(0.98);
        box-shadow: 0 0 20px rgba(255, 136, 0, 0.4), inset 0 0 20px rgba(255, 170, 0, 0.1);
    }
    75% { 
        transform: rotate(-0.5deg) scale(1.01);
        box-shadow: 0 0 35px rgba(255, 68, 0, 0.7), inset 0 0 35px rgba(255, 204, 0, 0.2);
    }
}

@keyframes drunkShake {
    0%, 100% { 
        transform: translateX(0px) rotate(0deg);
        box-shadow: 0 0 12px rgba(255, 170, 0, 0.4);
    }
    25% { 
        transform: translateX(-2px) rotate(-1deg);
        box-shadow: 0 0 15px rgba(255, 102, 0, 0.5);
    }
    50% { 
        transform: translateX(2px) rotate(1deg);
        box-shadow: 0 0 18px rgba(255, 255, 0, 0.6);
    }
    75% { 
        transform: translateX(-1px) rotate(-0.5deg);
        box-shadow: 0 0 14px rgba(255, 136, 0, 0.5);
    }
}

@keyframes drunkDance {
    0%, 100% { transform: rotate(-5deg) scale(1); }
    20% { transform: rotate(3deg) scale(1.1); }
    40% { transform: rotate(-2deg) scale(0.9); }
    60% { transform: rotate(4deg) scale(1.05); }
    80% { transform: rotate(-1deg) scale(0.95); }
}

/* 🎨 STYLES POUR GÉNÉRATION D'IMAGES */
.generated-image-container {
    margin: 15px 0;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), rgba(162, 155, 254, 0.1));
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.generated-image-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.3);
    border-color: var(--accent-color);
}

.generated-image {
    width: 100%;
    max-width: 512px;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.generated-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.image-info {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.image-info p {
    margin: 5px 0;
    color: var(--text-color);
    font-size: 0.9em;
}

.image-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.image-actions .btn {
    padding: 6px 12px;
    font-size: 0.8em;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.image-actions .btn:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.image-actions .btn i {
    font-size: 0.9em;
}

/* Animation pour le chargement d'image */
@keyframes imageGenerating {
    0% { opacity: 0.5; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 0.5; transform: scale(0.95); }
}

.generating-image {
    animation: imageGenerating 2s infinite ease-in-out;
}

/* === IMAGES UPLOADÉES === */
.uploaded-image-container {
    margin: 15px 0;
    padding: 15px;
    border: 2px solid rgba(255, 165, 0, 0.4);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.1), rgba(255, 193, 7, 0.1));
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.uploaded-image-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 165, 0, 0.3);
    border-color: rgba(255, 165, 0, 0.6);
}

.uploaded-image {
    width: 100%;
    max-width: 400px;
    max-height: 300px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    object-fit: contain;
}

.image-upload-info {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    font-size: 0.9em;
}

.image-analysis {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    text-align: left;
}

.analysis-title {
    font-weight: bold;
    color: #ffa500;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.analysis-content {
    color: var(--text-color);
    line-height: 1.4;
}

/* === PREVIEW D'IMAGE EN COURS D'UPLOAD === */
.image-preview-container {
    margin: 10px 0;
    padding: 10px;
    background: rgba(255, 165, 0, 0.1);
    border: 1px dashed rgba(255, 165, 0, 0.5);
    border-radius: 8px;
    position: relative;
}

.image-preview {
    position: relative;
    display: inline-block;
}

.image-preview img {
    max-width: 150px;
    max-height: 100px;
    border-radius: 6px;
    border: 2px solid rgba(255, 165, 0, 0.6);
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-image:hover {
    background: #ff3742;
    transform: scale(1.1);
}

.image-preview-info {
    margin-top: 5px;
    font-size: 0.8em;
    color: var(--text-secondary);
}

/* === DRAG & DROP === */
.input-wrapper.drag-over {
    border: 2px dashed #ffa500;
    background: rgba(255, 165, 0, 0.1);
}

.drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 165, 0, 0.2);
    border: 2px dashed #ffa500;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffa500;
    font-weight: bold;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drag-overlay.show {
    opacity: 1;
}

/* Bouton SPEEDRUN-CODEC */
.theme-btn[data-theme="speedrun"] {
    background: linear-gradient(135deg, #ff0000, #ffaa00);
    border: 2px solid #ff0000;
    color: #ffffff;
    font-weight: bold;
    animation: speedrunButtonPulse 2s infinite;
}

.theme-btn[data-theme="speedrun"]:hover,
.theme-btn[data-theme="speedrun"].active {
    background: linear-gradient(135deg, #cc0000, #cc8800);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
    animation: speedrunButtonIntense 1s infinite;
}

@keyframes speedrunButtonPulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 10px rgba(255, 0, 0, 0.4); 
    }
    50% { 
        transform: scale(1.03); 
        box-shadow: 0 0 15px rgba(255, 170, 0, 0.6); 
    }
}

@keyframes speedrunButtonIntense {
    0%, 100% { 
        transform: scale(1.05) rotateZ(0deg); 
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.8); 
    }
    50% { 
        transform: scale(1.08) rotateZ(1deg); 
        box-shadow: 0 0 25px rgba(0, 255, 0, 0.6); 
    }
}

/* Bouton DRUNK-CODEC */
.theme-btn[data-theme="drunk"] {
    background: linear-gradient(135deg, #ffaa00, #ff6600);
    border: 2px solid #ffaa00;
    color: #ffffff;
    font-weight: bold;
    animation: drunkButtonWobble 3s infinite;
}

.theme-btn[data-theme="drunk"]:hover,
.theme-btn[data-theme="drunk"].active {
    background: linear-gradient(135deg, #cc8800, #cc4400);
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.6);
    animation: drunkButtonCrazy 2s infinite;
}

@keyframes drunkButtonWobble {
    0%, 100% { 
        transform: scale(1) rotateZ(0deg); 
        box-shadow: 0 0 8px rgba(255, 170, 0, 0.3); 
    }
    25% { 
        transform: scale(1.02) rotateZ(-2deg); 
        box-shadow: 0 0 12px rgba(255, 102, 0, 0.4); 
    }
    50% { 
        transform: scale(0.98) rotateZ(1deg); 
        box-shadow: 0 0 10px rgba(255, 255, 0, 0.5); 
    }
    75% { 
        transform: scale(1.01) rotateZ(-1deg); 
        box-shadow: 0 0 14px rgba(255, 136, 0, 0.4); 
    }
}

@keyframes drunkButtonCrazy {
    0%, 100% { 
        transform: scale(1.05) rotateZ(0deg); 
        box-shadow: 0 0 15px rgba(255, 170, 0, 0.7); 
    }
    20% { 
        transform: scale(1.08) rotateZ(-3deg); 
        box-shadow: 0 0 20px rgba(255, 102, 0, 0.8); 
    }
    40% { 
        transform: scale(1.02) rotateZ(2deg); 
        box-shadow: 0 0 18px rgba(255, 255, 0, 0.6); 
    }
    60% { 
        transform: scale(1.06) rotateZ(-1deg); 
        box-shadow: 0 0 22px rgba(255, 136, 0, 0.9); 
    }
    80% { 
        transform: scale(1.04) rotateZ(2deg); 
        box-shadow: 0 0 16px rgba(255, 68, 0, 0.7); 
    }
}

/* 🔥 RIO-CODEC - Bouton et Thème Débridé */
.theme-btn[data-theme="rio"] {
    background: linear-gradient(135deg, #ff0066, #ff3399, #ff0066);
    border: 2px solid #ff0066;
    color: white;
    position: relative;
    overflow: hidden;
    animation: rioButtonIntense 2s ease-in-out infinite;
}

.theme-btn[data-theme="rio"]:hover,
.theme-btn[data-theme="rio"].active {
    background: linear-gradient(135deg, #ff0066, #ff6699, #ff0066);
    border-color: #ff3399;
    animation: rioButtonWild 1s ease-in-out infinite;
    box-shadow: 0 0 20px #ff0066, 0 0 40px #ff3399;
}

@keyframes rioButtonIntense {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1) saturate(1);
    }
    50% {
        transform: scale(1.02);
        filter: brightness(1.2) saturate(1.3);
    }
}

@keyframes rioButtonWild {
    0% {
        transform: scale(1);
        box-shadow: 0 0 20px #ff0066, 0 0 40px #ff3399;
    }
    25% {
        transform: scale(1.05);
        box-shadow: 0 0 30px #ff0066, 0 0 60px #ff3399;
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 25px #ff0066, 0 0 50px #ff3399;
    }
    75% {
        transform: scale(1.07);
        box-shadow: 0 0 35px #ff0066, 0 0 70px #ff3399;
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px #ff0066, 0 0 40px #ff3399;
    }
}

/* 🔥 Thème RIO-CODEC Complet */
[data-theme="rio"] {
    --primary-color: #ff0066;
    --accent-color: #ff3399;
    --bg-color: #1a0011;
    --text-color: #ffffff;
    --border-color: #ff0066;
}

[data-theme="rio"] body {
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 0, 102, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 51, 153, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #1a0011, #330022, #660044);
    animation: rioBackground 4s ease-in-out infinite alternate;
}

[data-theme="rio"] .chat-container {
    background: rgba(26, 0, 17, 0.95);
    border: 3px solid #ff0066;
    box-shadow: 
        0 0 50px rgba(255, 0, 102, 0.8),
        inset 0 0 30px rgba(255, 51, 153, 0.2),
        0 0 100px rgba(255, 0, 102, 0.4);
    animation: rioGlow 3s ease-in-out infinite alternate;
}

[data-theme="rio"] .message.bot .message-text {
    background: linear-gradient(135deg, rgba(255, 0, 102, 0.2), rgba(255, 51, 153, 0.1));
    border: 2px solid rgba(255, 0, 102, 0.6);
    position: relative;
    overflow: hidden;
}

[data-theme="rio"] .message.bot .message-avatar {
    animation: rioSpin 4s linear infinite;
}

@keyframes rioBackground {
    0% { 
        filter: hue-rotate(0deg) brightness(1) saturate(1);
    }
    100% { 
        filter: hue-rotate(20deg) brightness(1.1) saturate(1.2);
    }
}

@keyframes rioGlow {
    0% {
        box-shadow: 
            0 0 50px rgba(255, 0, 102, 0.8),
            inset 0 0 30px rgba(255, 51, 153, 0.2),
            0 0 100px rgba(255, 0, 102, 0.4);
    }
    100% {
        box-shadow: 
            0 0 80px rgba(255, 0, 102, 1),
            inset 0 0 50px rgba(255, 51, 153, 0.3),
            0 0 150px rgba(255, 0, 102, 0.6);
    }
}

@keyframes rioSpin {
    0% { 
        transform: rotate(0deg) scale(1);
        filter: hue-rotate(0deg);
    }
    25% {
        transform: rotate(90deg) scale(1.1);
        filter: hue-rotate(90deg);
    }
    50% { 
        transform: rotate(180deg) scale(1);
        filter: hue-rotate(180deg);
    }
    75% {
        transform: rotate(270deg) scale(1.1);
        filter: hue-rotate(270deg);
    }
    100% { 
        transform: rotate(360deg) scale(1);
        filter: hue-rotate(360deg);
    }
}

/* Style spécial pour les boutons CODEC */
.theme-btn.special-codec {
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    min-width: 160px;
}

.theme-btn.special-codec::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.theme-btn.special-codec:hover::before {
    left: 100%;
}

/* Effets de transition entre thèmes */

/* Styles pour les boutons streamers dans la navbar */
.theme-btn.streamer-theme {
    min-width: 140px;
    padding: 0.8rem 1rem;
}

.theme-btn.streamer-theme span {
    font-size: 0.7rem;
    font-weight: 600;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Vignettes des streamers */
.streamer-cards-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.streamer-cards-container.show {
    display: block !important;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.streamer-card {
    max-width: 800px;
    margin: 0 auto 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.streamer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient);
    opacity: 0.1;
    z-index: -1;
}

.streamer-card[data-streamer="jimi"] {
    border-color: #ff0080;
}

.streamer-card[data-streamer="blues"] {
    border-color: #dc143c;
}

.streamer-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.streamer-avatar {
    position: relative;
}

.avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    object-fit: cover;
}

.live-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.live-indicator.music {
    background: #9146ff;
}

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

.streamer-info {
    flex: 1;
}

.streamer-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.streamer-title {
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    font-style: italic;
}

.twitch-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #9146ff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.twitch-link:hover {
    color: #772ce8;
    transform: translateX(5px);
}

.streamer-bio {
    margin-bottom: 1.5rem;
}

.streamer-bio p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.streamer-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 1rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.activate-theme-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.activate-theme-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* Responsive pour les vignettes */
@media (max-width: 768px) {
    .streamer-card {
        padding: 1.5rem;
        margin: 0 1rem 2rem;
    }
    
    .streamer-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .streamer-stats {
        gap: 1rem;
    }
    
    .theme-btn.streamer-theme {
        min-width: 120px;
        padding: 0.6rem 0.8rem;
    }
    
    .theme-btn.streamer-theme span {
        font-size: 0.65rem;
    }
}

/* Vignettes Streamers */
.streamer-cards {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    margin: 2rem 0;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.streamer-cards.show {
    display: grid;
    opacity: 1;
    transform: translateY(0);
}

.streamer-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.streamer-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.streamer-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.streamer-avatar {
    position: relative;
    width: 70px;
    height: 70px;
}

.streamer-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-color);
}

.live-indicator {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.live-indicator.music {
    background: #9146ff;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.streamer-info h3 {
    margin: 0;
    color: var(--accent-color);
    font-size: 1.2rem;
}

.streamer-title {
    margin: 0.25rem 0 0 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.streamer-bio {
    margin: 1rem 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    font-size: 0.9rem;
}

.streamer-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.25rem;
}

.streamer-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.twitch-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #9146ff;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.twitch-btn:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(145, 70, 255, 0.4);
}

.activate-theme-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: linear-gradient(45deg, var(--accent-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.activate-theme-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--accent-color-rgb), 0.4);
}

/* Logo Bêta */
.beta-logo {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    animation: betaPulse 2s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.beta-logo:hover {
    transform: scale(1.1);
}

@keyframes betaPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Animation de rotation pour attirer l'attention */
.beta-logo svg {
    animation: betaRotate 4s ease-in-out infinite;
}

@keyframes betaRotate {
    0%, 90%, 100% {
        transform: rotate(0deg);
    }
    5%, 15% {
        transform: rotate(-3deg);
    }
    10% {
        transform: rotate(3deg);
    }
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .beta-logo {
        top: 10px;
        right: 10px;
        transform: scale(0.8);
    }
    
    .beta-logo:hover {
        transform: scale(0.9);
    }
}

/* === NOUVEAUX THÈMES GAMING === */

/* Thème Matrix - Effets spéciaux */
[data-theme="matrix"] body {
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 255, 65, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(57, 255, 20, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #000000, #0a0a0a);
    animation: matrixBackground 10s ease-in-out infinite alternate;
}

[data-theme="matrix"] .chat-container {
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid var(--primary-color);
    box-shadow: 
        0 0 20px rgba(0, 255, 65, 0.5),
        inset 0 0 20px rgba(0, 255, 65, 0.1);
}

[data-theme="matrix"] .message.bot .message-text {
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid rgba(0, 255, 65, 0.3);
    animation: matrixGlow 2s ease-in-out infinite alternate;
}

[data-theme="matrix"] .message.bot .message-avatar {
    animation: matrixPulse 2s ease-in-out infinite;
}

@keyframes matrixBackground {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(10deg); }
}

@keyframes matrixGlow {
    0% { box-shadow: 0 0 5px rgba(0, 255, 65, 0.3); }
    100% { box-shadow: 0 0 20px rgba(0, 255, 65, 0.8); }
}

@keyframes matrixPulse {
    0%, 100% { color: var(--primary-color); transform: scale(1); }
    50% { color: var(--secondary-color); transform: scale(1.1); }
}

/* Thème Metal Gear Solid - Style tactique */
[data-theme="mgs"] body {
    background: 
        linear-gradient(45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(-45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
        linear-gradient(-45deg, transparent 75%, #2a2a2a 75%),
        linear-gradient(135deg, #1a1a1a, #2a2a2a, #ff6600);
    background-size: 20px 20px, 20px 20px, 20px 20px, 20px 20px, 100% 100%;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px, 0 0;
}

[data-theme="mgs"] .chat-container {
    background: rgba(26, 26, 26, 0.95);
    border: 2px solid var(--primary-color);
    box-shadow: 
        0 0 30px rgba(255, 102, 0, 0.4),
        inset 0 0 10px rgba(255, 102, 0, 0.1);
}

[data-theme="mgs"] .message.bot .message-text {
    background: linear-gradient(135deg, rgba(255, 102, 0, 0.1), rgba(255, 170, 0, 0.05));
    border: 1px solid rgba(255, 102, 0, 0.3);
    position: relative;
    overflow: hidden;
}

[data-theme="mgs"] .message.bot .message-text::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 102, 0, 0.1), transparent);
    animation: mgsScan 3s linear infinite;
}

@keyframes mgsScan {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Thème Mario Bros - Style coloré */
[data-theme="mario"] body {
    background: 
        radial-gradient(circle at 25% 25%, #ffffff 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, #ffffff 1px, transparent 1px),
        linear-gradient(135deg, #4169e1, #1e90ff, #87ceeb);
    background-size: 30px 30px, 20px 20px, 100% 100%;
    animation: marioFloat 4s ease-in-out infinite alternate;
}

[data-theme="mario"] .chat-container {
    background: linear-gradient(135deg, rgba(65, 105, 225, 0.9), rgba(30, 144, 255, 0.9));
    border: 3px solid var(--primary-color);
    border-radius: 20px;
    box-shadow: 
        0 10px 30px rgba(220, 20, 60, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
}

[data-theme="mario"] .message.bot .message-text {
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.2), rgba(255, 69, 0, 0.1));
    border: 2px solid rgba(220, 20, 60, 0.5);
    border-radius: 15px;
    transform: perspective(100px) rotateX(2deg);
}

@keyframes marioFloat {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-10px); }
}

/* Thème Sonic - Style rapide */
[data-theme="sonic"] body {
    background: 
        linear-gradient(90deg, transparent 50%, rgba(0, 128, 255, 0.1) 50%),
        linear-gradient(135deg, #001a33, #003366, #004d99);
    background-size: 40px 40px, 100% 100%;
    animation: sonicSpeed 0.5s linear infinite;
}

[data-theme="sonic"] .chat-container {
    background: rgba(0, 26, 51, 0.95);
    border: 2px solid var(--primary-color);
    box-shadow: 
        0 0 40px rgba(0, 128, 255, 0.6),
        inset 0 0 20px rgba(0, 128, 255, 0.1);
    animation: sonicPulse 1s ease-in-out infinite alternate;
}

[data-theme="sonic"] .message.bot .message-text {
    background: linear-gradient(90deg, rgba(0, 128, 255, 0.1), rgba(64, 160, 255, 0.1));
    border: 1px solid rgba(0, 128, 255, 0.5);
    position: relative;
}

[data-theme="sonic"] .message.bot .message-text::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 0, 0.3), transparent);
    animation: sonicStreak 1.5s ease-in-out infinite;
}

@keyframes sonicSpeed {
    0% { background-position: 0px 0px, 0 0; }
    100% { background-position: 40px 0px, 0 0; }
}

@keyframes sonicPulse {
    0% { box-shadow: 0 0 40px rgba(0, 128, 255, 0.6), inset 0 0 20px rgba(0, 128, 255, 0.1); }
    100% { box-shadow: 0 0 60px rgba(0, 128, 255, 0.8), inset 0 0 30px rgba(0, 128, 255, 0.2); }
}

@keyframes sonicStreak {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Thème Streets of Rage - Style street fighting */
[data-theme="sor"] body {
    background: 
        repeating-linear-gradient(
            45deg,
            #1a0033,
            #1a0033 10px,
            #330066 10px,
            #330066 20px
        ),
        radial-gradient(circle at 50% 50%, rgba(255, 0, 128, 0.2) 0%, transparent 70%);
    animation: sorNeon 3s ease-in-out infinite alternate;
}

[data-theme="sor"] .chat-container {
    background: rgba(26, 0, 51, 0.95);
    border: 3px solid var(--primary-color);
    box-shadow: 
        0 0 50px rgba(255, 0, 128, 0.7),
        inset 0 0 20px rgba(255, 0, 128, 0.1),
        0 0 100px rgba(255, 64, 0, 0.3);
    animation: sorGlow 2s ease-in-out infinite alternate;
}

[data-theme="sor"] .message.bot .message-text {
    background: linear-gradient(135deg, rgba(255, 0, 128, 0.2), rgba(255, 64, 0, 0.1));
    border: 2px solid rgba(255, 0, 128, 0.5);
    position: relative;
    overflow: hidden;
}

[data-theme="sor"] .message.bot .message-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 0, 0.4), transparent);
    animation: sorElectric 2s ease-in-out infinite;
}

@keyframes sorNeon {
    0% { filter: hue-rotate(0deg) saturate(1); }
    100% { filter: hue-rotate(20deg) saturate(1.2); }
}

@keyframes sorGlow {
    0% { 
        box-shadow: 
            0 0 50px rgba(255, 0, 128, 0.7),
            inset 0 0 20px rgba(255, 0, 128, 0.1),
            0 0 100px rgba(255, 64, 0, 0.5);
    }
    100% { 
        box-shadow: 
            0 0 70px rgba(255, 0, 128, 0.9),
            inset 0 0 30px rgba(255, 0, 128, 0.2),
            0 0 120px rgba(255, 64, 0, 0.5);
    }
}

@keyframes sorElectric {
    0%, 100% { left: -100%; opacity: 0; }
    50% { left: 0%; opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

/* Boutons de thèmes pour les nouveaux thèmes */
.theme-btn[data-theme="matrix"] {
    background: linear-gradient(135deg, #000000, #00ff41);
    border: 1px solid #00ff41;
    color: #00ff41;
}

.theme-btn[data-theme="matrix"]:hover,
.theme-btn[data-theme="matrix"].active {
    background: linear-gradient(135deg, #00ff41, #39ff14);
    color: #000000;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.6);
}

.theme-btn[data-theme="mgs"] {
    background: linear-gradient(135deg, #1a1a1a, #ff6600);
    border: 1px solid #ff6600;
    color: #ff6600;
}

.theme-btn[data-theme="mgs"]:hover,
.theme-btn[data-theme="mgs"].active {
    background: linear-gradient(135deg, #ff6600, #ffaa00);
    color: #1a1a1a;
    box-shadow: 0 0 20px rgba(255, 102, 0, 0.6);
}

.theme-btn[data-theme="mario"] {
    background: linear-gradient(135deg, #4169e1, #dc143c);
    border: 1px solid #dc143c;
    color: #ffffff;
}

.theme-btn[data-theme="mario"]:hover,
.theme-btn[data-theme="mario"].active {
    background: linear-gradient(135deg, #dc143c, #32cd32);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.6);
}

.theme-btn[data-theme="sonic"] {
    background: linear-gradient(135deg, #001a33, #0080ff);
    border: 1px solid #0080ff;
    color: #0080ff;
}

.theme-btn[data-theme="sonic"]:hover,
.theme-btn[data-theme="sonic"].active {
    background: linear-gradient(135deg, #0080ff, #ffff00);
    color: #001a33;
    box-shadow: 0 0 20px rgba(0, 128, 255, 0.6);
}

.theme-btn[data-theme="sor"] {
    background: linear-gradient(135deg, #1a0033, #ff0080);
    border: 1px solid #ff0080;
    color: #ff0080;
}

.theme-btn[data-theme="sor"]:hover,
.theme-btn[data-theme="sor"].active {
    background: linear-gradient(135deg, #ff0080, #ffff00);
    color: #1a0033;
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.6);
}

/* Responsive pour les nouveaux boutons */
@media (max-width: 768px) {
    .theme-btn[data-theme="matrix"],
    .theme-btn[data-theme="mgs"],
    .theme-btn[data-theme="mario"],
    .theme-btn[data-theme="sonic"],
    .theme-btn[data-theme="sor"] {
        font-size: 0.8em;
        padding: 8px 12px;
    }
    
    .theme-btn[data-theme="matrix"] span,
    .theme-btn[data-theme="mgs"] span,
    .theme-btn[data-theme="mario"] span,
    .theme-btn[data-theme="sonic"] span,
    .theme-btn[data-theme="sor"] span {
        display: none;
    }
}

/* Indicateur de messages supplémentaires */
.message-more-indicator {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    padding: 15px;
    background: rgba(102, 92, 231, 0.1);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.more-indicator-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    color: var(--text-secondary);
}

.more-indicator-content i {
    font-size: 1.2em;
    color: var(--primary-color);
    animation: pulse 2s ease-in-out infinite;
}

.more-indicator-content span {
    font-size: 0.9em;
    font-weight: 500;
}

.btn-load-more {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-load-more:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 92, 231, 0.3);
}

.btn-load-more i {
    font-size: 0.8em;
    animation: none;
}

/* Amélioration de la gestion du scroll pour les thèmes */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
    opacity: 0.7;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
    opacity: 1;
}

/* Indicateur de scroll pour les messages longs */
.message-text {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.message-text::-webkit-scrollbar {
    width: 4px;
}

.message-text::-webkit-scrollbar-track {
    background: transparent;
}

.message-text::-webkit-scrollbar-thumb {
    background: rgba(102, 92, 231, 0.3);
    border-radius: 2px;
}

.message-text::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 92, 231, 0.5);
}

/* Animation pour les nouveaux messages */
@keyframes newMessageSlide {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.message.new-message {
    animation: newMessageSlide 0.5s ease-out;
}

/* Responsive pour l'indicateur */
@media (max-width: 768px) {
    .message-more-indicator {
        margin: 15px 0;
        padding: 12px;
    }
    
    .more-indicator-content {
        gap: 8px;
    }
    
    .more-indicator-content span {
        font-size: 0.8em;
    }
    
    .btn-load-more {
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    .message-text {
        max-height: 300px;
    }
} 

/* ===== STYLES POUR LA NOUVELLE STRUCTURE RÉORGANISÉE ===== */

/* Layout principal avec footer fixé */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

/* Header réorganisé */
.chat-header {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.logo i {
    font-size: 2rem;
    color: #64ffda;
}

.logo-text h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
}

.logo-text .subtitle {
    font-size: 0.9rem;
    color: #b3d4fc;
    font-weight: 400;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Main container flex layout */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Layout 3-colonnes */
.app-layout {
    display: grid;
    grid-template-columns: 300px 1fr 280px;
    height: calc(100vh - 140px); /* Header + Footer space */
    gap: 0;
    background: #f8f9fa;
}

/* Sidebar générique */
.sidebar {
    background: #ffffff;
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ced4da #f8f9fa;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 3px;
}

.sidebar-left {
    border-right: 2px solid #e9ecef;
}

.sidebar-right {
    border-left: 2px solid #e9ecef;
    border-right: none;
}

/* Modules dans les sidebars */
.module {
    border-bottom: 1px solid #e9ecef;
    background: white;
}

.module h3 {
    margin: 0;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.module h3 i {
    color: #6c757d;
}

.module-content {
    padding: 15px 20px;
}

/* Module Diagnostic & Outils */
.tool-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.tool-btn i {
    font-size: 1rem;
}

/* Module Status */
.status-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.status-item i {
    font-size: 1.2rem;
    color: #28a745;
    width: 20px;
    text-align: center;
}

.status-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.status-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
}

.status-value {
    font-size: 0.85rem;
    color: #495057;
    font-weight: 600;
}

/* Module Gaming Info */
.gaming-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary {
    background: #007bff;
    color: white;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #212529;
}

.gaming-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.stat-number {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #007bff;
}

.stat-label {
    font-size: 0.7rem;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 500;
}

/* Module Tech Info */
.tech-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.tech-item i {
    color: #6c757d;
    width: 16px;
    text-align: center;
}

.tech-item span {
    font-size: 0.8rem;
    color: #495057;
    font-weight: 500;
}

/* Zone de chat centrale */
.chat-section {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    position: relative;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header-controls {
    padding: 15px 20px;
    border-bottom: 2px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chat-title h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #495057;
    font-weight: 600;
}

.chat-title i {
    color: #007bff;
    font-size: 1.3rem;
}

/* Messages de chat */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: #ced4da #f8f9fa;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 4px;
}

/* Welcome card améliorée */
.welcome-card {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 20px rgba(0,123,255,0.2);
}

.welcome-card h4 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.welcome-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 15px 0;
}

.welcome-features .feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    backdrop-filter: blur(10px);
}

.welcome-features .feature-item i {
    color: #64ffda;
    font-size: 1rem;
}

.welcome-features .feature-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Input container amélioré */
.chat-input-container {
    padding: 20px;
    border-top: 2px solid #e9ecef;
    background: #f8f9fa;
}

/* Footer fixé en bas */
.chat-footer {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
    padding: 15px 30px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    border-top: 3px solid #007bff;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    gap: 20px;
}

.footer-left p {
    margin: 0;
    font-size: 0.85rem;
    color: #adb5bd;
}

.footer-left strong {
    color: white;
}

.footer-center {
    text-align: center;
}

.version-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.version {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64ffda;
}

.build {
    font-size: 0.7rem;
    color: #6c757d;
}

.footer-right {
    text-align: right;
}

.footer-links {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.footer-btn {
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.footer-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

/* Suggestions dans sidebar gauche */
.suggestions-module .suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggestion-btn {
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    color: #495057;
}

.suggestion-btn:hover {
    background: #e9ecef;
    border-color: #007bff;
    transform: translateX(5px);
}

/* Conversations dans sidebar gauche */
.conversation-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.conversation-item {
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.conversation-item:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.conversation-item.active {
    background: #e3f2fd;
    border-color: #007bff;
}

.conversation-preview {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.conversation-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
}

.conversation-time {
    font-size: 0.7rem;
    color: #6c757d;
}

.new-conversation-btn {
    width: 100%;
    padding: 10px 15px;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.new-conversation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .app-layout {
        grid-template-columns: 250px 1fr 250px;
    }
}

@media (max-width: 992px) {
    .app-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .sidebar {
        display: none;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 10px;
    }
    
    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 15px;
    }
    
    .logo-text h1 {
        font-size: 1.4rem;
    }
    
    .chat-footer {
        padding: 10px 15px;
    }
    
    .footer-content {
        gap: 5px;
    }
    
    .footer-left p {
        font-size: 0.75rem;
    }
}  