/* /assets/css/style.css */

/* --- FONDATIONS ET STYLES GLOBAUX --- */
body {
    /* Ancien: background-color: #f1f5f9; */
    background: linear-gradient(120deg, #f0f4f9 0%, #e6e9f2 100%);
    font-family: 'Inter', sans-serif;
    color: #374151; /* slate-700 */
}

/* --- ANIMATIONS DE PROGRESSION --- */
@keyframes pulse-progress {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.progress-pulse {
    animation: pulse-progress 1s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s ease-in-out infinite;
}

#progress-container {
    transition: all 0.3s ease;
    overflow: hidden;
}

#progress-bar {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

#progress-status {
    transition: opacity 0.3s ease, color 0.3s ease;
}

/* --- NOTIFICATIONS DE MEMOIRE --- */
.memory-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-left: 4px solid #6366f1;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    display: none;
}

.memory-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.memory-notification-content {
    padding: 20px;
}

.memory-notification-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #6366f1;
    font-weight: 600;
}

.memory-notification-header i {
    font-size: 18px;
}

.memory-notification p {
    margin: 0 0 16px 0;
    color: #6b7280;
    line-height: 1.5;
}

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

.memory-notification-actions .btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.memory-notification-actions .btn-primary {
    background: #6366f1;
    color: white;
}

.memory-notification-actions .btn-primary:hover {
    background: #5856eb;
}

.memory-notification-actions .btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.memory-notification-actions .btn-secondary:hover {
    background: #e5e7eb;
}

/* --- NOUVEAU STYLE DE CARTE --- */
.mockup-card {
    background-color: white;
    border-radius: 24px;
    padding: 2rem; /* p-8 */
    box-shadow: 0 10px 25px -5px rgba(66, 153, 225, 0.1), 0 4px 6px -2px rgba(66, 153, 225, 0.05);
    transition: all 0.3s ease-in-out;
}

/* --- NOUVEAUX STYLES DE BOUTONS --- */

/* Boutons principaux avec dégradé */
.btn-gradient-primary {
    background-image: linear-gradient(to right, #4f46e5 0%, #7c3aed 100%); /* indigo-600 to purple-600 */
    color: white;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px -5px rgba(79, 70, 229, 0.4);
}
.btn-gradient-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px -5px rgba(79, 70, 229, 0.5);
}
.btn-gradient-primary:disabled,
.btn-gradient-primary.disabled,
.btn-gradient-primary[disabled] {
    background-image: linear-gradient(to right, #e0e7ff 0%, #ede9fe 100%);
    color: #a5b4fc;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

/* Boutons "pilule" pour la navigation de l'en-tête */
.btn-gradient-pill {
    background-image: linear-gradient(to right, #60a5fa 0%, #818cf8 100%); /* blue-400 to indigo-400 */
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-gradient-pill:hover {
    opacity: 0.9;
    box-shadow: 0 4px 15px -5px rgba(96, 165, 250, 0.4);
}

/* Style pour les labels de téléversement de fichier */
.btn-file-input {
    display: inline-block;
    background-color: #e5e7eb; /* gray-200 */
    color: #374151; /* gray-700 */
    font-weight: 600;
    transition: background-color 0.2s;
}
.btn-file-input:hover {
    background-color: #d1d5db; /* gray-300 */
}

/* Bouton secondaire (ex: Annuler, Arrêter) */
.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-secondary:hover {
    background-color: #e2e8f0;
    color: #334155;
    border-color: #cbd5e1;
}

/* Correction pour le bouton de sauvegarde - éviter qu'il devienne invisible quand désactivé */
.btn-secondary:disabled,
.btn-secondary[disabled] {
    background-color: #f8fafc;
    color: #94a3b8;
    border-color: #e2e8f0;
    opacity: 1 !important; /* Forcer l'opacité à 1 pour garder l'icône visible */
    cursor: not-allowed;
}

/* Style spécifique pour le bouton de sauvegarde */
#save-conversation-btn {
    opacity: 1 !important; /* Toujours visible */
}

#save-conversation-btn:disabled,
#save-conversation-btn[disabled] {
    background-color: #f8fafc !important;
    color: #94a3b8 !important;
    border-color: #e2e8f0 !important;
    opacity: 1 !important; /* Forcer la visibilité même quand désactivé */
    cursor: not-allowed !important;
}

/* --- NOUVEAUX STYLES POUR LES LIENS D'ACTION --- */
.action-link {
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
}
.action-link:hover {
    opacity: 0.8;
    background-color: rgba(255, 255, 255, 0.1);
}
.action-link-primary { 
    color: #3b82f6; 
}
.action-link-primary:hover { 
    background-color: rgba(59, 130, 246, 0.1); 
}
.action-link-rename { 
    color: #f97316; 
}
.action-link-rename:hover { 
    background-color: rgba(249, 115, 22, 0.1); 
}
.action-link-delete { 
    color: #ef4444; 
}
.action-link-delete:hover { 
    background-color: rgba(239, 68, 68, 0.1); 
}

/* --- ANCIENS STYLES (conservés pour compatibilité si besoin) --- */
.card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* --- STYLES SPÉCIFIQUES POUR L'ADMINISTRATION --- */
.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.admin-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid #e2e8f0;
}
.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}
.admin-table tr:hover {
    background-color: #f8fafc;
}

/* Amélioration des champs de formulaire */
input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
    border: 1px solid #d1d5db;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Espacement uniforme pour les sections */
.admin-section {
    margin-bottom: 2rem;
}
.admin-section:last-child {
    margin-bottom: 0;
}
.btn-primary {
    background-color: #4f46e5;
    color: white;
    border: none;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}
.btn-primary:hover {
    background-color: #4338ca;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    transform: translateY(-1px);
}

/* Notifications de mémoire */
.memory-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #3182ce;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    z-index: 1000;
    display: none;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.memory-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.memory-notification-content {
    padding: 16px;
}

.memory-notification-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: #3182ce;
}

.memory-notification-header i {
    margin-right: 8px;
    font-size: 16px;
}

.memory-notification p {
    margin: 0 0 12px 0;
    color: #4a5568;
    font-size: 14px;
    line-height: 1.4;
}

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

.memory-notification-actions .btn {
    font-size: 12px;
    padding: 4px 12px;
}

/* Styles pour la page de profil utilisateur */
.tab-content {
    margin-top: 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.profile-tab {
    transition: all 0.2s ease;
    cursor: pointer;
}

.profile-tab:hover {
    color: #64748b !important;
    border-color: #cbd5e1 !important;
}

/* Animation pour les messages */
@keyframes fade-in {
    from { 
        opacity: 0; 
        transform: translate(-50%, -20px) scale(0.95);
    }
    to { 
        opacity: 1; 
        transform: translate(-50%, 0) scale(1);
    }
}

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

/* Styles pour les toggles/switches */
.peer:checked ~ div {
    background-color: currentColor;
}

/* Améliorations pour les boutons secondaires */
.btn-secondary {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

/* Responsive design pour la page de profil */
@media (max-width: 768px) {
    .grid.grid-cols-1.md\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .flex.justify-between {
        flex-direction: column;
        gap: 1rem;
    }
    
    .flex.justify-between .flex {
        justify-content: center;
    }
}