/* Variables */
:root {
  --primary-color: #c80000;
  --secondary-color: #2c2e43;
  --success-color: #4bb543;
  --warning-color: #f9c74f;
  --danger-color: #ef476f;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --gray-color: #6c757d;
  --light-gray: #e9ecef;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}

/* Base Styles */
.intervention-container {
  max-width: 1200px;
  margin: 0 auto;
  /* padding: 2rem; */
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--dark-color);
  line-height: 1.6;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--dark-color);
}

h1 {
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.5rem;
  margin: 0;
}

h4 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

p {
  margin: 0 0 1rem;
}

/* Page Header */
.page-header {
  margin-bottom: 2rem;
  text-align: center;
  padding: 1.5rem;
  background: #2c2e43;
  border-radius: var(--border-radius);
}

.page-header h1 {
  margin: 0;
  color: white;
  justify-content: center;
  font-size: 23px;
}

.page-header .subtitle {
  color: white;
  font-size: 12px;
  margin: 0.5rem 0 0;
}

.tabs {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Cards */
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 2rem;
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid #e9ecef;
}

.card:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e9ecef;
  background-color: #f8f9fa;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.card-header.logement {
  padding: 0;
  border-bottom: none;
  background-color: transparent;
}

.card-header i {
  color: var(--primary-color);
  font-size: 1.25rem;
}
.card-header .card-title {
  color: var(--primary-color);
  font-size: 12px;
  padding: 0;
  margin: 0;
}

.cards-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 17px;
}

.logement-card {
  padding: 15px;
  width: 25%;
  border-radius: 7px;
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}
.logement-card .edit-btn {
  padding: 0;
  border: none;
  border-radius: 5px;
  background-color: var(--secondary-color);
}
.logement-card .edit-btn i {
  color: white;
  font-size: 15px;
  padding: 7px;
}
.card-header button {
  color: white;
}
.card-header h3 {
  font-size: 20px;
}

.card-body {
  padding: 1.5rem;
}

/* Info Card */
.info-card .card-body {
  padding: 1.5rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 6px;
  transition: var(--transition);
}

.info-item:hover {
  background: #e9ecef;
  transform: translateY(-2px);
}

.info-item i {
  font-size: 1.5rem;
  color: var(--secondary-color);
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(67, 97, 238, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-label {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-color);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-weight: 500;
  color: var(--dark-color);
  font-size: 1rem;
}

/* Table Styles */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.interventions-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
}

.interventions-table th {
  background-color: #f8f9fa;
  color: var(--gray-color);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  padding: 1rem 1.25rem;
  white-space: nowrap;
  border-bottom: 2px solid #e9ecef;
}

.interventions-table td {
  padding: 1.25rem;
  vertical-align: middle;
  border-bottom: 1px solid #e9ecef;
  transition: var(--transition);
}

.intervention-item:hover td {
  background-color: #f8f9ff;
}

/* Table Cells */
.date-cell {
  white-space: nowrap;
  min-width: 100px;
}

.date {
  font-weight: 600;
  color: var(--dark-color);
}

.time {
  font-size: 0.8rem;
  color: var(--gray-color);
  margin-top: 0.25rem;
}

.intervenant-cell {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 200px;
}

.intervenant-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(67, 97, 238, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary-color);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.intervenant-info {
  line-height: 1.3;
}

.intervenant-info .name {
  font-weight: 500;
  color: var(--dark-color);
}

.intervenant-info .role {
  font-size: 0.8rem;
  color: var(--gray-color);
}

.description-cell .title {
  font-weight: 500;
  color: var(--dark-color);
  margin-bottom: 0.25rem;
}

.description-cell .details {
  font-size: 0.85rem;
  color: var(--gray-color);
}

.status-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.completed {
  background-color: var(--secondary-color);
  color: white;
}

.actions-cell {
  white-space: nowrap;
  text-align: right;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1.5;
}

.btn i {
  font-size: 0.9em;
  color: white;
}

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

.btn-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}

.btn-secondary {
  background-color: white;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
  background-color: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-outline {
  background: transparent;
  color: white !important;
  border: 1px solid #dee2e6;
}

/* .btn-outline:hover {
    background-color: #f8f9fa;
    border-color: #ced4da;
    color: var(--dark-color);
    transform: translateY(-2px);
  } */

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #e9ecef;
  color: var(--gray-color);
  cursor: pointer;
  transition: var(--transition);
  margin-left: 0.5rem;
}
.tickets-filters .ticket-filter {
  color: white;
}
.tickets-filters {
  margin-bottom: 15px;
}
.btn-icon i {
  color: white;
}

.btn-icon:hover {
  background-color: #f8f9fa;
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* Summary Section */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.summary-item {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  border: 1px solid #e9ecef;
}

.summary-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
}

.summary-item.next-rdv {
  display: flex;
  align-items: start;
  gap: 1.25rem;
  background: linear-gradient(135deg, #f0f4ff 0%, #e6ebff 100%);
  border-left: 4px solid var(--primary-color);
}

.summary-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(67, 97, 238, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary-color);
  font-size: 1.5rem;
  flex-shrink: 0;
}

.summary-content .date {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0.25rem 0;
}

.summary-content .time {
  font-size: 0.9rem;
  color: var(--gray-color);
  margin: 0;
}

.summary-item.observations {
  border-left: 4px solid var(--primary-color);
}

.summary-item.recommendations {
  border-left: 4px solid var(--primary-color);
}

.summary-item h4 {
  display: flex;
  align-items: center;
  margin: 0;
  gap: 0.5rem;
  /* color: var(--dark-color); */
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e9ecef;
}

.summary-item h4 i {
  color: var(--secondary-color);
}

.summary-item ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary-item li {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--gray-color);
  font-size: 0.95rem;
  line-height: 1.5;
}

.summary-item li i {
  color: var(--success-color);
  margin-top: 0.2rem;
  flex-shrink: 0;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}
.add-piece {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.modal-bien {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-piece {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}


.modal-content {
  background: white;
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
  .intervention-container {
    /* padding: 1rem; */
  }
  .scroll-btn {
    display: none;
  }

  .form-piece {
    display: block;
  }

  .modal-header {
    border-bottom: none !important;
    
}
  .modal-bien {
    grid-template-columns: none;
  }
  .add-piece {
    display: block;
  }
  .cards-grid {
    flex-direction: column;
    height: 223px;
    overflow: auto;
    padding: 10px;
  }

  .modal-body {
    padding: 0 !important;
    max-height: 50vh;
    overflow-y: auto;
  }

  .modal-content{
    max-height: auto;
  }

  .card-body {
    padding: 10px !important;
  }
  .logement-card {
    min-width: 190px;
  }
  .page-header {
    margin-top: 25px !important;
    padding: 10px !important;
  }

  .card-actions .header-icon {
    display: none;
  }

  .card-actions {
    display: block !important;
  }

  .tab-content.active {
    padding: 0 !important;
    box-shadow: none;
    border: none !important;
  }
  .page-header i {
    display: none;
  }

  .page-header h1 {
    font-size: 1.2rem;
  }

  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .card-header .actions {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }

  .btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.8rem;
  }

  .intervenant-cell {
    min-width: 150px;
  }

  .interventions-table th,
  .interventions-table td {
    padding: 0.75rem;
  }

  .action-buttons {
    flex-direction: column;
  }

  .action-buttons .btn {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .info-grid {
    grid-template-columns: 1fr;
  }

  .intervenant-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .intervenant-avatar {
    display: none;
  }

  .date-cell {
    white-space: normal;
  }

  .description-cell .title,
  .description-cell .details {
    white-space: normal;
    word-break: break-word;
  }

  .actions-cell {
    text-align: left;
    padding-top: 0.5rem;
  }

  .btn-icon {
    margin: 0.25rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.intervention-item {
  animation: fadeIn 0.3s ease-out forwards;
}

/* Print Styles */
@media print {
  .intervention-container {
    padding: 0;
    max-width: 100%;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }

  .action-buttons,
  .btn {
    display: none !important;
  }

  .page-header {
    text-align: left;
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .interventions-table {
    font-size: 0.8rem;
  }
}
.tabs {
  scrollbar-width: thin;
  white-space: nowrap;
  overflow-x: hidden;
  overflow-y: hidden;
  transition: transform 0.3s ease;
  display: flex;
  flex-wrap: nowrap;
  list-style: none;
  padding: 0;
  margin: 0 0 22px 0;
  gap: 10px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 5px !important;
}
.tabs-wrapper {
  position: relative;
}
.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.2);
  border: none;
  padding: 5px 10px;
  cursor: pointer;
}

.scroll-btn.left {
  left: 0;
}

.scroll-btn.right {
  right: 0;
}

.tabs li {
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: #666;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-bottom: none;
  transition: all 0.2s ease;
  margin-bottom: -1px;
  position: relative;
}

.tabs li:hover {
  background: #e8f0fe; /* Bleu très clair au survol */
  color: var(--secondary-color); /* Bleu vif pour le texte au survol */
  transform: none;
}

.tabs li.active {
  background: var(--secondary-color); /* Bleu vif pour l'onglet actif */
  color: #fff; /* Texte blanc */
  border-color: var(--secondary-color); /* Même couleur que le fond */
  border-bottom: 2px solid var(--secondary-color);
  margin-bottom: -2px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Ombre légère pour le relief */
}

.tabs li.active:after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--secondary-color);
}

/* Styles pour les icônes dans les onglets */
.tabs li i {
  margin-right: 8px;
  font-size: 1.1em;
  vertical-align: middle;
}

/* Style pour le conteneur des onglets */
.tabs-container {
  margin-bottom: 2rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* Style pour les en-têtes d'onglets sur mobile */
@media (max-width: 768px) {
  .tabs {
    /* flex-direction: column; */
    border-bottom: none;
    padding: 0;
  }

  .tabs li {
    width: 100%;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: 1px solid #e0e0e0;
  }

  .tabs li:first-child {
    border-top: none;
  }

  .tabs li.active {
    border-bottom: 1px solid #e0e0e0;
  }

  .tab-content {
    border-radius: 0 0 8px 8px;
  }
}

.tab-content {
  display: none;
  padding: 25px 0;
  animation: fadeIn 0.3s ease;
  background: #fff;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-top: -2px;
}

.tab-content.active {
  display: block;
  border-top: none;
  border: 1px solid #e0e0e0;
  border-top: none;
  padding: 25px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.tab-actions {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
}
