/* Main Colors */
:root {
  --primary-color: #3498db;
  --secondary-color: #2c3e50;
  --accent-color: #e74c3c;
  --light-bg: #f8f9fa;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
  --info-color: #3498db;
  --dark-color: #34495e;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #f5f7fa;
  color: #333;
}

/* Adjust Bootstrap's container max-width */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px; /* Slightly larger than Bootstrap default but not too wide */
  }
}

main {
  flex: 1 0 auto;
  padding-bottom: 40px;
}

footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(0,0,0,0.1);
}

/* Card Styling */
.card {
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.075);
  margin-bottom: 1.5rem;
  border: none;
  overflow: hidden;
}

/* Utility class to override overflow for sticky elements */
.overflow-visible {
    overflow: visible !important;
}

/* Exception pour la carte trackTicketBtn - pas d'effet de survol */
#trackTicketBtn.card,
#trackTicketModal .card,
.modal-content.card {
  transition: none;
  transform: none;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.075);
}

/* Effet de survol seulement pour les autres cartes */
.card:not(#trackTicketBtn):not(.modal-content):hover {
  transform: translateY(-2px);
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-weight: 500;
  padding: 1rem 1.25rem;
}

/* Button styling */
.btn {
  border-radius: 0.25rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background-color: #2980b9;
  border-color: #2980b9;
}

.btn-action {
  margin-right: 5px;
}

/* Form Elements */
.form-control {
  border-radius: 0.25rem;
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-label {
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
  display: block;
}

/* Table Styling */
.table thead {
  background-color: var(--light-bg);
}

.table thead th {
  border-top: none;
  border-bottom: 2px solid #e9ecef;
  font-weight: 600;
  color: #555;
}

/* Status and Priority Badges */
.badge {
  font-size: 85%;
  font-weight: 500;
  padding: 0.4em 0.6em;
  border-radius: 0.25rem;
  line-height: normal;
}
.badge.mini{
  font-size: 72%;
}

.status-new { background-color: #0d6efd; }
.status-in-progress { background-color: #0dcaf0; }
.status-waiting-customer { background-color: #ffc107; }
.status-escalated { background-color: #dc3545; }
.status-evolution { background-color: #6c757d; }
.status-closed { background-color: #198754; }

.priority-t1 { background-color: #dc3545; }
.priority-t2 { background-color: #fd7e14; }
.priority-t3 { background-color: #6c757d; }
.priority-t4 { background-color: #0dcaf0; }

/* Page Titles */
h1 {
  color: var(--dark-color);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

/* Responsive Tables */
@media (max-width: 767.98px) {
  .table-responsive-cards {
    border: 0;
  }
  
  .table-responsive-cards thead {
    display: none;
  }
  
  .table-responsive-cards tr {
    display: block;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    background-color: #fff;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
  }
  
  .table-responsive-cards td {
    display: block;
    text-align: right;
    border-bottom: 1px solid #eee;
    padding: 0.75rem 1rem;
  }
  
  .table-responsive-cards td::before {
    content: attr(data-label);
    float: left;
    font-weight: 600;
    color: #555;
  }
  
  .table-responsive-cards td:last-child {
    border-bottom: 0;
  }
}

/* Conversation Styling */
.message-bubble {
  border-radius: 1rem;
  padding: 1rem;
  max-width: 75%;
  position: relative;
  margin-bottom: 1.5rem;
}

.message-user {
  background-color: var(--primary-color);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 0;
}

.message-other {
  background-color: #e9ecef;
  color: #333;
  margin-right: auto;
  border-bottom-left-radius: 0;
}

/* Animation effects - désactivés pour les modals */
.fade-in:not(.modal):not(.modal-backdrop):not(.modal-dialog):not(.modal-content) {
  animation: fadeIn 0.5s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state-icon {
  font-size: 3.5rem;
  color: #ccc;
  margin-bottom: 1rem;
}

.empty-state-text {
  color: #6c757d;
  max-width: 500px;
  margin: 0 auto 1.5rem;
}

/* Fix for Reopen button text color on hover */
.btn-outline-warning:hover {
  color: #fff !important;
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1100;
}
.toast {
  min-width: 300px;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}
/* Modal styles */
.modal {
  z-index: 1060;
}
/* Suppression du style modal-backdrop car nous supprimons cet élément */
.toast-success {
  background-color: rgba(25, 135, 84, 0.9);
  color: white;
}
.toast-danger, .toast-error {
  background-color: rgba(220, 53, 69, 0.9);
  color: white;
}
.toast-warning {
  background-color: rgba(255, 193, 7, 0.9);
  color: #212529;
}
.toast-info {
  background-color: rgba(13, 202, 240, 0.9);
  color: white;
}

/* Message styles */
.conversation {
  max-width: 100%;
}

.conversation img {
  max-width: 100%;
}

.message-attachments {
  max-width: 100%;
}

/* Make sure content doesn't overflow */
.card-body {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;

  .border{
    border-width: 2px !important;
    border-radius: 0 0 .5rem .5rem;
    &.border-warning{
      border-color: var(--bs-warning-bg-subtle) !important;
    }
    &.border-primary{
      border-color: var(--bs-primary-bg-subtle) !important;
    }
    &.border-secondary{
      border-color: #F8F9FA !important;
    }
    &.border-bottom-0{
      border-radius: 0;
    }
    &.card-footer{
      border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
    }
  }
}

.clickup-link:hover {
  text-decoration: underline !important;
}

.clickup-task-id {
  font-family: monospace;
  font-size: 0.875rem;
}

/* Participants Modal */
#current-participants-list {
  max-height: 260px;
  overflow-y: auto;
}
#participantsModal .badge{
  font-size: 70%;
}
#current-participants-list .list-participant {
  padding-right: 1rem;
}
#current-participants-list .list-participant .remove-participant {
  opacity: 0;
  transition: opacity 0.2s;
}
#current-participants-list .list-participant:hover .remove-participant {
  opacity: 1;
}
#participants-list .border-bottom .add-participant {
  opacity: 0;
  transition: opacity 0.2s;
}
#participants-list .border-bottom:hover .add-participant {
  opacity: 1;
}
