#deva-chat-container {
    width: 100%;
    /* Augmenté de 800px à 1200px pour plus de largeur */
    max-width: 1000px !important; 
    margin: 20px auto;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    height: 550px;
    overflow: hidden;
    
    /* Optionnel : Si vous voulez qu'il soit encore plus large sur les très grands écrans, 
       vous pouvez mettre max-width: 90%; */
}

#deva-chat-header {
    background: #0055cc; /* Bleu professionnel */
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.deva-header-title {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.deva-badge {
    font-size: 10px;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

#deva-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.deva-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.deva-user {
    align-self: flex-end;
    background-color: #1a203b !important;
    color: #fff;
    border-bottom-right-radius: 2px;
}

.deva-bot {
    align-self: flex-start;
    background: #e9ecef;
    color: #212529;
    border-bottom-left-radius: 2px;
}

.deva-typing-indicator {
    padding: 10px 20px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}

#deva-chat-input-area {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: center;
}

#deva-user-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

#deva-user-input:focus {
    border-color: #0055cc;
}

#deva-send-btn {
    background: #0055cc;
    color: #fff;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#deva-send-btn:hover {
    background: #0044aa;
}

#deva-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}


/* Styles pour le contenu Markdown dans les messages du bot */
.deva-bot p {
    margin: 0 0 10px 0;
}
.deva-bot p:last-child {
    margin-bottom: 0;
}
.deva-bot ul, .deva-bot ol {
    margin: 5px 0;
    padding-left: 20px;
}
.deva-bot strong {
    font-weight: 700;
    color: #0044aa; /* Un bleu un peu plus foncé pour le gras */
}
.deva-bot code {
    background: rgba(0,0,0,0.1);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}
#deva-chat-container {
    /* 1. Largeur fluide : prend 100% de la place disponible... */
    width: 100%; 
    
    /* 2. ... mais ne dépasse jamais 800px sur les grands écrans */
    max-width: 800px; 
    
    /* 3. Centrage horizontal (marche grâce à width: 100% et max-width) */
    margin: 20px auto;
    
    /* 4. Sur mobile, on réduit souvent les marges extérieures pour gagner de la place */
    padding: 0; 
    
    border: 1px solid #e0e0e0;
    border-radius: 16px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.15); 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    
    /* 5. Gestion de la hauteur sur mobile */
    /* Sur PC : 550px fixe. Sur mobile : on prend presque toute la hauteur de l'écran (ex: 80vh) */
    height: 550px; 
    
    overflow: hidden;
}

/* --- MEDIA QUERY SPÉCIALE MOBILE --- */
/* S'applique si l'écran fait moins de 768px de large (tablettes et mobiles) */
@media (max-width: 768px) {
    #deva-chat-container {
        /* On colle le chat aux bords ou on laisse une toute petite marge */
        margin: 10px; 
        width: calc(100% - 20px); /* Ajustement précis si margin 10px */
        max-width: none; /* On annule la limite de 800px */
        
        /* Sur mobile, une hauteur fixe de 550px est souvent trop grande. 
           On utilise 'vh' (viewport height) pour s'adapter à la hauteur de l'écran.
           70vh = 70% de la hauteur de l'écran du téléphone. */
        height: 70vh; 
        
        /* Optionnel : arrondis un peu moins prononcés sur petit écran */
        border-radius: 12px;
    }
}



/* Grille de propriétés */
.deva-properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); /* Cartes un peu plus larges */
    gap: 22px;
    margin-top: 15px;
}

/* Carte individuelle */
.deva-property-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    font-size: 13px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    min-height:300px;
}

.deva-property-card:hover {
    
 
}

/* Image */
.deva-card-img {
    height: 220px;
    background-size: cover;
    background-position: center;
    background-color: #f4f6f8;
    flex-shrink: 0;
}

.deva-no-img {
    background-image: linear-gradient(135deg, #f4f6f8 25%, #e1e4e8 25%, #e1e4e8 50%, #f4f6f8 50%, #f4f6f8 75%, #e1e4e8 75%, #e1e4e8 100%);
    background-size: 20px 20px;
}

/* Corps */
.deva-card-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

/* Titre */
.deva-card-title {
    font-size: 19px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #0b1129;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Max 2 lignes */
    -webkit-box-orient: vertical;
    overflow: hidden;
    
}

/* Ligne méta (Prix | Pièces | Ville) */
.deva-card-meta-line {
    font-size: 12px;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.deva-card-price {
    font-weight: 700;
    color: #6646e8;
    font-size: 18px;
    width: 100%;
    margin-bottom:10px;
}

.deva-card-meta-item {
    display: inline-flex;
    align-items: center;
    color: #666;
    font-size:14px;
    font-weight: bold;
     margin-right: 8px;      /* Espace après le contenu */
    padding-right: 8px;     /* Espace avant la barre */
    border-right: 1px solid #ccc; /* La barre verticale */
}

.deva-card-price:last-child,
.deva-card-meta-item:last-child {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
}


.deva-separator {
    margin: 0 6px;
    color: #ccc;
    font-weight: 300;
}



/* Lien "Voir le bien" */
.deva-card-link {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #6646e8;
    color: white;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 16px;
    transition: background 0.2s, color 0.2s;
    margin-top: auto; /* Pousse le lien vers le bas */
}

.deva-card-link:hover {
    background: #00f0a0;
    color: #0b1129;
}

.deva-card-link svg {
    margin-right: 6px;
    fill: currentColor; /* L'icône prend la couleur du texte */
}

/* Responsive mobile */
@media (max-width: 480px) {
    .deva-properties-grid {
        grid-template-columns: 1fr; /* 1 seule colonne sur mobile */
    }
    .deva-card-img {
        height: 160px; /* Image plus grande sur mobile */
    }
}
