/* /assets/css/chat.css — Estilos ligeros para el chat */
.chat-page{max-width:900px;margin:0 auto; padding-bottom:70px}
.chat-rooms{overflow:hidden}
.chat-rooms-scroll{display:flex;gap:.5rem;overflow-x:auto;padding:.2rem .15rem .4rem;scroll-snap-type:x proximity}
.chat-rooms-scroll::-webkit-scrollbar{height:6px}
.chat-rooms-scroll::-webkit-scrollbar-thumb{background:#d0c7be;border-radius:999px}
.chat-room-btn{appearance:none;border:1px solid #ddd;background:#fff;color:#333;padding:.5rem .7rem;border-radius:.85rem;cursor:pointer;min-width:150px;text-align:left;display:flex;flex-direction:column;gap:.15rem;scroll-snap-align:start;box-shadow:0 2px 6px rgba(0,0,0,.04)}
.chat-room-btn__name{font-weight:600;display:block;color:#2b241f}
.chat-room-btn__desc{font-size:.75rem;color:#6b5b4b}
.chat-room-btn.active{border-color:#6b5b4b;background:#f5efe9;color:#2b241f;font-weight:600;box-shadow:0 6px 16px rgba(107,91,75,.15)}
.chat-box{border:1px solid #e7e1da;background:#fff;border-radius:.8rem;min-height:280px;max-height:52vh;overflow:auto;padding:.6rem;-webkit-overflow-scrolling:touch}
.chat-form{position:sticky;bottom:0;background:#fff;border-top:1px solid #eee;padding:.5rem .1rem}
.chat-input-row{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}
.chat-input-main{display:block}
.chat-input-main input[type="text"]{width:100%;border:1px solid #ccc;border-radius:.6rem;padding:.6rem .8rem}
.chat-input-controls{display:flex;justify-content:space-between;align-items:center;gap:.6rem;margin-top:.35rem}
.chat-input-controls .controls-left{display:flex;gap:.4rem;align-items:center}
.chat-input-controls .controls-right{display:flex;align-items:center}
.chat-input-row .icon-btn,.chat-input-controls .icon-btn{border:1px solid #ddd;background:#fff;color:#333;border-radius:.6rem;padding:.35rem .45rem;cursor:pointer}
.chat-input-row .icon-btn:hover,.chat-input-controls .icon-btn:hover{background:#f7f4ef}
.chat-input-row .icon-btn, .chat-input-controls .icon-btn, .chat-input-controls .btn.btn-primary, .chat-input-main input[type="text"]{height:42px}
.chat-input-controls .btn.btn-primary{display:inline-flex;align-items:center;justify-content:center;padding:.45rem .8rem}
.chat-photo-preview img{max-height:120px;border-radius:.6rem}
.chat-photo-preview .chip{display:inline-flex;align-items:center;gap:.35rem;border:1px solid #ddd;background:#fff;border-radius:.6rem;padding:.25rem .45rem}
.chat-photo-preview .chip button{border:0;background:transparent;cursor:pointer}
.chat-emoji-panel{position:absolute;bottom:3.2rem;right:1rem;background:#fff;border:1px solid #ddd;border-radius:.6rem;box-shadow:0 10px 30px rgba(0,0,0,.15);padding:.35rem;display:none;gap:.15rem;flex-wrap:wrap;max-width:240px;z-index:30}
.chat-emoji-panel button{border:0;background:transparent;font-size:1.1rem;cursor:pointer;line-height:1.2}
.chat-img{max-width:100%;border-radius:.6rem;display:block}
.chat-media-card{border:1px solid #e1d9cf;background:#fff;border-radius:.85rem;padding:.35rem;max-width:260px;display:flex;flex-direction:column;gap:.35rem;cursor:pointer;box-shadow:0 8px 20px rgba(0,0,0,.08);transition:transform .2s ease, box-shadow .2s ease;margin-top:.2rem}
.chat-media-card:hover{transform:translateY(-1px);box-shadow:0 14px 30px rgba(0,0,0,.12)}
.chat-media-card img{width:100%;height:100%;max-height:240px;border-radius:.65rem;object-fit:cover;background:#f4f2ef}
.chat-media-card__hint{font-size:.82rem;color:#5a4338;text-align:center;font-weight:600}
.chat-message{display:flex;gap:.5rem;margin:.35rem 0}
.chat-message--own .chat-bubble{background:#e7f3ea;border-color:#c3e1cc}
.chat-avatar{width:32px;height:32px;border-radius:50%;background:#d6cfc8;color:#2b241f;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:.85rem;flex:0 0 32px;overflow:hidden}
.chat-bubble{background:#f7f4ef;border:1px solid #e9e2da;border-radius:.7rem;padding:.4rem .55rem;flex:1}
.chat-message-header{display:flex;align-items:flex-start;gap:.5rem;color:#665c51;font-size:.8rem;margin-bottom:.15rem}
.chat-message-actions{margin-left:auto;display:flex;gap:.3rem}
.chat-message-actions button{border:1px solid #d6cec6;background:#fff;color:#6b5b4b;border-radius:.4rem;padding:.15rem .35rem;cursor:pointer;font-weight:600;font-size:.75rem}
.chat-message-actions button:hover{background:#f5efe9}
.chat-message-actions .chat-delete{color:#8a2e2e;border-color:#f2b6b6}
.chat-message-actions .chat-delete:hover{background:#fdecec}
.chat-text .mention{color:#1565c0; font-weight:600}
.chat-date-sep{position:relative;text-align:center;margin:.6rem 0;color:#857a6d;font-size:.75rem}
.chat-date-sep::before,.chat-date-sep::after{content:"";display:inline-block;width:22%;height:1px;background:#e1d9cf;vertical-align:middle;margin:0 .6rem}
.chat-load-more{display:block;width:100%;border:1px dashed #c8bfb6;background:#fff;padding:.4rem;border-radius:.6rem;color:#6b5b4b;cursor:pointer}
.chat-status{font-size:.8rem;color:#857a6d;margin:.25rem 0}
.chat-img-modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:1rem;background:rgba(12,9,6,.82);z-index:4000;opacity:0;pointer-events:none;transition:opacity .2s ease}
.chat-img-modal.is-visible{opacity:1;pointer-events:auto}
.chat-img-modal__overlay{position:absolute;inset:0;cursor:zoom-out}
.chat-img-modal__content{position:relative;background:#080604;border-radius:1rem;padding:1rem;max-width:90vw;max-height:85vh;display:flex;flex-direction:column;gap:.75rem;box-shadow:0 30px 90px rgba(0,0,0,.45)}
.chat-img-modal__content img{max-width:80vw;max-height:70vh;border-radius:.9rem;object-fit:contain;background:#111}
.chat-img-modal__close{position:absolute;top:.35rem;right:.35rem;border:0;background:rgba(0,0,0,.45);color:#fff;width:34px;height:34px;border-radius:999px;cursor:pointer;font-size:1.1rem}
.chat-img-modal__download{align-self:flex-start;background:#1c7ed6;color:#fff;text-decoration:none;font-weight:600;font-size:.92rem;padding:.45rem .9rem;border-radius:.6rem}
@media (max-width:600px){
  .chat-box{max-height:60vh}
  .chat-avatar{width:28px;height:28px;font-size:.8rem}
  .chat-bubble{padding:.35rem .5rem}
  .chat-input-controls{
    flex-wrap:wrap;
    align-items:flex-start;
    gap:.4rem;
  }
  .chat-input-controls .controls-right{
    margin-left:auto;
  }
  .chat-input-controls .btn.btn-primary{
    padding:.4rem .8rem;
    min-width:90px;
  }
  .chat-input-controls .icon-btn{padding:.35rem .4rem}
  .chat-emoji-panel{right:.25rem;left:.25rem;max-width:none}
}
@media (max-width:380px){
  .chat-room-btn{padding:.3rem .5rem}
  .chat-input-row input[type="text"]{min-width: 140px}
}
/* Mejoras de legibilidad y líneas largas */
.chat-text{word-break:break-word; overflow-wrap:anywhere}
