/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Couleurs principales en noir/blanc/gris */
    --primary: #2d3748;
    --primary-dark: #1a202c;
    --primary-light: #4a5568;
    --secondary: #f7fafc;
    --accent: #4a5568;
    
    /* Couleurs conservées pour alertes et boutons */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --button-primary: #2d3748;
    --button-hover: #1a202c;
    
    /* Palette de gris */
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --surface: #ffffff;
    --surface-secondary: #f7fafc;
    --surface-dark: #edf2f7;
    
    /* Tons pour les bulles de discussion */
    --chat-user-bg: #e6fffa;
    --chat-user-border: #b2f5ea;
    --chat-assistant-bg: #e6f3ff;
    --chat-assistant-border: #b3d9ff;
    
    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    min-height: 100vh;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* Layout principal */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
}

/* Header */
.app-header {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.header-content {
    padding: 32px;
    text-align: center;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.header-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Navigation par onglets */
.tab-navigation {
    display: flex;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 6px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    gap: 4px;
    border: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

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

.tab-btn.active {
    background: var(--button-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.tab-icon {
    font-size: 18px;
}

/* Contenu principal */
.main-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-height: 700px;
    border: 1px solid var(--border);
}

.tab-panel {
    display: none;
    min-height: 700px;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

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

/* Layout Chat */
.chat-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 700px;
}

/* Sidebar Chat */
.chat-sidebar {
    background: var(--surface-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    max-height: 700px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--button-primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.new-chat-btn:hover:not(:disabled) {
    background: var(--button-hover);
    transform: translateY(-1px);
}

.new-chat-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.new-chat-btn.loading::after {
    content: '';
    position: absolute;
    right: 12px;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.new-chat-btn span:first-child {
    font-size: 18px;
    font-weight: 300;
}

.chats-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.chat-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    border-radius: var(--radius);
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
}

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

.chat-item.active {
    background: var(--surface-dark);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.chat-item-content {
    flex: 1;
    padding: 12px 16px;
    cursor: pointer;
}

.chat-item-title {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    max-height: 2.6em;
    word-wrap: break-word;
    hyphens: auto;
}

.chat-item-meta {
    font-size: 12px;
    opacity: 0.7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-item-delete {
    opacity: 0;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    margin-right: 8px;
    flex-shrink: 0;
}

.chat-item:hover .chat-item-delete {
    opacity: 1;
}

.chat-item-delete:hover {
    background: #dc2626;
}

/* Barre d'outils pour rédacteurs */
.editor-toolbar {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

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

.toolbar-section label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.toolbar-section select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--surface);
    color: var(--text-primary);
    min-width: 150px;
}

.toolbar-btn {
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    white-space: nowrap;
}

.toolbar-btn:hover {
    background: var(--surface-dark);
    border-color: var(--text-muted);
}

.toolbar-btn:active {
    transform: translateY(1px);
}

/* Zone de chat principale */
.chat-main {
    display: flex;
    flex-direction: column;
    min-height: 700px;
    max-height: 700px;
}

.chat-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    flex-shrink: 0;
}

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

.chat-title-container h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.edit-title-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.6;
    transition: var(--transition);
}

.edit-title-btn:hover {
    opacity: 1;
    background: var(--surface-secondary);
}

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

.chat-controls select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--surface);
    color: var(--text-primary);
}

.delete-chat-btn {
    background: var(--error);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.delete-chat-btn:hover {
    background: #dc2626;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-secondary);
    flex-shrink: 0;
}

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

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--surface-dark);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Prévisualisation */
.preview-content {
    font-family: 'Georgia', serif;
    line-height: 1.6;
    color: var(--text-primary);
    max-width: 800px;
}

.preview-content h1 {
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.preview-content h2 {
    color: #34495e;
    margin-top: 30px;
    margin-bottom: 15px;
}

.preview-content h3 {
    color: #7f8c8d;
    margin-top: 25px;
    margin-bottom: 12px;
}

.preview-content p {
    margin-bottom: 15px;
    text-align: justify;
}

.preview-content strong {
    color: #2c3e50;
    font-weight: 600;
}

.preview-content a {
    color: #3498db;
    text-decoration: none;
}

.preview-content a:hover {
    text-decoration: underline;
}

.preview-content ul,
.preview-content ol {
    margin-bottom: 15px;
    padding-left: 25px;
}

.preview-content li {
    margin-bottom: 5px;
}

/* Analyse SEO */
.seo-analysis {
    max-width: 600px;
}

.seo-score {
    text-align: center;
    margin-bottom: 30px;
}

.seo-score h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.score-circle {
    width: 100px;
    height: 100px;
    border: 8px solid;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 24px;
    font-weight: bold;
}

.seo-metrics,
.seo-keywords,
.seo-recommendations {
    margin-bottom: 25px;
}

.seo-metrics h4,
.seo-keywords h4,
.seo-recommendations h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.metric {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--surface-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.metric-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.metric-value {
    font-weight: 600;
    color: var(--text-primary);
}

.keywords-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.keyword-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--surface-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.keyword-word {
    font-weight: 500;
    color: var(--text-primary);
}

.keyword-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.recommendations-list {
    list-style: none;
    padding: 0;
}

.recommendations-list li {
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #fef3cd;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    color: #92400e;
    font-size: 14px;
}

.recommendations-list li:before {
    content: "⚠️ ";
    margin-right: 8px;
}

.no-recommendations {
    padding: 15px;
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius);
    color: #065f46;
    text-align: center;
    font-weight: 500;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--surface-secondary);
    min-height: 0;
}

.welcome-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.welcome-message h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.message {
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

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

.message.assistant .message-avatar {
    background: var(--text-muted);
    color: white;
}

.message-content {
    max-width: 70%;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.message.user .message-content {
    background: var(--chat-user-bg);
    border-color: var(--chat-user-border);
    color: var(--text-primary);
}

.message.assistant .message-content {
    background: var(--chat-assistant-bg);
    border-color: var(--chat-assistant-border);
    color: var(--text-primary);
}

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

/* Styles pour le contenu formaté des messages */
.message-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 16px 0 12px 0;
    color: inherit;
}

.message-text h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 14px 0 10px 0;
    color: inherit;
}

.message-text h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 12px 0 8px 0;
    color: inherit;
}

.message-text strong {
    font-weight: 600;
    color: inherit;
}

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

.message-text ul {
    margin: 12px 0;
    padding-left: 20px;
}

.message-text li {
    margin: 4px 0;
    line-height: 1.5;
}

.message-text br {
    line-height: 1.6;
}

.message-meta {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.message-number {
    background: var(--surface-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

/* Indicateur de frappe */
.typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s infinite ease-in-out;
}

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

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

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-input-container {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-input-wrapper textarea {
    flex: 1;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    resize: none;
    min-height: 80px;
    max-height: 200px;
    transition: var(--transition);
}

.chat-input-wrapper textarea:focus {
    outline: none;
    border-color: var(--text-secondary);
    box-shadow: 0 0 0 3px rgba(45, 55, 72, 0.1);
}

.chat-input-wrapper textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.send-btn {
    padding: 16px 24px;
    background: var(--button-primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
    min-width: 100px;
}

.send-btn:hover:not(:disabled) {
    background: var(--button-hover);
    transform: translateY(-1px);
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.send-btn.loading::after {
    content: '';
    position: absolute;
    right: 12px;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Grille de contenu pour les images */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
    padding: 32px;
}

/* Panneaux */
.input-panel,
.output-panel {
    background: var(--surface-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.panel-header h2,
.panel-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-container {
    padding: 24px;
}

/* Formulaires */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.input-group textarea,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    transition: var(--transition);
    resize: vertical;
}

.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--text-secondary);
    box-shadow: 0 0 0 3px rgba(45, 55, 72, 0.1);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Boutons radio modernes et simples */
.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-item {
    position: relative;
}

.radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 14px;
    user-select: none;
}

.radio-item label small {
    font-size: 11px;
    opacity: 0.7;
    font-weight: 400;
}

.radio-item label:hover {
    border-color: var(--text-muted);
    background: var(--surface-secondary);
}

.radio-item input[type="radio"]:checked + label {
    border-color: var(--text-secondary);
    background: var(--surface-dark);
    color: var(--text-primary);
    box-shadow: var(--shadow);
}

.radio-item input[type="radio"]:focus + label {
    box-shadow: 0 0 0 3px rgba(45, 55, 72, 0.1);
}

/* Boutons */
.generate-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.generate-btn.primary {
    background: linear-gradient(135deg, var(--button-primary) 0%, var(--button-hover) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.generate-btn.primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.generate-btn:disabled .btn-text {
    display: none;
}

.generate-btn:disabled .btn-loader {
    display: block;
}

/* Sections */
.gallery-section {
    border-top: 1px solid var(--border);
    padding: 32px;
}

.section-header {
    margin-bottom: 24px;
}

.section-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Médiathèque */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.gallery-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--text-muted);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--surface-secondary);
}

.gallery-info {
    padding: 16px;
}

.gallery-prompt {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.gallery-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

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

.view-btn {
    flex: 1;
    padding: 8px 12px;
    background: var(--button-primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.view-btn:hover {
    background: var(--button-hover);
}

.delete-btn {
    padding: 6px 12px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.delete-btn:hover {
    background: #dc2626;
}

/* Scrollbars personnalisées */
.chats-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.media-grid::-webkit-scrollbar {
    width: 6px;
}

.chats-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track,
.media-grid::-webkit-scrollbar-track {
    background: var(--surface-secondary);
    border-radius: 3px;
}

.chats-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.media-grid::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.chats-list::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover,
.media-grid::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* États vides */
.empty-state-grid {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-grid p {
    font-size: 15px;
    margin-bottom: 8px;
}

.empty-state-grid small {
    font-size: 13px;
    opacity: 0.8;
}

/* Notifications - Couleurs conservées */
.notification {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    font-weight: 500;
    font-size: 14px;
    max-width: 300px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification-success {
    background: var(--success);
    color: white;
}

.notification-error {
    background: var(--error);
    color: white;
}

.notification-warning {
    background: var(--warning);
    color: white;
}

.notification-info {
    background: var(--text-secondary);
    color: white;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .app-container {
        padding: 16px;
    }
    
    .chat-layout {
        grid-template-columns: 250px 1fr;
    }
}

@media (max-width: 768px) {
    .header-content h1 {
        font-size: 2rem;
    }
    
    .header-content p {
        font-size: 1rem;
    }
    
    .tab-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .chat-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .chat-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 200px;
    }
    
    .chat-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .chat-controls select {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .radio-item label {
        justify-content: center;
    }
    
    .media-grid {
        grid-template-columns: 1fr;
    }
    
    .editor-toolbar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .toolbar-section {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 12px;
    }
    
    .header-content {
        padding: 24px 20px;
    }
    
    .tab-panel {
        min-height: 600px;
    }
    
    .chat-layout {
        min-height: 600px;
    }
    
    .chat-main {
        min-height: 600px;
        max-height: 600px;
    }
    
    .chat-sidebar {
        max-height: 200px;
    }
    
    .chat-header {
        padding: 16px 20px;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .chat-title-container h2 {
        font-size: 1.1rem;
    }
    
    .message-content {
        max-width: 90%;
    }
    
    .chat-input-wrapper {
        flex-direction: column;
        gap: 8px;
    }
    
    .send-btn {
        align-self: flex-end;
        padding: 12px 20px;
    }
}