/* ===== STYLES POUR LE GESTIONNAIRE DE TÂCHES GOOGLE TASKS ===== */

.appointment-item.error {
    background: linear-gradient(135deg, #fef2f2 0%, #fefefe 100%);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.appointment-item {
    animation: slideIn 0.4s ease;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 10px;
    }

    .appointment-header {
        padding: 12px 15px;
    }

    .appointment-header h4 {
        font-size: 14px;
    }

    .appointment-details {
        padding: 15px;
    }

    .invitees-section {
        padding: 12px;
    }
}

/* ==========================================
   BOUTONS D'ACTION AMÉLIORÉS
   ========================================== */

.ai-analyze-btn {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 20px;
}

.ai-analyze-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.ai-analyze-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==========================================
   INDICATEURS DE PRIORITÉ
   ========================================== */

.appointment-item[data-priority="1"] .appointment-header {
    background: linear-gradient(135deg, #fef3c7, #f8fafc);
    border-left: 4px solid #f59e0b;
}

.appointment-item[data-priority="1"] .appointment-header h4::before {
    content: "🎯 ";
}

.appointment-item[data-priority="2"] .appointment-header {
    background: linear-gradient(135deg, #dbeafe, #f8fafc);
    border-left: 4px solid #3b82f6;
}

.appointment-item[data-priority="2"] .appointment-header h4::before {
    content: "📋 ";
}

.appointment-item[data-priority="3"] .appointment-header {
    background: linear-gradient(135deg, #f3e8ff, #f8fafc);
    border-left: 4px solid #8b5cf6;
}

.appointment-item[data-priority="3"] .appointment-header h4::before {
    content: "📝 ";
}


/* Container principal pour les transitions */
.email-content {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animations de glissement */
@keyframes slideInFromRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToRight {
    0% {
        transform: translateX(0);
        opacity: 1;
    }

    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideOutToLeft {
    0% {
        transform: translateX(0);
        opacity: 1;
    }

    100% {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* Classes d'animation */
.slide-in-right {
    animation: slideInFromRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-in-left {
    animation: slideInFromLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-out-right {
    animation: slideOutToRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-out-left {
    animation: slideOutToLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Animation pour les actions */
@keyframes actionPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.action-pulse {
    animation: actionPulse 0.6s ease-out;
}

/* Indicateurs de direction */
.direction-indicator {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(59, 130, 246, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 24px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
    user-select: none;
}

.direction-indicator.left {
    left: 20px;
}

.direction-indicator.right {
    right: 20px;
}

.direction-indicator.show {
    opacity: 1;
}

/* Respect des préférences d'accessibilité */
@media (prefers-reduced-motion: reduce) {

    .slide-in-right,
    .slide-in-left,
    .slide-out-right,
    .slide-out-left,
    .action-pulse {
        animation: none;
    }
}

/* ==========================================
   STYLES POUR TASKS - VERSION RESPONSIVE COMPLÈTE
   ========================================== */

.navbar-button.tasks {
    background: #10b981;
    color: white;
}

.navbar-button.tasks:hover {
    background: #059669;
}

/* ===== INDICATEUR DE CHARGEMENT DETAIL EMAIL ===== */

.loading-email-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--gray-50);
    border-radius: 8px;
    margin: 20px;
    gap: 15px;
}

.loading-email-detail .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-email-detail .spinner-text {
    font-size: 16px;
    color: var(--gray-600);
    font-weight: 500;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ==========================================
   GESTIONNAIRE DE TÂCHES GOOGLE TASKS
   CSS RÉORGANISÉ ET OPTIMISÉ
   ========================================== */

/* ===== OVERLAY ET MODAL BASE ===== */
.tasks-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tasks-overlay.show {
    display: flex;
}

.tasks-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 100%;
    height: 90vh;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Sur de très grands écrans, centrer le modal verticalement aussi */
@media (min-height: 900px) {
    .tasks-overlay {
        align-items: center;
    }
}

/* ===== HEADER ===== */
.tasks-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-shrink: 0;
}

.tasks-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.tasks-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tasks-refresh-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.tasks-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(180deg);
}

.tasks-close {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.tasks-close:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.05);
}

/* ===== CONTENU PRINCIPAL ===== */
.tasks-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Important pour que flex fonctionne */
    overflow: hidden;
}

/* ===== LAYOUT PRINCIPAL ===== */
.tasks-layout {
    flex: 1;
    display: flex;
    min-height: 0; /* Important pour que flex fonctionne */
    overflow: hidden;
    position: relative; /* Important pour positionner la sidebar */
}

/* ===== SIDEBAR ESPACES ===== */
.tasks-sidebar {
    width: 320px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    margin: 0;
    color: #334155;
    font-size: 1rem;
    font-weight: 600;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* ===== LISTE DES ESPACES ===== */
.spaces-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #64748b;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.space-item {
    padding: 12px 15px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.space-item:hover {
    background: #f0f9ff;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.space-item.selected {
    background: #dbeafe;
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.space-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.space-type {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== CONTENU PRINCIPAL TÂCHES ===== */
.tasks-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    margin-right: 0;
    transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Adaptation pour layout 3 colonnes avec sidebar commentaires */
.tasks-layout.with-comments-sidebar .tasks-main {
    border-right: 1px solid #e2e8f0;
    margin-right: 350px; /* Même largeur que la sidebar */
    transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.space-title {
    margin: 0;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

.main-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tasks-filter-section {
    display: flex;
    align-items: center;
}

.hide-completed-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #64748b;
    user-select: none;
}

.hide-completed-toggle input[type="checkbox"] {
    accent-color: #3b82f6;
    transform: scale(1.1);
    cursor: pointer;
}

.toggle-text {
    font-weight: 500;
}

/* Dropdown pour les détails de la liste */
.main-header-dropdown {
    position: relative;
    flex: 1;
    min-width: 0;
}

.list-dropdown-btn {
    width: 100%;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
    transition: all 0.2s ease;
}

.list-dropdown-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.list-dropdown-btn:active {
    background: #e2e8f0;
}

.list-title {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.dropdown-icon {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.list-dropdown-btn.active .dropdown-icon {
    transform: rotate(180deg);
}

.list-details-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 6px 6px;
    margin-top: -1px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
}

.list-details-content {
    padding: 12px 14px;
    font-size: 0.85rem;
    color: #475569;
}

.list-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.list-detail-row:last-child {
    border-bottom: none;
}

.list-detail-label {
    font-weight: 500;
    color: #64748b;
    min-width: 80px;
}

.list-detail-value {
    text-align: right;
    color: #1e293b;
    max-width: 200px;
    word-break: break-word;
}

.list-recipients {
    margin-top: 8px;
    padding: 8px 0;
    border-top: 1px solid #f1f5f9;
}

.list-recipients-label {
    font-weight: 500;
    color: #64748b;
    margin-bottom: 6px;
    display: block;
}

.recipient-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.recipient-tag {
    display: inline-block;
    padding: 3px 8px;
    background: #e0f2fe;
    border: 1px solid #0284c7;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #0369a1;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* ===== LISTE DES TÂCHES ===== */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
    max-height: 100%;
    padding: 5px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 60px 20px;
    color: #64748b;
    text-align: center;
}

.empty-state-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.empty-state-title {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.empty-state-text {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}

/* ===== AFFICHAGE DES TÂCHES ===== */
.tasks-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 0 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.tasks-section-header h4 {
    margin: 0;
    color: #1e293b;
    font-size: 1rem;
    font-weight: 600;
}

.tasks-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.task-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.task-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
    /* ✅ LIMITATION : Troncature des titres trop longs */
    min-width: 0; /* Important pour que flex fonctionne avec overflow */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limite à 2 lignes */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    word-break: break-word;
}

.task-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.task-author {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.task-date {
    font-size: 11px;
    color: #94a3b8;
}

.task-preview {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
    margin-top: 4px;
    /* ✅ LIMITATION : Troncature du texte trop long */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limite à 2 lignes */
    line-clamp: 2; /* Propriété standard pour compatibilité */
    -webkit-box-orient: vertical;
    white-space: normal;
}

/* Bouton Gmail dans les tâches */
.task-gmail-link {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gmail-link-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.gmail-link-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.gmail-link-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.gmail-link-btn.secondary {
    background: linear-gradient(135deg, #ea4335, #fbbc05);
    box-shadow: 0 2px 4px rgba(234, 67, 53, 0.2);
}

.gmail-link-btn.secondary:hover {
    background: linear-gradient(135deg, #d93025, #f9ab00);
    box-shadow: 0 4px 8px rgba(234, 67, 53, 0.3);
}

.gmail-link-btn.secondary:active {
    box-shadow: 0 2px 4px rgba(234, 67, 53, 0.2);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.action-btn.small {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
}

.action-btn.primary {
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn.primary:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.action-btn.secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn.secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

/* ===== BOUTONS ===== */
.btn {
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: #4f46e5;
    color: white;
}

.btn-primary:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.btn:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .tasks-modal {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .tasks-overlay {
        padding: 0;
        align-items: stretch;
    }

    .tasks-sidebar {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .tasks-layout {
        flex-direction: column;
    }

    .tasks-sidebar {
        width: 100%;
        max-height: 25vh;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .tasks-main {
        flex: 1;
        min-height: 0;
    }

    .tasks-header {
        padding: 12px 16px;
    }

    .tasks-header h2 {
        font-size: 1.1rem;
    }

    .main-header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .main-content {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .tasks-overlay {
        padding: 0;
        align-items: stretch;
    }

    .tasks-modal {
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
        margin: 0;
    }

    .tasks-header {
        padding: 10px 12px;
    }

    .tasks-header h2 {
        font-size: 1rem;
    }

    .sidebar-header {
        padding: 12px;
    }

    .sidebar-header h3 {
        font-size: 0.9rem;
    }

    .main-header {
        padding: 10px 12px;
    }

    .main-content {
        padding: 12px;
    }
}

/* ===== STYLES POUR LES MODALES SIMPLES ===== */
.simple-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.simple-modal.show {
    display: flex;
}

.simple-modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    min-width: 300px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.simple-modal-content h3 {
    margin: 0 0 20px 0;
    color: var(--text-primary);
    font-size: 1.2em;
    font-weight: 600;
}

.simple-modal-content form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.simple-modal-content label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.simple-modal-content input,
.simple-modal-content textarea,
.simple-modal-content select {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.simple-modal-content input:focus,
.simple-modal-content textarea:focus,
.simple-modal-content select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.simple-modal-content .form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

.simple-modal-content button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.simple-modal-content button[type="button"] {
    background: var(--secondary-bg);
    color: var(--text-secondary);
}

.simple-modal-content button[type="button"]:hover {
    background: var(--border-color);
}

.simple-modal-content button[type="submit"] {
    background: var(--primary-color);
    color: white;
}

.simple-modal-content button[type="submit"]:hover {
    background: var(--primary-hover);
}

/* ===== STYLES POUR LES TÂCHES STRUCTURÉES ===== */

.task-details-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.task-details-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

.task-details-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.task-details-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.task-detail-section {
    margin-bottom: 30px;
}

.task-detail-section h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-full-text {
    background: var(--secondary-bg);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
}

.task-info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.info-label {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 80px;
}

.info-value {
    color: var(--text-primary);
    text-align: right;
    word-break: break-all;
    flex: 1;
    margin-left: 10px;
}

.task-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-detail-actions .action-btn {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
}

/* ===== STYLES POUR MESSAGES ET COMMENTAIRES ===== */

.task-main-message {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border-left: 4px solid var(--primary-color);
}

.task-comments-section {
    margin-top: 25px;
}

.task-comments-section h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.no-comments {
    text-align: center;
    padding: 30px;
    color: #64748b;
    font-style: italic;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
}

/* ===== STYLES CHAT POUR LES COMMENTAIRES ===== */

.task-comments-container .comment-item {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 0;
    clear: both;
    padding: 0 8px;
}

/* Commentaires des autres utilisateurs - À gauche en gris */
.task-comments-container .comment-item.comment-other {
    justify-content: flex-start;
}

.task-comments-container .comment-item.comment-other .comment-bubble {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #374151 !important;
    max-width: 75%;
    border-bottom-left-radius: 6px;
    margin-right: auto;
}

.task-comments-container .comment-item.comment-other .comment-meta {
    color: #64748b !important;
}

/* Commentaires de l'utilisateur actuel - À droite en bleu */
.task-comments-container .comment-item.comment-user {
    justify-content: flex-end;
}

.task-comments-container .comment-item.comment-user .comment-bubble {
    background: #3b82f6 !important;
    border: 1px solid #2563eb !important;
    color: white !important;
    max-width: 75%;
    border-bottom-right-radius: 6px;
    margin-left: auto;
}

.task-comments-container .comment-item.comment-user .comment-meta {
    color: rgba(255, 255, 255, 0.9) !important;
}

.task-comments-container .comment-item.comment-user .comment-meta .comment-author {
    color: rgba(255, 255, 255, 1) !important;
    font-weight: 600;
}

/* Style de la bulle */
.task-comments-container .comment-bubble {
    border-radius: 12px;
    padding: 8px 12px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: all 0.15s ease;
    min-width: 100px;
    word-break: break-word;
    font-size: 13px;
    line-height: 1.4;
}

.task-comments-container .comment-bubble:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

/* Contenu des commentaires */
.task-comments-container .comment-content {
    margin-bottom: 4px;
    word-wrap: break-word;
    white-space: normal;
}

/* Métadonnées des commentaires - style propre */
.task-comments-container .comment-meta {
    font-size: 10px;
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 2px;
    opacity: 0.8;
    margin-top: 4px;
    min-height: 14px;
    flex-wrap: wrap;
    width: 100%;
}

.task-comments-container .comment-author {
    font-weight: 600;
    flex-basis: auto;
}

.task-comments-container .comment-date {
    font-weight: 400;
    flex-shrink: 0;
    color: inherit;
    white-space: nowrap;
    margin-left: auto;
    text-align: right;
}

/* Séparateur visuel entre auteur et date */
.task-comments-container .comment-author::after {
    content: '•';
    margin: 0 4px;
    opacity: 0.6;
    font-weight: normal;
}

/* Responsive : Stack sur mobile si nécessaire */
@media (max-width: 320px) {
    .task-comments-container .comment-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .task-comments-container .comment-author::after {
        display: none;
    }
    
    .task-comments-container .comment-date {
        margin-left: 0;
        text-align: left;
    }
}

/* Ajout d'un petit triangle pour les bulles (optionnel) */
.task-comments-container .comment-item.comment-other .comment-bubble::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 8px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 4px 6px 4px 0;
    border-color: transparent #f8fafc transparent transparent;
}

.task-comments-container .comment-item.comment-user .comment-bubble::before {
    content: '';
    position: absolute;
    right: -6px;
    top: 8px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 4px 0 4px 6px;
    border-color: transparent transparent transparent #3b82f6;
}

/* Responsive design pour mobile */
@media (max-width: 768px) {
    .task-comments-container .comment-item {
        padding: 0 4px;
    }
    
    .task-comments-container .comment-bubble {
        max-width: 85% !important;
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .task-comments-container .comment-content {
        font-size: 12px;
    }
    
    .task-comments-container .comment-meta {
        font-size: 9px;
        gap: 6px;
        flex-wrap: wrap;
    }
    
    /* Masquer les triangles sur mobile pour plus de simplicité */
    .task-comments-container .comment-bubble::before {
        display: none;
    }
}

/* ✅ NOUVEAUX STYLES : Messages système minimalistes */
.system-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    margin: 4px 0;
    font-size: 12px;
    color: #6b7280;
    border-left: 1px solid #e5e7eb;
    background: transparent;
}

.system-icon {
    font-size: 11px;
    opacity: 0.7;
}

.system-text {
    flex: 1;
    font-weight: 400;
}

.system-date {
    font-size: 11px;
    opacity: 0.6;
    margin-left: auto;
}

/* Styles pour les bulles de commentaires (ancien format) */
.comment-bubble.transition {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 8px auto;
    max-width: 80%;
    text-align: center;
    position: relative;
}

.comment-bubble.transition .comment-text {
    color: #0369a1;
    font-style: italic;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.comment-bubble.transition .transition-icon {
    font-size: 16px;
}

.comment-bubble.transition .comment-meta {
    margin-top: 6px;
    color: #0284c7;
    font-size: 11px;
    text-align: center;
}

.task-actions-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.task-actions-section .action-btn {
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.task-actions-section .action-btn.secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.task-actions-section .action-btn.secondary:hover {
    background: #e2e8f0;
    color: #334155;
}

.task-actions-section .action-btn.primary {
    background: var(--primary-color);
    color: white;
}

.task-actions-section .action-btn.primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* ===== SIDEBAR DE DÉTAILS INTÉGRÉE ===== */
.task-details-sidebar {
    width: 350px;
    flex-shrink: 0;
    background: white;
    border-left: 1px solid #e2e8f0;
    display: none;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.task-details-sidebar.visible {
    display: flex;
    opacity: 1;
    transform: translateX(0);
}

/* Responsive pour le panneau de détails */
@media (max-width: 768px) {
    #taskDetailsContainer {
        width: 100% !important;
        right: 0 !important;
    }
    
    .task-details-content {
        padding: 15px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .info-value {
        text-align: left;
        margin-left: 0;
    }

    .task-main-message {
        padding: 15px;
    }

    .comment-item {
        padding: 12px;
    }

    .task-actions-section {
        flex-direction: column;
    }

    .task-actions-section .action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== STYLES POUR LA MODAL DE RÉORGANISATION DES TABS ===== */

/* Modification de l'en-tête des tabs */
.tabs-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.edit-tabs-btn {
    background: #6366f1;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.edit-tabs-btn:hover {
    background: #4f46e5;
    transform: scale(1.05);
}

.add-tab-btn {
    background: #10b981;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.add-tab-btn:hover {
    background: #059669;
    transform: scale(1.05);
}

/* Styles pour la modal de réorganisation */
.tabs-reorder-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tabs-reorder-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.tabs-reorder-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.tabs-reorder-modal-overlay.show .tabs-reorder-modal {
    transform: scale(1);
}

.tabs-reorder-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tabs-reorder-header h3 {
    margin: 0;
    font-size: 18px;
}

.tabs-reorder-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.tabs-reorder-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tabs-reorder-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.reorder-instructions {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.reorder-instructions p {
    margin: 0 0 5px 0;
    font-weight: 500;
    color: #1e293b;
}

.tabs-reorder-container {
    gap: 8px;
}

/* Styles pour les tabs réorganisables */
.reorderable-tab {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin: 8px 0;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
}

.reorderable-tab:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.reorderable-tab.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    cursor: grabbing;
    z-index: 1000;
}

.reorderable-tab.drag-over {
    border-color: #10b981;
    background: #f0fdf4;
}

.reorderable-tab.drag-over-top {
    border-top: 3px solid #10b981;
}

.reorderable-tab.drag-over-bottom {
    border-bottom: 3px solid #10b981;
}

.reorderable-tab-content {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 12px;
}

.tab-drag-handle {
    color: #94a3b8;
    font-size: 18px;
    cursor: grab;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.tab-drag-handle:hover {
    background: #f1f5f9;
    color: #64748b;
}

.reorderable-tab.dragging .tab-drag-handle {
    cursor: grabbing;
}

.tab-info {
    flex: 1;
}

.tab-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.tab-filters-preview {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.tab-position {
    background: #f1f5f9;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Indicateur de drop */
.drop-indicator {
    height: 3px;
    margin: 2px 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.drop-indicator .drop-line {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 2px;
    animation: dropIndicatorPulse 1s ease-in-out infinite;
}

@keyframes dropIndicatorPulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Actions de la modal */
.tabs-reorder-actions {
    background: #f8fafc;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #e2e8f0;
}

.reset-order-btn {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.reset-order-btn:hover {
    background: #d97706;
}

.close-reorder-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.close-reorder-btn:hover {
    background: #059669;
}

/* Responsive pour la modal de réorganisation */
@media (max-width: 768px) {
    .tabs-reorder-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .tabs-reorder-header {
        padding: 15px;
    }
    
    .tabs-reorder-header h3 {
        font-size: 16px;
    }
    
    .tabs-reorder-content {
        padding: 15px;
    }
    
    .reorderable-tab-content {
        padding: 12px;
    }
    
    .tab-drag-handle {
        font-size: 16px;
    }
    
    .tabs-reorder-actions {
        padding: 12px 15px;
        flex-direction: column;
        gap: 8px;
    }
    
    .reset-order-btn,
    .close-reorder-btn {
        width: 100%;
        padding: 10px;
    }
}

/* ===== STYLES POUR LES TÂCHES STRUCTURÉES ===== */

/* Conteneur principal des tâches structurées */
.structured-tasks {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Élément de tâche structurée */
.task-item.structured-task {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.task-item.structured-task:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-blue);
}

.task-item.structured-task.selected {
    border-color: var(--primary-blue);
    background: linear-gradient(135deg, #dbeafe 0%, #f0f9ff 100%);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Statuts visuels */
.task-item.task-pending {
    border-left: 4px solid #f59e0b;
}

.task-item.task-in-progress {
    border-left: 4px solid #3b82f6;
}

.task-item.task-completed {
    border-left: 4px solid #10b981;
    opacity: 0.8;
}

.task-item.task-cancelled {
    border-left: 4px solid #ef4444;
    opacity: 0.6;
}

/* Header de la tâche */
.task-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.task-item.structured-task .task-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    margin: 0;
    flex: 1;
}

.task-priority {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
    color: #64748b;
    white-space: nowrap;
    margin-left: 12px;
}

/* Meta informations */
.task-item.structured-task .task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 12px;
}

.task-status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-status-badge.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.task-status-badge.status-in_progress {
    background: #dbeafe;
    color: #1e40af;
}

.task-status-badge.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.task-status-badge.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.task-date {
    color: #64748b;
    font-size: 11px;
}

/* Description de la tâche */
.task-description {
    background: #f8fafc;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #475569;
    border-left: 3px solid #e2e8f0;
}

/* Informations email */
.task-email-info {
    background: #fefce8;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 3px solid #eab308;
}

.email-subject,
.email-sender {
    font-size: 13px;
    color: #713f12;
    margin: 2px 0;
}

.email-subject strong,
.email-sender strong {
    color: #92400e;
}

/* Date d'échéance */
.task-due-date {
    background: #fef2f2;
    padding: 8px 10px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 13px;
    color: #991b1b;
    border-left: 3px solid #f87171;
}

/* Actions de la tâche */
.task-item.structured-task .task-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.task-item.structured-task:hover .task-actions {
    opacity: 1;
}

.task-item.structured-task .task-actions .action-btn.small {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.task-actions .action-btn.secondary {
    background: #f1f5f9;
    color: #475569;
}

.task-actions .action-btn.secondary:hover {
    background: #e2e8f0;
}

.task-actions .action-btn.success {
    background: #dcfce7;
    color: #166534;
}

.task-actions .action-btn.success:hover {
    background: #bbf7d0;
}

.task-actions .action-btn.success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.task-actions .action-btn.primary {
    background: #dbeafe;
    color: #1e40af;
}

.task-actions .action-btn.primary:hover {
    background: #bfdbfe;
}

.task-actions .action-btn.danger {
    background: #fee2e2;
    color: #991b1b;
}

.task-actions .action-btn.danger:hover {
    background: #fecaca;
}

/* Panneau de détails des tâches structurées */
.structured-task-details {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.structured-task-details .task-detail-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.structured-task-details .task-detail-section h4 {
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-priority-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.status-container,
.priority-container {
    flex: 1;
}

.status-container label,
.priority-container label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    color: #374151;
}

.status-container select,
.priority-container select {
    width: 100%;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #374151;
}

.task-description-content,
.email-info-content,
.due-date-content,
.task-metadata {
    line-height: 1.6;
    font-size: 14px;
}

.task-detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.task-detail-actions .action-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
}

.task-detail-actions .action-btn.secondary {
    background: #f1f5f9;
    color: #475569;
}

.task-detail-actions .action-btn.secondary:hover {
    background: #e2e8f0;
}

.task-detail-actions .action-btn.primary {
    background: var(--primary-blue);
    color: white;
}

.task-detail-actions .action-btn.primary:hover {
    background: var(--primary-blue-hover);
}

.task-detail-actions .action-btn.danger {
    background: var(--danger-red);
    color: white;
}

.task-detail-actions .action-btn.danger:hover {
    background: #dc2626;
}

/* Animation pour les tâches nouvellement créées */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-item.structured-task.new-task {
    animation: slideInFromTop 0.5s ease-out;
}

/* Responsive pour les tâches structurées */
@media (max-width: 768px) {
    .task-title-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .task-priority {
        align-self: flex-start;
        margin-left: 0;
    }
    
    .status-priority-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .task-detail-actions {
        flex-direction: column;
    }
    
    .task-detail-actions .action-btn {
        width: 100%;
        text-align: center;
    }
}

/* ===== MODAL DE CRÉATION DE TÂCHE STRUCTURÉE ===== */

#createStructuredTaskModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

#createStructuredTaskModal .modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
}

#createStructuredTaskModal .modal-header {
    padding: 20px 24px 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#createStructuredTaskModal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

#createStructuredTaskModal .close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #64748b;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#createStructuredTaskModal .close-btn:hover {
    background: #f1f5f9;
    color: #374151;
}

#createStructuredTaskModal .modal-body {
    padding: 0 24px 20px;
}

#createStructuredTaskModal .form-group {
    margin-bottom: 16px;
}

#createStructuredTaskModal .form-label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    font-size: 14px;
}

#createStructuredTaskModal .form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: white;
}

#createStructuredTaskModal .form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#createStructuredTaskModal .form-section {
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #e2e8f0;
}

#createStructuredTaskModal .form-section h4 {
    margin-bottom: 10px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

#createStructuredTaskModal .modal-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

#createStructuredTaskModal .modal-footer .action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#createStructuredTaskModal .modal-footer .action-btn.secondary {
    background: #f1f5f9;
    color: #475569;
}

#createStructuredTaskModal .modal-footer .action-btn.secondary:hover {
    background: #e2e8f0;
}

#createStructuredTaskModal .modal-footer .action-btn.primary {
    background: var(--primary-blue);
    color: white;
}

#createStructuredTaskModal .modal-footer .action-btn.primary:hover {
    background: var(--primary-blue-hover);
}

/* Animation d'apparition de la modal */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#createStructuredTaskModal .modal-content {
    animation: modalFadeIn 0.2s ease-out;
}

/* Responsive pour la modal */
@media (max-width: 768px) {
    #createStructuredTaskModal .modal-content {
        width: 95%;
        max-width: none;
        margin: 20px;
    }
    
    #createStructuredTaskModal .modal-header,
    #createStructuredTaskModal .modal-body,
    #createStructuredTaskModal .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    #createStructuredTaskModal .modal-footer {
        flex-direction: column;
    }
    
    #createStructuredTaskModal .modal-footer .action-btn {
        width: 100%;
    }
}

/* ==========================================
   STYLES COMPLÉMENTAIRES POUR GOOGLE TASKS
   ========================================== */

/* Task lists styles */
.task-lists-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-list-item:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.task-list-item.selected {
    background: #dbeafe;
    border-color: #3b82f6;
}

.list-info h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    color: #1f2937;
}

.list-email {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 2px;
}

.list-count {
    font-size: 0.875rem;
    color: #6b7280;
}

.list-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.task-list-item:hover .list-actions {
    opacity: 1;
}

.btn-icon {
    padding: 4px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.1);
}

.btn-icon.delete:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Task items styles */
.task-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.task-item:hover {
    background: #f9fafb;
}

.task-item.selected {
    background: #dbeafe;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

.task-item.selected:hover {
    background: #bfdbfe;
}

.task-item.completed {
    opacity: 0.6;
}

.task-item.completed .task-title {
    text-decoration: line-through;
}

.task-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.task-content {
    flex: 1;
    cursor: pointer;
}

.task-title {
    font-weight: 500;
    color: #1f2937;
    margin: 0 0 4px 0;
    /* ✅ LIMITATION : Troncature des titres trop longs */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limite à 2 lignes */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    word-break: break-word;
}

.task-notes {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 4px 0;
    /* ✅ LIMITATION : Troncature des notes trop longues */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limite à 2 lignes */
    line-clamp: 2; /* Propriété standard pour compatibilité */
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    word-break: break-word;
}

.task-due {
    font-size: 0.875rem;
    color: #d97706;
    margin: 4px 0;
}

.task-actions {
    display: grid;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.task-item:hover .task-actions {
    opacity: 1;
}

/* ✅ MOBILE : Rendre les actions visibles sur les écrans tactiles */
@media (max-width: 768px), (hover: none) {
    .task-actions {
        opacity: 1 !important;
    }
    
    /* Réduire légèrement la taille des boutons sur mobile */
    .task-actions button {
        padding: 6px 8px;
        font-size: 12px;
    }
}

/* Header styles */
.close-tasks-btn {
    padding: 8px;
    border: none;
    background: none;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 4px;
    color: #6b7280;
    transition: all 0.2s ease;
}

.close-tasks-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #374151;
}

/* Simple modal styles for task management */
.simple-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.simple-modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.simple-modal h3 {
    margin: 0 0 20px 0;
    color: #1f2937;
}

.simple-modal .form-group {
    margin-bottom: 16px;
}

.simple-modal label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
}

.simple-modal input,
.simple-modal textarea,
.simple-modal select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
}

.simple-modal input:focus,
.simple-modal textarea:focus,
.simple-modal select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-actions button {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.modal-actions button[type="submit"] {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.modal-actions button[type="submit"]:hover {
    background: #2563eb;
}

.modal-actions button[type="button"] {
    background: white;
    color: #374151;
}

.modal-actions button[type="button"]:hover {
    background: #f9fafb;
}

/* Animation for pulse effect */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ===== SIDEBAR DES COMMENTAIRES DE TÂCHES ===== */
.task-comments-sidebar {
    width: 350px;
    background: white;
    border-left: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    /* Position absolue pour ne pas prendre d'espace dans le layout */
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    z-index: 10;
    /* Animation de slide depuis la droite */
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* États d'animation de la sidebar */
.task-comments-sidebar.show {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.task-comments-sidebar.hide {
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0; /* Header fixe */
}

.comments-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.comments-content {
    flex: 1; /* Prend tout l'espace disponible entre header et actions */
    overflow-y: auto; /* Scroll uniquement pour le contenu */
    padding: 16px;
    min-height: 0; /* Important pour flexbox */
}

.task-comments-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
    width: 100%;
    box-sizing: border-box;
}

/* ⚠️ STYLES SPÉCIFIQUES À LA SIDEBAR - Ne pas utiliser pour le chat */
.task-comments-sidebar .comment-item.sidebar-style {
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #3b82f6;
}

.task-comments-sidebar .comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.task-comments-sidebar .comment-item.sidebar-style .comment-author {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
}

.task-comments-sidebar .comment-item.sidebar-style .comment-date {
    font-size: 0.75rem;
    color: #6b7280;
}

.task-comments-sidebar .comment-item.sidebar-style .comment-content {
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.comments-actions {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0; /* Zone d'actions fixe en bas */
}

.add-comment-section {
    display: flex;
    gap: 8px;
}

.add-comment-section textarea {
    width: 100%;
    min-height: 60px;
    max-height: 120px; /* Limite la hauteur du textarea */
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.add-comment-section textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.add-comment-section button {
    align-self: flex-end;
    transition: all 0.2s ease;
    min-width: 40px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border-radius: 6px;
}

.comment-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Responsive pour la sidebar des commentaires */
@media (max-width: 1200px) {
    .task-comments-sidebar {
        width: 300px;
    }
}

@media (max-width: 1024px) {
    .task-comments-sidebar {
        position: absolute;
        top: 0;
        right: 0;
        height: 100%;
        z-index: 50;
        box-shadow: -4px 0 8px rgba(0, 0, 0, 0.1);
        /* Garde la même animation depuis la droite */
        transform: translateX(100%);
    }
    
    .task-comments-sidebar.show {
        transform: translateX(0);
    }
    
    .task-comments-sidebar.hide {
        transform: translateX(100%);
    }
}

@media (max-width: 768px) {
    .task-comments-sidebar {
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 100;
        height: 100vh;
        /* Sur mobile, animation depuis la droite aussi */
        transform: translateX(100%);
    }
    
    .task-comments-sidebar.show {
        transform: translateX(0);
    }
    
    .task-comments-sidebar.hide {
        transform: translateX(100%);
    }
    
    /* Overlay sombre pour mobile */
    .task-comments-sidebar.show::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        opacity: 0;
        animation: fadeIn 0.3s ease forwards;
    }
    
    .task-comments-sidebar.hide::before {
        animation: fadeOut 0.3s ease forwards;
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* ==========================================
   STYLES AMÉLIORÉS POUR L'INTERFACE TASKS
   ========================================== */

/* Header amélioré */
.tasks-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.tasks-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.tasks-title {
    margin: 0;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tasks-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-action-btn {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.header-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.header-action-btn.close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.header-action-btn.refresh-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
    animation: refreshSpin 0.6s ease-in-out;
}

@keyframes refreshSpin {
    0% { transform: scale(1.05) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
    100% { transform: scale(1.05) rotate(360deg); }
}

/* Sidebar header amélioré */
.sidebar-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.sidebar-title {
    margin: 0;
    color: #334155;
    font-size: 1rem;
    font-weight: 600;
}

.sidebar-action-btn {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #3b82f6;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.sidebar-action-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    transform: scale(1.05);
}

/* Loading states améliorés */
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    margin: 12px 0 0 0;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Task lists content structure */
.task-lists-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Main header amélioré */
.main-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    gap: 16px;
}

.main-header-left {
    flex: 1;
    min-width: 0;
}

.selected-list-title {
    margin: 0 0 4px 0;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
}

.list-metadata {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #64748b;
}

.tasks-count,
.completed-count {
    font-weight: 500;
}

.metadata-separator {
    color: #d1d5db;
}

.main-header-right {
    flex-shrink: 0;
}

.main-action-btn {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.main-action-btn.create-task-btn {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.main-action-btn.create-task-btn:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.main-action-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Tasks content area */
.tasks-content-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.sidebar-footer-btn {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.sidebar-footer-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Comments header amélioré */
.comments-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.comments-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.comments-close-btn {
    padding: 6px 8px;
    border: none;
    background: none;
    color: #6b7280;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
}

.comments-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #374151;
}

/* Comment textarea amélioré */
.comment-textarea {
    width: 100%;
    min-height: 60px;
    max-height: 120px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.comment-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-actions-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.comment-submit-btn {
    padding: 8px 12px;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    background: #3b82f6;
    color: white;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.comment-submit-btn:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
}

.comment-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Empty states améliorés */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.6;
}

.empty-state-title {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
}

.empty-state-text {
    margin: 0 0 16px 0;
    font-size: 0.875rem;
    line-height: 1.5;
    max-width: 300px;
}

/* Comments empty state */
.comments-empty-state {
    padding: 30px 16px;
}

.comments-content-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== STYLES POUR LES ÉTATS TASKS ===== */

/* État d'erreur Tasks */
.error-state, .warning-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    margin: 20px 0;
}

.error-state .error-icon, .warning-state .warning-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.error-state h5, .warning-state h5 {
    margin: 0 0 12px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
}

.error-state p, .warning-state p {
    margin: 0 0 20px 0;
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 350px;
}

/* Différenciation visuelle entre erreur et avertissement */
.error-state {
    background: linear-gradient(135deg, var(--error-red-light) 0%, #fef2f2 100%);
    border-color: rgba(239, 68, 68, 0.2);
}

.warning-state {
    background: linear-gradient(135deg, var(--warning-orange-light) 0%, #fef3c7 100%);
    border-color: rgba(245, 158, 11, 0.2);
}

.warning-state .warning-icon {
    color: var(--warning-orange);
}

.error-state .error-icon {
    color: var(--error-red);
}

/* Actions pour les états error et warning */
.error-actions, .warning-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.error-actions .btn, .warning-actions .btn {
    min-width: 140px;
}

.error-divider {
    width: 80%;
    border: none;
    border-top: 1px solid var(--gray-300);
    margin: 20px 0 12px 0;
}

.error-hint {
    margin: 0 0 12px 0;
    font-size: 0.85rem;
    color: var(--gray-500);
}

.error-hint strong {
    color: var(--gray-700);
}

/* Loading state pour Tasks */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-state .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   INTERFACE GMAIL ULTRA-SIMPLIFIÉE
   ========================================== */

/* Interface compacte et minimaliste */
.gmail-simple-selector {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    text-align: center;
}

.current-account-display {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--gray-700);
}

.account-select-simple {
    padding: 8px 12px;
    border: 2px solid var(--primary-blue);
    border-radius: var(--radius-md);
    background: white;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-blue);
    cursor: pointer;
    transition: all var(--transition-normal);
    min-width: 120px;
}

.account-select-simple:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.account-select-simple:hover {
    background: var(--primary-blue-light);
}

.gmail-actions-simple {
    display: flex;
    justify-content: center;
}

.btn-confirm-simple {
    background: var(--success-green);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.btn-confirm-simple:hover {
    background: var(--success-green-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.gmail-help-simple {
    text-align: center;
    padding: 8px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}

.gmail-help-simple small {
    color: var(--gray-600);
    font-size: 12px;
}

/* Notification Gmail plus compacte */
.gmail-notification-content {
    animation: slideInGmail 0.3s ease-out;
    max-height: 250px; /* Limiter la hauteur */
    overflow-y: auto;
}

.gmail-notification-body {
    padding: 16px 20px; /* Réduire le padding */
}

/* Responsive pour petits écrans */
@media (max-width: 480px) {
    .current-account-display {
        flex-direction: column;
        gap: 8px;
    }
    
    .account-select-simple {
        font-size: 16px; /* Évite le zoom sur iOS */
        min-width: 140px;
    }
    
    .gmail-notification-content {
        max-height: 180px;
    }
}

/* ==========================================
   MODAL CONTENU EMAIL
   ========================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-out;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1;
}

.modal-container {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 2;
    max-width: 90%;
    max-height: 90vh;
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.modal-body {
    padding: 24px;
}

.email-content-modal {
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.email-content-modal .modal-body {
    overflow-y: auto;
    flex: 1;
}

.email-content-header {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
}

.email-meta-item {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
}

.email-meta-item:last-child {
    margin-bottom: 0;
}

.email-meta-item strong {
    color: #475569;
    min-width: 100px;
    display: inline-block;
}

.email-snippet {
    background: #fef9c3;
    border-left: 4px solid #eab308;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.email-snippet strong {
    color: #854d0e;
    display: block;
    margin-bottom: 6px;
}

.email-snippet p {
    margin: 0;
    color: #713f12;
    font-style: italic;
}

.email-view-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
}

.email-tab {
    background: transparent;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    position: relative;
    bottom: -2px;
}

.email-tab:hover {
    color: #3b82f6;
    background: #f1f5f9;
}

.email-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: #eff6ff;
}

.email-body-container {
    margin-bottom: 16px;
    max-height: 500px;
    overflow-y: auto;
}

.email-body-container > strong {
    color: #475569;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.email-view {
    width: 100%;
}

.email-body {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.email-body.text-view {
    background: #fafafa;
    padding: 24px;
}

.email-body.source-view {
    background: #1e293b;
    color: #e2e8f0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    padding: 12px;
}

.email-body.source-view pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.email-body.source-view code {
    color: #e2e8f0;
    font-family: 'Courier New', Courier, monospace;
}

.email-html-iframe,
.email-iframe {
    width: 100%;
    min-height: 400px;
    max-height: 600px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}

.email-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .email-content-modal {
        max-width: 95%;
        max-height: 95vh;
    }
    
    .email-actions {
        flex-direction: column;
    }
    
    .email-actions button {
        width: 100%;
    }
    
    .email-body {
        max-height: 300px;
        font-size: 13px;
        padding: 12px;
    }
    
    .email-view-tabs {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .email-tab {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .email-html-iframe {
        min-height: 300px;
    }
}

/* Animation d'entrée */
@keyframes slideInGmail {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

