:root {
    /* --- 2025 Dark Mode Palette --- */

    /* Couleurs principales (Electric Indigo & Teal) */
    --primary-color: #5F27CD; /* Electric Indigo */
    --secondary-color: #7A42F4; /* Lighter Indigo for hover/active */
    --accent-color: #00F5D4; /* Electric Teal */

    /* Couleurs de base sombres */
    --dark-base: #101018; /* Very dark near-black with blue/purple hint */
    --dark-surface-1: #181828; /* Slightly lighter surface */
    --dark-surface-2: #222230; /* Surface for cards, components */
    --dark-surface-3: #1C1C28; /* Surface for inputs */

    /* Couleurs de texte */
    --text-primary: #EAEAEA; /* Light gray/off-white */
    --text-secondary: #888899; /* Medium gray */
    --text-on-primary: #FFFFFF; /* White text on primary color */
    --text-on-accent: #000000; /* Black text on accent color */

    /* Couleurs fonctionnelles */
    --success-color: #20C997; /* Tealish Green */
    --warning-color: #FFC107; /* Amber Yellow */
    --danger-color: #F93154; /* Vibrant Red */
    --info-color: var(--accent-color); /* Use accent for info */

    /* Bordures et séparateurs */
    --border-color: rgba(136, 136, 153, 0.15); /* Subtle gray border */
    --border-color-focus: rgba(95, 39, 205, 0.4); /* Primary color border on focus */
    --border-color-accent: rgba(0, 245, 212, 0.3); /* Accent color border */

    /* Ombres modernes (plus douces) */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 5px 10px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.25);

    /* Typographie */
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace; /* Example mono font */

    /* --- Mappages pour le thème --- */
    --dark-bg: linear-gradient(180deg, var(--dark-base) 0%, var(--dark-surface-1) 100%);
    --dark-bg-solid: var(--dark-surface-1);
    --dark-bg-secondary: var(--dark-surface-2);
    --dark-text: var(--text-primary);
    --dark-text-secondary: var(--text-secondary);
    --dark-border: var(--border-color);
    --dark-input-bg: var(--dark-surface-3);
    --dark-border-light: rgba(136, 136, 153, 0.1); /* Lighter variant if needed */

    /* --- Legacy Gray Variables (Map to new text/surface colors if possible) --- */
    /* These might not be needed if everything uses the new semantic variables */
    --gray-100: #f8f9fa; /* Keep for potential light elements? */
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: var(--text-secondary); /* Map to secondary text */
    --gray-600: #6c757d; /* Darker gray */
    --gray-700: #495057; /* Very dark gray */
    --gray-800: var(--dark-surface-2); /* Map to surface */
    --gray-900: var(--dark-surface-1); /* Map to darker surface */
}

/* --- Global Styles --- */
body, html {
    font-family: var(--font-sans);
    background: var(--dark-bg);
    color: var(--dark-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    font-size: 16px; /* Base font size */
}

/* --- Component Styles --- */

/* Dropdowns */
.dropdown-menu {
    background-color: var(--dark-surface-2);
    border: 1px solid var(--dark-border);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
}

.dropdown-item {
    color: var(--dark-text);
    padding: 0.5rem 1rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
}

.dropdown-divider {
    border-top: 1px solid var(--dark-border);
}

/* Buttons */
.btn {
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.875rem;
    padding: 0.7rem 1.4rem; /* Slightly larger padding */
    border-radius: 0.5rem;
    transition: all 0.2s ease-out;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-on-primary);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--text-on-primary);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: var(--text-on-accent); /* Assuming good contrast */
}

.btn-success:hover {
    opacity: 0.9;
}

.btn-outline-success {
    border-color: var(--success-color);
    color: var(--success-color);
    background-color: transparent;
}

.btn-outline-success:hover {
    background-color: var(--success-color);
    color: var(--text-on-accent);
}

.btn-secondary { /* For Close/Cancel */
    background-color: var(--dark-surface-2);
    border-color: var(--dark-border);
    color: var(--dark-text-secondary);
}

.btn-secondary:hover {
    background-color: var(--dark-surface-3);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.btn-outline-secondary {
    border-color: var(--dark-border);
    color: var(--dark-text-secondary);
    background-color: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--dark-surface-3);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}
.btn-danger:hover {
    opacity: 0.9;
}

.btn-outline-danger {
    border-color: var(--danger-color);
    color: var(--danger-color);
    background-color: transparent;
}
.btn-outline-danger:hover {
    background-color: var(--danger-color);
    color: white;
}

.btn-info {
    background-color: var(--info-color);
    border-color: var(--info-color);
    color: var(--text-on-accent);
}
.btn-info:hover {
    opacity: 0.9;
}

.btn-outline-info {
    border-color: var(--info-color);
    color: var(--info-color);
    background-color: transparent;
}
.btn-outline-info:hover {
    background-color: var(--info-color);
    color: var(--text-on-accent);
}


.btn-close { /* For modals etc. */
    filter: invert(90%) sepia(10%) saturate(100%) hue-rotate(190deg) brightness(100%) contrast(90%); /* Adjust filter for light gray */
}
.btn-close:hover {
    filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(110%) contrast(100%); /* White on hover */
}

/* Cards, List Groups */
.card, .list-group, .list-group-item {
    background-color: var(--dark-surface-2);
    border: 1px solid var(--dark-border);
    color: var(--dark-text);
    border-radius: 0.75rem; /* Consistent rounding */
}
.card {
    box-shadow: var(--shadow-md);
}
.list-group-item {
    border-radius: 0; /* Remove individual radius */
    border-left: none;
    border-right: none;
    border-top: none; /* Keep only bottom border */
}
.list-group-item:first-child {
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
    border-top: 1px solid var(--dark-border); /* Add top border back */
}
.list-group-item:last-child {
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
    border-bottom: 1px solid var(--dark-border); /* Ensure last has border */
}
.list-group-item:hover {
    background-color: var(--dark-surface-3);
}

/* --- Layout --- */

/* Sidebar */
.sidebar {
    background-color: var(--dark-surface-1); /* Use surface 1 */
    height: 100vh;
    position: sticky;
    top: 0;
    padding: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2); /* Right shadow */
    z-index: 100;
    border-right: 1px solid var(--dark-border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem 1rem; /* Reduced padding slightly */
    border-bottom: 1px solid var(--dark-border);
    text-align: center;
    margin-bottom: 1rem; /* Add margin below header */
}

.sidebar-logo {
    max-height: 70px; /* Increased logo size */
    margin-bottom: 0.75rem !important; /* Ensure margin below logo */
}

.sidebar-title {
    margin: 0 0 0.1rem 0; /* Reduced margin below title */
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.6rem; /* Increased title size */
    letter-spacing: -0.5px;
}

.sidebar-subtitle {
    margin: 0;
    color: var(--dark-text-secondary);
    font-size: 0.85rem; /* Slightly smaller subtitle */
}

.sidebar .nav {
    flex-grow: 1; /* Allow nav to fill space */
    padding-top: 1rem;
    /* position: relative; Already added inline in HTML, but good to have here too */
}

#nav-indicator {
    position: absolute;
    left: 0.8rem; /* Slightly adjust position */
    right: 0.8rem; /* Slightly adjust position */
    height: 0; /* Will be set by JS */
    top: 0; /* Will be set by JS */
    background-color: var(--primary-color);
    border-radius: 0.5rem; /* Match nav-link */
    z-index: 0; /* Place behind the nav links text, but above background */
    /* transition: top 0.3s ease-in-out, height 0.3s ease-in-out; */ /* Previous transition */
    transition: top 0.28s cubic-bezier(0.23, 1, 0.32, 1),
                height 0.28s cubic-bezier(0.23, 1, 0.32, 1),
                opacity 0.2s ease-out,
                box-shadow 0.2s ease-out; /* Faster, graceful easeOutQuint-like transition + opacity/shadow */
    opacity: 0.75; /* Slightly more transparent for a 'veil' effect */
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3); /* Subtle shadow */
    pointer-events: none; /* Ensure it doesn't interfere with clicks */
}

.sidebar .nav-link {
    padding: 0.8rem 1.5rem; /* Adjust padding */
    color: var(--dark-text-secondary); /* Default secondary color */
    border-radius: 0.5rem;
    margin: 0.25rem 1rem;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.sidebar .nav-link:hover {
    /* Remove background color change on hover, indicator handles it */
    /* background-color: var(--dark-surface-2); */
    color: var(--text-primary); /* Change text color to primary on hover */
    transform: none;
    box-shadow: none;
    position: relative; /* Needed for z-index to work */
    z-index: 1; /* Ensure text is above the indicator */
}

.sidebar .nav-link.active {
    /* Remove background color, indicator handles it */
    background-color: transparent;
    color: var(--text-on-primary); /* Keep text white */
    font-weight: 600;
    box-shadow: none;
    transform: none;
    position: relative; /* Needed for z-index to work */
    z-index: 1; /* Ensure text is above the indicator */
}

.sidebar .nav-link i {
    margin-right: 1rem; /* More space */
    width: 1.3em;
    text-align: center;
    font-size: 1.1rem; /* Slightly larger icons */
    opacity: 0.8;
    transition: opacity 0.2s ease;
}
.sidebar .nav-link:hover i,
.sidebar .nav-link.active i {
    opacity: 1;
}

.sidebar-footer {
    padding: 1rem 1.5rem; /* Ajustement du padding */
    border-top: 1px solid var(--dark-border);
    background-color: var(--dark-surface-1);
    margin-top: auto; /* Push footer to bottom */
    display: flex; /* Utiliser flexbox */
    flex-direction: column; /* Empiler les éléments */
    align-items: flex-start; /* Aligner à gauche */
}

#connectionStatusContainer {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--dark-text-secondary);
    width: 100%; /* Prendre toute la largeur */
}

.connection-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--danger-color); /* Rouge par défaut (déconnecté) */
    transition: background-color 0.3s ease;
}

.connection-indicator.connected {
    background-color: var(--success-color); /* Vert si connecté */
}

.sidebar-footer .settings-link {
    padding: 0.5rem 0; /* Ajuster padding */
    margin: 0; /* Pas de marge latérale */
    font-size: 0.9rem; /* Taille légèrement augmentée */
    color: var(--dark-text-secondary);
    display: flex;
    align-items: center;
    width: 100%; /* Prendre toute la largeur */
    border-radius: 0.3rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-footer .settings-link:hover {
    color: var(--primary-color);
    background-color: var(--dark-surface-2); /* Léger fond au survol */
    transform: none; /* Pas de transformation */
}

/* Pas besoin de style .active spécifique ici, car il n'est pas dans la nav principale */

/* Main Content */
.main-content {
    padding: 0;
    height: 100vh;
    overflow-y: auto;
}

.content-header {
    padding: 1.75rem 2.5rem 1.5rem; /* Adjusted top padding to match sidebar, kept original bottom/horizontal */
    background-color: var(--dark-surface-1); /* Match sidebar */
    border-bottom: 1px solid var(--dark-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 99;
}

.content-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary); /* Primary text color */
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 0.75rem; /* More gap */
}

/* --- Specific Button Styling for Header --- */
.header-actions .btn {
    padding: 0.6rem 1.2rem; /* Reduced padding */
    text-transform: none; /* Remove uppercase */
    font-size: 0.85rem; /* Slightly smaller font */
    letter-spacing: normal; /* Reset letter spacing */
    /* Inherits hover/active effects from general .btn */
}

.filter-dropdown {
    margin-right: 0.75rem;
}

/* --- Views --- */

.view-container {
    padding: 2.5rem; /* More padding */
}

/* Styles spécifiques pour les filtres du tableau */
.table-filters .btn {
    padding: 0.3rem 0.8rem !important; /* Padding réduit pour btn-sm, !important pour forcer */
    font-size: 0.75rem !important; /* Taille de police réduite, !important pour forcer */
    text-transform: none; /* Assurer que le texte n'est pas en majuscules */
    letter-spacing: normal; /* Assurer l'espacement normal */
}

.table-filters .dropdown-toggle::after {
    margin-left: 0.4em !important; /* Ajuster l'espacement de la flèche dropdown */
}

/* Chat Interface Styles */
.chat-container {
    background: var(--dark-surface-2);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.message {
    max-width: 80%;
    margin-bottom: 1rem;
    padding: 0.8rem 1.2rem;
    border-radius: 1.2rem;
    position: relative;
    animation: fadeIn 0.3s ease-out;
    line-height: 1.4;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-incoming {
    background: var(--dark-surface-3);
    border-bottom-left-radius: 0.3rem;
    align-self: flex-start;
}

.message-outgoing {
    background: var(--primary-color);
    color: var(--text-on-primary);
    border-bottom-right-radius: 0.3rem;
    align-self: flex-end;
}

.message-timestamp {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0.3rem;
    display: block;
}

.chat-input-container {
    padding: 1rem;
    border-top: 1px solid var(--dark-border);
    background: var(--dark-surface-1);
}

.chat-input-container .input-group {
    position: relative;
}

.chat-input {
    width: 100%;
    background: var(--dark-surface-3);
    border: 1px solid var(--dark-border);
    color: var(--text-primary);
    padding: 0.8rem 1.2rem;
    border-radius: 2rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    resize: none;
    min-height: 45px;
    max-height: 120px;
}

.chat-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(95, 39, 205, 0.25);
    outline: none;
}

.send-button {
    position: absolute;
    right: 1.5rem;
    bottom: 1.5rem;
    background: var(--accent-color);
    color: var(--text-on-accent);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.send-button:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.send-button i {
    font-size: 1.1rem;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    padding: 0.5rem 1rem;
    background: var(--dark-surface-3);
    border-radius: 1rem;
    width: fit-content;
    margin-bottom: 1rem;
}

.typing-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: var(--text-secondary);
    border-radius: 50%;
    margin: 0 0.2rem;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingAnimation {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Table View */
.table-responsive {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--dark-border);
}

.table {
    background-color: var(--dark-surface-2);
    color: var(--dark-text);
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%; /* Ensure table takes full width */
    table-layout: fixed; /* Try fixed layout */
}

.table thead { /* Added rule for thead */
    width: 100%;
    display: table-header-group; /* Ensure proper table rendering */
    /* background-color: var(--dark-surface-1); /* Removed background from thead */
}

.table thead tr { /* Added rule for thead > tr */
    width: 100%;
    display: table-row;
}

.table thead th {
    background-color: var(--dark-surface-1); /* Re-added background to th */
    border-bottom: 1px solid var(--dark-border);
    color: var(--primary-color); /* Primary color for headers */
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    padding: 1rem 1.5rem; /* More padding */
    vertical-align: middle;
    white-space: nowrap;
    text-align: left; /* Align left */
}

.table tbody tr {
    background-color: var(--dark-surface-2);
    border-bottom: 1px solid var(--dark-border);
    color: var(--dark-text);
    transition: background-color 0.15s ease;
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table tbody tr:hover {
    background-color: var(--dark-surface-3); /* Hover effect */
}

.table tbody td {
    background-color: transparent;
    color: var(--dark-text);
    padding: 1rem 1.5rem; /* Match header padding */
    vertical-align: middle;
    font-size: 0.9rem;
    text-align: left; /* Align left */
}

.table td, .table th {
    border: none;
}

/* Badges */
.channel-badge, .status-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    line-height: 1; /* Ensure consistent height */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.channel-badge.linkedin { background-color: #0077b5; color: white; }
.channel-badge.facebook { background-color: #1877f2; color: white; }
.channel-badge.twitter { background-color: #1da1f2; color: white; }
.channel-badge.blog { background-color: #ff5722; color: white; }
.channel-badge.youtube { background-color: #ff0000; color: white; }
.channel-badge.instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); color: white; }
.channel-badge.pinterest { background-color: #bd081c; color: white; }
.channel-badge.tiktok { background-color: #000000; color: white; border: 1px solid #fe2c55; } /* Example TikTok style */
.channel-badge.other { background-color: var(--dark-text-secondary); color: var(--dark-bg-secondary); }

.status-badge.draft { background-color: var(--dark-surface-3); color: var(--dark-text-secondary); border: 1px solid var(--dark-border); }
.status-badge.scheduled { background-color: var(--primary-color); color: var(--text-on-primary); }
.status-badge.published { background-color: var(--success-color); color: var(--text-on-accent); }
.status-badge.error { background-color: var(--danger-color); color: white; }
.status-badge.pending { background-color: var(--warning-color); color: var(--dark-base); }
.status-badge.idea { background-color: var(--info-color); color: var(--text-on-accent); }
.status-badge.archived { background-color: var(--dark-surface-1); color: var(--dark-text-secondary); }

/* Table Action Buttons */
.action-btn { /* Cibler la classe spécifique ajoutée dans tableView.js */
    padding: 0.25rem 0.5rem; /* Reduced padding further */
    font-size: 0.8rem; /* Keep reduced font size */
    line-height: 1.2; /* Adjust line height */
    margin: 0 1px; /* Small margin between buttons */
    border-radius: 0.3rem;
    transition: all 0.2s ease-in-out;
    /* Use outline-secondary as base, but customize */
    border: 1px solid var(--dark-border);
    color: var(--dark-text-secondary);
    background-color: transparent;
}

.action-btn:hover {
    background-color: var(--dark-surface-3);
    color: var(--dark-text);
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Specific hover colors */
.action-btn.view-details-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.action-btn.edit-post-btn:hover {
    color: var(--success-color);
    border-color: var(--success-color);
}
.action-btn.delete-post-btn:hover {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

/* Remove or comment out the old .table-actions .btn if no longer needed */
/*
.table-actions .btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    margin-right: 0.3rem;
}
*/
/* Supprimer les lignes errantes */
.table-actions .btn:hover {
    transform: none; /* No translate */
    box-shadow: none;
}
.table-actions .btn i {
    margin-right: 0.3rem;
}

/* Style for post thumbnails in the table */
.post-thumbnail {
    width: 60px; /* Adjust width as needed */
    height: 60px; /* Adjust height as needed */
    object-fit: cover; /* Crop image nicely */
    border-radius: 0.35rem; /* Match badge radius */
    vertical-align: middle; /* Align with text */
    cursor: pointer; /* Indicate it's clickable (shows details) */
    transition: transform 0.2s ease;
}
.post-thumbnail:hover {
    transform: scale(1.1); /* Slight zoom on hover */
}
.post-thumbnail.no-image {
    width: 60px;
    height: 60px;
    background-color: var(--dark-surface-3);
    border: 1px dashed var(--dark-border);
    display: inline-flex; /* Use inline-flex for centering */
    align-items: center;
    justify-content: center;
    color: var(--dark-text-secondary);
    font-size: 1.5rem; /* Larger icon */
    text-align: center;
    line-height: 1;
    cursor: default; /* No pointer for placeholder */
}
.post-thumbnail.no-image:hover {
    transform: none; /* No zoom for placeholder */
}

/* Status Indicator Dot */
.status-indicator {
    display: inline-block;
    width: 12px; /* Size of the dot */
    height: 12px;
    border-radius: 50%; /* Make it round */
    vertical-align: middle; /* Align with the dropdown text */
    flex-shrink: 0; /* Prevent shrinking in flex container */
}

/* Status Indicator Colors (using status classes from helpers.js) */
.status-indicator.status-waiting-for-content { background-color: var(--gray-500); } /* Example: Gray */
.status-indicator.status-needs-approval { background-color: var(--warning-color); } /* Example: Yellow */
.status-indicator.status-approved { background-color: var(--primary-color); } /* Example: Blue */
.status-indicator.status-posted { background-color: var(--success-color); } /* Example: Green */
.status-indicator.status-error { background-color: var(--danger-color); } /* Example: Red */
.status-indicator.status-draft { background-color: var(--dark-text-secondary); } /* Couleur pour le statut par défaut/brouillon */
/* Ajoutez d'autres couleurs de statut ici si nécessaire */

/* Adjust status dropdown width if needed */
.status-select {
    min-width: 150px; /* Ensure dropdown has enough space */
    /* The d-flex on the parent td will handle alignment */
    margin-right: 0.3rem;
}

/* Calendar View */
#calendarView {
    height: calc(100vh - 150px); /* Adjust based on header height */
}

.fc { /* FullCalendar container */
    background-color: var(--dark-surface-2);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--dark-border);
}

/* Calendar Header */
.fc .fc-toolbar.fc-header-toolbar {
    margin-bottom: 1.5rem;
    color: var(--dark-text);
}
.fc .fc-toolbar-title {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.4rem;
}
.fc .fc-button {
    background-color: var(--dark-surface-3);
    border: 1px solid var(--dark-border);
    color: var(--dark-text-secondary);
    text-transform: capitalize;
    box-shadow: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.fc .fc-button:hover {
    background-color: var(--dark-surface-1);
    color: var(--dark-text);
}
.fc .fc-button-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-on-primary);
}
.fc .fc-button-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}
.fc .fc-button-primary:disabled {
    background-color: var(--dark-surface-3);
    border-color: var(--dark-border);
    color: var(--dark-text-secondary);
    opacity: 0.5;
}
.fc .fc-button-active {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--text-on-primary);
}

/* Calendar Body */
.fc .fc-view, .fc .fc-scrollgrid, .fc table {
    border: none; /* Remove default borders */
}
.fc th { /* Day headers */
    background-color: var(--dark-surface-1);
    border: 1px solid var(--dark-border);
    color: var(--dark-text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.75rem 0;
}
.fc td { /* Day cells */
    border: 1px solid var(--dark-border);
}
.fc .fc-daygrid-day {
    transition: background-color 0.2s ease;
}
.fc .fc-daygrid-day:hover {
    background-color: rgba(95, 39, 205, 0.05); /* Subtle primary hover */
}
.fc .fc-day-today {
    background-color: rgba(0, 245, 212, 0.08) !important; /* Accent color for today */
    border-top: 2px solid var(--accent-color);
}
.fc .fc-daygrid-day-number {
    color: var(--dark-text-secondary);
    padding: 0.5em;
    font-weight: 500;
}
.fc .fc-day-today .fc-daygrid-day-number {
    color: var(--accent-color);
    font-weight: 700;
}

/* Calendar Events */
.fc-event {
    border: none;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    margin-bottom: 3px; /* Space between events */
}
.fc-event:hover {
    transform: scale(1.03);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Event Colors (Example - use channel/status logic) */
.fc-event.event-linkedin { background-color: #0077b5; color: white; }
.fc-event.event-facebook { background-color: #1877f2; color: white; }
.fc-event.event-twitter { background-color: #1da1f2; color: white; }
.fc-event.event-blog { background-color: #ff5722; color: white; }
.fc-event.event-youtube { background-color: #ff0000; color: white; }
.fc-event.event-instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); color: white; }
.fc-event.event-pinterest { background-color: #bd081c; color: white; }
.fc-event.event-tiktok { background-color: #000000; color: white; border: 1px solid #fe2c55; }
.fc-event.event-other { background-color: var(--dark-text-secondary); color: var(--dark-bg-secondary); }

.fc-event.status-draft { opacity: 0.7; background-color: var(--dark-surface-3); color: var(--dark-text-secondary); border: 1px dashed var(--dark-border); }
.fc-event.status-scheduled { /* Default style often fine */ }
.fc-event.status-published { background-color: var(--success-color); color: var(--text-on-accent); }
.fc-event.status-error { background-color: var(--danger-color); color: white; }
.fc-event.status-pending { background-color: var(--warning-color); color: var(--dark-base); }
.fc-event.status-idea { background-color: var(--info-color); color: var(--text-on-accent); }
.fc-event.status-archived { opacity: 0.5; background-color: var(--dark-surface-1); color: var(--dark-text-secondary); }

.fc-event .fc-event-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fc-event .fc-event-time {
    font-weight: 600;
    margin-right: 4px;
}

/* --- Modals --- */
.modal-dialog {
    max-width: 700px; /* Wider modals */
}

.modal-content {
    background-color: var(--dark-surface-2);
    border: 1px solid var(--dark-border);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    color: var(--dark-text);
}

.modal-header {
    background-color: var(--dark-surface-1);
    border-bottom: 1px solid var(--dark-border);
    padding: 1.25rem 1.75rem;
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}

.modal-title {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.3rem;
}

.modal-body {
    padding: 1.75rem;
}

.modal-footer {
    background-color: var(--dark-surface-1);
    border-top: 1px solid var(--dark-border);
    padding: 1rem 1.75rem;
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
}

/* --- Forms --- */
.form-label {
    color: var(--dark-text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    background-color: var(--dark-input-bg);
    border: 1px solid var(--dark-border);
    color: var(--dark-text);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    background-color: var(--dark-input-bg);
    border-color: var(--border-color-focus);
    color: var(--dark-text);
    box-shadow: 0 0 0 0.2rem rgba(95, 39, 205, 0.2); /* Primary color focus ring */
    outline: none;
}

.form-control::placeholder {
    color: var(--dark-text-secondary);
    opacity: 0.7;
}

textarea.form-control {
    min-height: 120px;
}

.form-check-input {
    background-color: var(--dark-surface-3);
    border-color: var(--dark-border);
}
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.form-check-input:focus {
    border-color: var(--border-color-focus);
    box-shadow: 0 0 0 0.2rem rgba(95, 39, 205, 0.2);
}
.form-check-label {
    color: var(--dark-text);
}

.invalid-feedback {
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}
.form-control.is-invalid, .form-select.is-invalid {
    border-color: var(--danger-color);
}
.form-control.is-invalid:focus, .form-select.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(249, 49, 84, 0.2); /* Danger color focus */
}

/* --- Settings View --- */
#settingsView .card {
    margin-bottom: 1.5rem;
}
#settingsView .card-header {
    background-color: var(--dark-surface-1);
    color: var(--primary-color);
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--dark-border);
}
#settingsView .card-body {
    padding: 1.5rem;
}

/* --- Prompts View --- */
.prompt-card {
    background-color: var(--dark-surface-2);
    border: 1px solid var(--dark-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.prompt-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}
.prompt-card h5 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-weight: 600;
}
.prompt-card p {
    color: var(--dark-text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}
.prompt-card code {
    background-color: var(--dark-surface-1);
    color: var(--accent-color);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.85em;
}
.prompt-card .btn {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* --- Unscheduled Posts Sidebar --- */
.unscheduled-posts-container {
    background-color: var(--dark-surface-1);
    padding: 1rem;
    border-left: 1px solid var(--dark-border);
    height: 100vh;
    overflow-y: auto;
    position: sticky;
    top: 0;
}
.unscheduled-posts-container h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid var(--dark-border);
    padding-bottom: 0.75rem;
}
#unscheduled-posts-list {
    padding: 0;
    list-style: none;
}
.unscheduled-post-item {
    background-color: var(--dark-surface-2);
    border: 1px solid var(--dark-border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    cursor: grab;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}
.unscheduled-post-item:hover {
    background-color: var(--dark-surface-3);
    box-shadow: var(--shadow-md);
}
.unscheduled-post-item:active {
    cursor: grabbing;
    background-color: var(--primary-color);
    color: var(--text-on-primary);
}
.unscheduled-post-item small {
    display: block;
    line-height: 1.3;
}
.unscheduled-post-item small.text-muted {
    font-size: 0.8em;
    margin-top: 0.25rem;
}

/* --- Image Zoom Modal --- */
#imageZoomModal .modal-dialog {
    max-width: 90vw; /* Allow larger width */
    margin: 1.75rem auto; /* Standard Bootstrap margin */
}
#imageZoomModal .modal-content {
    background-color: rgba(16, 16, 24, 0.9); /* Semi-transparent dark */
    border: none;
    box-shadow: none;
}
#imageZoomModal .modal-header {
    border-bottom: none;
    padding: 0.5rem 1rem; /* Minimal padding */
    position: absolute; /* Position close button */
    top: 10px;
    right: 10px;
    z-index: 10;
}
#imageZoomModal .modal-body {
    padding: 0; /* No padding */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px; /* Minimum height */
}
#zoomedImage {
    max-width: 100%;
    max-height: calc(100vh - 100px); /* Limit height based on viewport */
    display: block;
    margin: auto;
    border-radius: 4px; /* Optional slight rounding */
}
#imageZoomModal .btn-close {
    filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(110%) contrast(100%); /* White */
    opacity: 0.8;
    font-size: 1.5rem;
    padding: 1rem;
}
#imageZoomModal .btn-close:hover {
    opacity: 1;
}

/* --- Utility Classes --- */
.cursor-pointer {
    cursor: pointer;
}

.no-image {
    width: 50px;
    height: 50px;
    background-color: var(--dark-surface-3);
    border: 1px dashed var(--dark-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-text-secondary);
    font-size: 0.8rem;
    text-align: center;
    line-height: 1.2;
}

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px; /* Ensure spinner is visible */
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .content-header {
        padding: 1rem 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .content-header h1 {
        font-size: 1.5rem;
    }
    .header-actions {
        width: 100%;
        justify-content: space-between; /* Spread actions on small screens */
    }
    .view-container {
        padding: 1.5rem;
    }
    .table thead {
        display: none; /* Hide table header on small screens */
    }
    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--dark-border);
        border-radius: 0.5rem;
        padding: 1rem;
    }
    .table tbody td {
        display: block;
        text-align: right; /* Align value to the right */
        padding: 0.5rem 0;
        border-bottom: 1px dashed var(--dark-border-light);
        position: relative;
    }
    .table tbody td:last-child {
        border-bottom: none;
    }
    .table tbody td::before { /* Add label using data attribute */
        content: attr(data-label);
        position: absolute;
        left: 0;
        font-weight: 600;
        color: var(--dark-text-secondary);
        text-align: left;
        padding-right: 1rem; /* Space between label and value */
        white-space: nowrap;
    }
    .table-actions {
        text-align: right; /* Keep actions aligned right */
    }
    .table-actions::before {
        content: ""; /* Remove label for actions */
    }
    #calendarView {
        height: auto; /* Let calendar take natural height */
    }
    .fc .fc-toolbar.fc-header-toolbar {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    .unscheduled-posts-container {
        display: none; /* Hide unscheduled posts sidebar on small screens */
        /* Consider making it a toggleable drawer or modal if needed */
    }
}

/* FullCalendar Customizations */
#calendarView {
    padding: 1.5rem;
    background-color: var(--dark-surface-2);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--dark-border);
    margin-bottom: 2rem;
}

.fc {
    --fc-border-color: var(--dark-border);
    --fc-page-bg-color: var(--dark-surface-2);
    --fc-neutral-bg-color: var(--dark-surface-1);
    --fc-event-selected-overlay-color: rgba(95, 39, 205, 0.3);
    --fc-today-bg-color: rgba(95, 39, 205, 0.1);
    font-family: var(--font-sans);
}

.fc .fc-toolbar-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-text);
    letter-spacing: -0.5px;
}

.fc .fc-button {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    background-color: var(--dark-surface-3);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.fc .fc-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    background-color: var(--dark-surface-1);
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-on-primary);
}

.fc .fc-daygrid-day-number {
    font-weight: 500;
    padding: 8px;
    color: var(--dark-text);
}

.fc .fc-daygrid-day.fc-day-today {
    background-color: var(--fc-today-bg-color);
}

.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
    font-weight: 700;
    color: var(--primary-color);
}

.fc .fc-event {
    border-radius: 4px;
    padding: 2px 4px;
    margin: 1px 0;
    border-width: 1px;
    font-size: 0.85em;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.fc .fc-event:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    z-index: 5;
}

.fc .fc-event-title {
    font-weight: 500;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.fc .fc-list-event {
    background-color: var(--dark-surface-2);
    transition: background-color 0.15s ease;
}

.fc .fc-list-event:hover td {
    background-color: var(--dark-surface-3);
}

.fc .fc-list-day-cushion {
    background-color: var(--dark-surface-1);
    color: var(--primary-color);
}

.fc-theme-standard .fc-list {
    border-color: var(--dark-border);
}

.fc-theme-standard .fc-list-day-side-text {
    color: var(--dark-text-secondary);
}

/* Channel-specific event styling */
.fc-event-linkedin {
    background-color: #0077B5 !important;
    border-color: #005e93 !important;
}

.fc-event-facebook {
    background-color: #1877F2 !important;
    border-color: #0e5fc0 !important;
}

.fc-event-twitter {
    background-color: #1DA1F2 !important;
    border-color: #0c85d0 !important;
}

.fc-event-blog {
    background-color: #FF5722 !important;
    border-color: #e14912 !important;
}

/* Custom Modal Size */
@media (min-width: 1400px) { /* Apply only on larger screens */
    .modal-xxl {
        --bs-modal-width: 1350px; /* Adjust width as needed */
        max-width: var(--bs-modal-width);
    }
}

/* Status indicators in events */
.fc-event-status-waiting {
    border-left: 3px solid var(--warning-color) !important;
}

.fc-event-status-needs-approval {
    border-left: 3px solid #fd7e14 !important;
}

.fc-event-status-approved {
    border-left: 3px solid var(--success-color) !important;
}

.fc-event-status-posted {
    border-left: 3px solid var(--primary-color) !important;
}

/* --- Styles Chatbot --- */

/* Ajuster la hauteur du conteneur de chat dans la vue intégrée */
#chatbotView #chat-container {
    height: calc(100vh - 250px); /* Ajuster selon header + titre + input */
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid var(--dark-border); /* Utiliser variable de bordure */
    border-radius: 0.5rem; /* Utiliser rayon standard */
    margin-bottom: 1rem;
    background-color: var(--dark-surface-2); /* Fond de surface */
}

#chatbotView .message {
    margin-bottom: 1rem;
    padding: 0.75rem 1.25rem; /* Padding légèrement augmenté */
    border-radius: 1rem; /* Plus arrondi */
    max-width: 80%;
    line-height: 1.5;
    word-wrap: break-word; /* Assurer le retour à la ligne */
}

#chatbotView .user-message {
    background-color: var(--primary-color); /* Utiliser couleur primaire */
    color: var(--text-on-primary);
    margin-left: auto;
    border-bottom-right-radius: 0.25rem; /* Moins arrondi sur le coin */
}

#chatbotView .bot-message {
    background-color: var(--dark-surface-3); /* Utiliser surface 3 pour contraste */
    color: var(--text-primary);
    margin-right: auto;
    border-bottom-left-radius: 0.25rem; /* Moins arrondi sur le coin */
}

#chatbotView #input-area {
    display: flex;
    gap: 0.75rem; /* Augmenter l'espace */
}

#chatbotView #user-input {
    /* Hérite des styles .form-control */
}

#chatbotView #send-button {
    /* Hérite des styles .btn .btn-primary */
    flex-shrink: 0; /* Empêcher le bouton de rétrécir */
}

/* --- Styles Interface Chat --- */

/* Styles pour la vue Chat avec historique */
.chat-main-row {
    height: calc(100vh - 240px); /* Encore moins haut */
}

.chat-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%; /* Prend toute la hauteur de la row */
    background-color: var(--dark-surface-1); /* Fond légèrement différent */
}

.sidebar-chat-title {
    color: var(--text-primary);
    font-weight: 600;
}

#chatList {
    flex-grow: 1; /* Prend l'espace restant */
    height: 0; /* Nécessaire pour que overflow-auto fonctionne avec flex-grow */
    background-color: transparent; /* Hérite du parent */
}

#chatList .list-group-item {
    background-color: transparent;
    border: none; /* Pas de bordures individuelles */
    border-bottom: 1px solid var(--dark-border-light); /* Séparateur léger */
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#chatList .list-group-item:last-child {
    border-bottom: none;
}

#chatList .list-group-item:hover {
    background-color: var(--dark-surface-2);
    color: var(--text-primary);
}

#chatList .list-group-item.active {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    font-weight: 500;
}

.chat-delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.2rem 0.5rem;
    margin-left: 0.5rem;
    opacity: 0.6;
    transition: opacity 0.2s ease, color 0.2s ease;
}

#chatList .list-group-item:hover .chat-delete-btn {
    opacity: 1;
}

.chat-delete-btn:hover {
    color: var(--danger-color);
}

.chat-content-area {
    height: 100%; /* Prend toute la hauteur de la row */
    display: flex; /* Pour que #chatInterfaceContainer prenne la hauteur */
    flex-direction: column;
    padding: 0; /* Pas de padding ici, géré par #chatInterfaceContainer */
}

/* Le wrapper n'est plus utilisé, on style directement le container */
/* .chat-content-wrapper { ... } */

#chatInterfaceContainer {
    flex-grow: 1; /* Prend toute la hauteur disponible dans .chat-content-area */
    background-color: var(--dark-surface-2); /* Fond différent de la sidebar */
    border-radius: 0; /* Pas de coins arrondis car il remplit la colonne */
    border: none; /* Pas de bordure car contenu dans la colonne */
    box-shadow: none; /* Pas d'ombre */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#chatList .list-group-item.active .chat-delete-btn {
    opacity: 0.8; /* Toujours visible si l'élément est actif */
}

#chatInterfaceContainer {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 220px); /* Ajuster selon la hauteur du header + padding */
    background-color: var(--dark-surface-1); /* Fond légèrement différent pour délimiter */
    border-radius: 0.75rem;
    border: 1px solid var(--dark-border);
    box-shadow: var(--shadow-inner, inset 0 1px 3px rgba(0,0,0,0.2)); /* Ombre intérieure subtile */
    overflow: hidden; /* Pour contenir les coins arrondis */
}

#chatMessages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem; /* Padding réduit */
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Espace réduit entre les messages */
}

.chat-message {
    display: flex;
    max-width: 75%;
    animation: messageFadeIn 0.4s ease-out forwards;
}

.message-content {
    padding: 0.6rem 0.9rem; /* Padding réduit dans les bulles */
    border-radius: 1rem; /* Coins plus arrondis pour les bulles */
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: var(--shadow-sm);
}

.user-message {
    align-self: flex-end;
    margin-left: auto; /* Pousse à droite */
}

.user-message .message-content {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    border-bottom-right-radius: 0.35rem; /* Style "queue" légèrement ajusté */
}

.bot-message {
    align-self: flex-start;
    margin-right: auto; /* Pousse à gauche */
}

.bot-message .message-content {
    background-color: var(--dark-surface-3);
    color: var(--text-primary);
    border-bottom-left-radius: 0.35rem; /* Style "queue" légèrement ajusté */
}

/* Styles pour l'indicateur de frappe intégré aux messages */
.typing-indicator.message-content {
    padding: 0.75rem 1rem; /* Padding similaire aux bulles de message */
    display: inline-block; /* Pour qu'il ne prenne pas toute la largeur */
    background-color: var(--dark-surface-3); /* Même fond que les messages bot */
}

.typing-indicator { /* Garder pour l'animation des spans */
    display: flex;
    align-items: center;
}

.typing-indicator span { /* Cibler les spans dans le nouveau contexte */
    height: 10px; /* Plus gros */
    width: 10px; /* Plus gros */
    margin: 0 3px; /* Un peu plus d'espacement */
    background-color: var(--text-primary); /* Plus visible (blanc cassé) */
    border-radius: 50%;
    display: inline-block;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.typing-indicator span:nth-child(3) { animation-delay: 0s; }

#chatInputContainer {
    display: flex;
    padding: 0.75rem; /* Padding réduit pour la zone d'input */
    border-top: 1px solid var(--dark-border);
    background-color: var(--dark-surface-1); /* Match container background */
    gap: 0.75rem;
}

#chatInput {
    flex-grow: 1;
    background-color: var(--dark-input-bg);
    color: var(--text-primary);
    border: 1px solid var(--dark-border);
    border-radius: 0.5rem;
    padding: 0.6rem 0.9rem; /* Padding réduit pour l'input */
    resize: none; /* Empêcher le redimensionnement manuel */
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#chatInput:focus {
    outline: none;
    border-color: var(--border-color-focus);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25); /* Utiliser --primary-rgb si défini, sinon couleur fixe */
}

#chatSendBtn {
    flex-shrink: 0; /* Empêcher le bouton de rétrécir */
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--text-on-accent);
    padding: 0.6rem; /* Padding réduit pour le bouton */
    line-height: 1;
    width: 42px; /* Taille réduite */
    height: 42px; /* Taille réduite */
    font-size: 1.2rem; /* Taille de l'icône */
}

#chatSendBtn:hover {
    opacity: 0.9;
    background-color: var(--accent-color); /* Garder la même couleur au survol */
    border-color: var(--accent-color);
    color: var(--text-on-accent);
}

#chatSendBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Animations --- */

@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0);
    } 40% {
        transform: scale(1.0);
    }
}

/* Scrollbar Styling (Optionnel, pour Webkit) */
#chatMessages::-webkit-scrollbar {
    width: 8px;
}

#chatMessages::-webkit-scrollbar-track {
    background: var(--dark-surface-1);
    border-radius: 4px;
}

#chatMessages::-webkit-scrollbar-thumb {
    background-color: var(--dark-surface-3);
    border-radius: 4px;
    border: 2px solid var(--dark-surface-1); /* Crée un effet de padding */
}

#chatMessages::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

/* Style pour les inputs dans les modales sombres */
.form-control-dark {
    background-color: var(--dark-surface-3);
    color: var(--text-primary);
    border: 1px solid var(--dark-border);
}
.form-control-dark:focus {
    background-color: var(--dark-surface-3);
    color: var(--text-primary);
    border-color: var(--border-color-focus);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
}

/* Forcer un z-index élevé pour les modales pour éviter les problèmes de superposition */
.modal {
    z-index: 1060 !important; /* Légèrement supérieur au backdrop (1050 par défaut) */
}
.modal-backdrop {
     z-index: 1050 !important; /* Assurer que le backdrop est derrière */
}

/* Styles pour la notification Annuler/Undo */
.undo-notification {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  max-width: 400px; /* Limite la largeur pour une meilleure lisibilité */
  /* Styles de base déjà appliqués via JS (position, z-index, etc.) */
  /* Vous pouvez ajouter d'autres styles ici : couleur de fond spécifique, bordure, etc. */
  background-color: #cfe2ff; /* Exemple: Bleu clair Bootstrap info */
  border-color: #b6d4fe;
  color: #084298;
  /* Assurez-vous que les classes alert et alert-info sont définies si vous ne les importez pas */
  padding: 1rem 1.5rem;
  border-radius: 0.375rem; /* Bootstrap default */
  box-shadow: var(--shadow-md);
}

/* Style pour l'état visible (après animation d'entrée) */
/* Le JS gère directement l'opacity et transform pour l'apparition */

/* --- Styles spécifiques à la vue Prompts --- */
.prompt-card .card-title {
    font-size: 1.5rem; /* Augmenter la taille du titre */
    font-weight: 600; /* Rendre un peu plus gras */
    color: var(--primary-color); /* Utiliser la couleur primaire pour le titre */
    margin-bottom: 1rem; /* Ajouter un peu d'espace en dessous */
}

/* --- Styles pour les événements FullCalendar (Améliorations Visuelles) --- */
.fc-event {
    padding: 5px 8px !important; /* Augmenter le padding */
    font-size: 0.9rem !important; /* Augmenter légèrement la taille de police */
    cursor: pointer;
    border-width: 2px !important; /* Bordure plus épaisse */
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.fc-event:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Permettre le retour à la ligne dans la vue mois si nécessaire */
.fc-daygrid-event {
    white-space: normal !important; 
}

/* Conteneur interne pour l'icône et le titre */
.fc-event-main-content {
    display: flex;
    align-items: center;
    overflow: hidden; /* Empêche le contenu de déborder */
    text-overflow: ellipsis; /* Ajoute ... si le texte est trop long */
    white-space: nowrap; /* Empêche le retour à la ligne du conteneur flex lui-même */
}

/* Style de l'icône dans l'événement */
.fc-event-main-icon {
    font-size: 1.1em; /* Taille de l'icône relative à la police de l'événement */
    opacity: 0.9;
    flex-shrink: 0; /* Empêche l'icône de rétrécir */
}

/* Style du texte du titre dans l'événement */
.fc-event-title-text {
    overflow: hidden; /* Cache le texte qui dépasse */
    text-overflow: ellipsis; /* Ajoute ... */
    white-space: nowrap; /* Empêche le retour à la ligne du titre */
    flex-grow: 1; /* Permet au titre de prendre l'espace restant */
    min-width: 0; /* Nécessaire pour que text-overflow fonctionne dans un flex item */
}

/* Style spécifique pour les événements non planifiés */
.fc-event-unscheduled {
    font-style: italic;
    opacity: 0.8;
}
.fc-event-unscheduled .fc-event-main-icon {
    color: #777; /* Icône plus grise pour non planifié */
}

/* --- Amélioration Visuelle Boutons Header --- */
.header-actions .btn {
    transition: all 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease; /* Ajout transition pour filter */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* Ombre initiale légère */
}

.header-actions .btn:hover {
    box-shadow: 0 4px 8px rgba(var(--primary-rgb), 0.3); /* Ombre primaire au survol */
    filter: brightness(1.1); /* Léger éclaircissement au survol */
    transform: translateY(-2px); /* Garder l'effet de lévitation */
}

.header-actions .btn:active {
    filter: brightness(0.95); /* Léger assombrissement au clic */
    transform: translateY(0px); /* Retour à la position initiale */
    box-shadow: 0 1px 2px rgba(0,0,0,0.2); /* Ombre réduite au clic */
}

/* Style spécifique pour le bouton Importer URL */
#autoAddPostBtn {
    background-color: var(--dark-surface-3); /* Fond légèrement différent */
    border-color: var(--accent-color); /* Bordure accentuée */
    color: var(--accent-color); /* Texte accentué */
}

#autoAddPostBtn:hover {
    background-color: rgba(var(--accent-rgb), 0.15); /* Fond accentué léger au survol */
    color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 4px 8px rgba(var(--accent-rgb), 0.3); /* Ombre accentuée */
    filter: brightness(1.1);
}

#autoAddPostBtn:active {
    background-color: rgba(var(--accent-rgb), 0.2);
    filter: brightness(0.95);
}

/* Style spécifique pour le bouton Nouvelle Publication */
#newPostBtn {
    /* Utilise les styles .btn-primary par défaut mais hérite des effets de survol/actif ci-dessus */
}
