/* ===== Thème SNCF modernisé ===== */
:root {
  --brand: #CA005D;
  --brand-dark: #6A1B3F;
  --bg-soft: #F4F4F4;
  --ink: #333333;
  --chat-user-bg: linear-gradient(135deg, #CA005D 0%, #6A1B3F 100%);
  --chat-admin-bg: #ffffff;
}

html, body { 
  height: 100%; 
}

body { 
  background: var(--bg-soft); 
  color: var(--ink); 
}

/* ===== NAVBAR ===== */
.navbar.sncftop { 
  background-color: var(--brand); 
}

.navbar.sncftop .nav-link, 
.navbar.sncftop .navbar-brand, 
.navbar.sncftop .navbar-text { 
  color: #fff !important; 
}

.navbar.sncftop .nav-link.active, 
.navbar.sncftop .nav-link:hover { 
  opacity: .9; 
}

.brand-logo { 
  height: 26px; 
  width: auto; 
  margin-right: .5rem; 
  vertical-align: middle; 
}

/* ===== BUTTONS ===== */
.btn-primary { 
  background-color: var(--brand); 
  border-color: var(--brand); 
}

.btn-primary:hover { 
  background-color: var(--brand-dark); 
  border-color: var(--brand-dark); 
}

.btn-outline-primary { 
  color: var(--brand); 
  border-color: var(--brand); 
}

.btn-outline-primary:hover { 
  background-color: var(--brand); 
  color: #fff; 
}

/* ===== BADGES ===== */
.badge-status { 
  font-weight: 500; 
}

/* ===== CARDS ===== */
.card.soft { 
  border: 1px solid #eaeaea; 
  box-shadow: 0 4px 18px rgba(0,0,0,.05); 
}

.card-header.soft { 
  background: #fff; 
  border-bottom: 1px solid #eee; 
}

/* ===== TICKET DETAIL ===== */
.ticket-detail-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ticket-header {
  background: var(--chat-user-bg);
  color: white;
  padding: 2rem;
  border-radius: 8px 8px 0 0;
}

.ticket-status-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 500;
  margin-right: 0.5rem;
}

.info-section {
  padding: 1.5rem;
  border-bottom: 1px solid #e9ecef;
}

.info-section:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 600;
  color: #6c757d;
  font-size: 0.875rem;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.info-value {
  font-size: 1rem;
  color: #212529;
}

/* ===== ATTACHMENTS ===== */
.attachment-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.attachment-icon {
  font-size: 1.5rem;
  margin-right: 0.75rem;
  color: var(--brand);
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ===== CHAT SYSTEM ===== */
#chat-container {
  display: flex;
  flex-direction: column;
  height: 500px;
  background: #f8f9fa;
  border-radius: 0 0 8px 8px;
  border: none;
  border-top: 1px solid #e9ecef;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Message container */
.chat-message {
  display: flex;
  width: 100%;
}

.chat-message.user-message {
  justify-content: flex-end;
}

.chat-message.admin-message {
  justify-content: flex-start;
}

/* Bulle de message */
.chat-bubble {
  max-width: 70%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  background: var(--chat-admin-bg);
  border: 1px solid #dee2e6;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  word-break: break-word;
}

/* Bulle utilisateur (à droite) */
.chat-message.user-message .chat-bubble {
  background: var(--chat-user-bg);
  color: white;
  border: none;
  border-radius: 16px 16px 4px 16px;
}

/* Bulle admin/autre (à gauche) */
.chat-message.admin-message .chat-bubble {
  border-radius: 16px 16px 16px 4px;
}

.chat-author {
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.chat-message.user-message .chat-author {
  color: rgba(255,255,255,0.85);
}

.chat-message.admin-message .chat-author {
  color: var(--brand);
}

.chat-text {
  word-wrap: break-word;
  line-height: 1.5;
  margin-bottom: 0.25rem;
  white-space: pre-wrap;
}

.chat-time {
  font-size: 0.7rem;
  opacity: 0.6;
  text-align: right;
}

/* Zone de saisie */
#chat-input-area {
  padding: 1rem;
  border-top: 1px solid #e9ecef;
  background: white;
  border-radius: 0 0 8px 8px;
}

.chat-input-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

#new-comment {
  flex: 1;
  resize: none;
  border-radius: 16px;
  padding: 0.85rem 1.1rem;
  border: 1px solid #dee2e6;
  min-height: 90px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.6;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#new-comment:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(202, 0, 93, 0.15);
  outline: none;
}

/* Écrase la règle globale textarea.form-control */
#new-comment.form-control {
  min-height: 90px;
}

#btn-add-comment {
  border-radius: 50%;
  width: 46px;
  height: 46px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 2px;
}

#btn-add-comment i {
  margin: 0 !important;
  font-size: 1.1rem;
}

/* Hint raccourci clavier */
.chat-hint {
  font-size: 0.75rem;
  color: #adb5bd;
  margin-top: 0.4rem;
  margin-left: 0.25rem;
}

/* Message vide */
.chat-empty {
  text-align: center;
  color: #6c757d;
  padding: 3rem 1rem;
}

.chat-empty i {
  font-size: 3rem;
  opacity: 0.5;
  display: block;
  margin-bottom: 1rem;
}

/* ===== AUTRES ===== */
.breadcrumb { 
  --bs-breadcrumb-divider: '›'; 
}

.hero-title { 
  font-weight: 700; 
  letter-spacing: .2px; 
}

.hero-sub { 
  color: #6c757d; 
}

.avatar-circle { 
  width: 32px; 
  height: 32px; 
  border-radius: 50%; 
  background: rgba(255,255,255,.25); 
  color: #fff; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-weight: 600; 
}

footer { 
  color: #6c757d; 
}

textarea.form-control { 
  min-height: 140px; 
}

/* ===== SCROLLBAR PERSONNALISÉE ===== */
#chat-messages::-webkit-scrollbar {
  width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  #chat-container {
    height: 400px;
  }
  
  .chat-bubble {
    max-width: 85%;
  }
  
  #chat-messages {
    padding: 1rem;
  }
  
  .ticket-header {
    padding: 1.5rem;
  }
  
  .info-section {
    padding: 1rem;
  }

  #new-comment {
    min-height: 70px;
  }
}
/* =============================================
   CHAT – Actions sur les bulles (édition / suppression)
   Coller dans assets/css/styles.css
   ============================================= */

/* Ancrage des boutons d'action dans la bulle */
.chat-bubble {
  position: relative;
}

/* Boutons cachés par défaut, visibles au survol */
.chat-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 10;
}

.chat-bubble:hover .chat-actions {
  opacity: 1;
  pointer-events: auto;
}

/* Style des boutons icône */
.btn-chat-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  color: #555;
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.1s;
  backdrop-filter: blur(4px);
  line-height: 1;
}

.btn-chat-action:hover {
  background: #fff;
  transform: scale(1.1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.btn-chat-edit:hover {
  color: #0d6efd;
  border-color: #0d6efd;
}

.btn-chat-delete:hover {
  color: #dc3545;
  border-color: #dc3545;
}

/* Zone d'édition inline */
.chat-edit-area {
  margin-top: 6px;
}

.chat-edit-area textarea {
  font-size: 0.88em;
  resize: none;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.chat-edit-area textarea:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
  outline: none;
}

/* Label "modifié" discret après l'heure */
.chat-edited-label {
  font-size: 0.72em;
  color: #999;
  margin-left: 6px;
  font-style: italic;
}
