/* css/style.css */
body {
  background-color: #f0f0f0;
  margin: 0;
  padding: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.container, .dashboard-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.card {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.card-header {
  background: #007bff;
  color: #fff;
  padding: 10px 15px;
  border-radius: 4px 4px 0 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  border: 1px solid #ddd;
  padding: 8px;
}

.btn {
  display: inline-block;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 4px;
  text-decoration: none;
  color: #fff;
  background-color: #007bff;
}

.btn.primary, .btn-primary { background-color: #007bff; }
.btn.secondary, .btn-secondary { background-color: #6c757d; }
.btn.success, .btn-success { background-color: #28a745; }
.btn.warning, .btn-warning { background-color: #ffc107; color: #000; }
.btn.danger, .btn-danger { background-color: #dc3545; }

/* Styles pour interventions.php */
.dashboard-container {
    display: grid;
    grid-template-columns: minmax(250px, 300px) 1fr;
    gap: 1.5rem;
    padding: 1rem;
    max-width: 100%;
    align-items: start;
}

.filters-card,
.interventions-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filters-form {
    padding: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.reason-cell {
    max-width: 300px;
    white-space: normal;
    word-wrap: break-word;
}

.agent-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.btn-group {
    display: flex;
    gap: 0.25rem;
}

.pagination-container {
    padding: 1rem;
    display: flex;
    justify-content: center;
}

/* Styles pour la modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
}

/* Mobile styles généraux */
@media (max-width: 768px) {
    body {
        font-size: 16px; /* Augmentation de la taille de base du texte pour une meilleure lisibilité */
    }
    
    .container, .dashboard-grid {
        padding: 10px;
    }
    
    /* Fix des tableaux qui dépassent */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        margin-bottom: 1rem;
        width: 100%;
        display: block;
    }
    
    .table {
        font-size: 14px;
        width: 100%;
        min-width: 500px; /* Force le tableau à avoir une largeur minimale */
    }
    
    .table th, .table td {
        padding: 10px 8px;
        white-space: normal;
        word-wrap: break-word;
    }
    
    /* Réduire la largeur des colonnes d'action sur mobile */
    .table td:last-child {
        width: 1%; /* Minimum width */
        white-space: nowrap;
    }
    
    /* Fix des cartes et grilles */
    .dashboard-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filters-card {
        position: sticky;
        top: 1rem;
        z-index: 10;
    }
    
    .dashboard-grid {
        display: grid;
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid .card {
        grid-column: 1 !important;
        width: 100%;
    }
    
    /* Fix pour l'affichage des interventions sur mobile */
    .mobile-friendly-dashboard {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 10px !important;
    }
    
    .mobile-friendly-dashboard .card {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 15px !important;
        grid-column: auto !important;
    }
    
    /* Amélioration des titres et entêtes */
    .card-header {
        padding: 15px;
    }
    
    .card-title {
        font-size: 1.2rem;
        font-weight: bold;
        margin: 0;
    }
    
    h3, h4 {
        font-size: 1.1rem;
        margin-top: 1rem;
        margin-bottom: 0.75rem;
    }
    
    /* Structure des colonnes */
    .row {
        flex-direction: column;
    }
    
    .col-md-6 {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Espacement intérieur des cartes */
    .card .p-3 {
        padding: 15px !important;
    }
    
    /* Maps et géolocalisation */
    #map, #agent-map {
        height: 250px !important;
        margin-bottom: 1rem;
    }
    
    /* Amélioration des boutons et actions */
    .btn, .action-button {
        padding: 12px 16px;
        font-size: 16px;
        text-align: center;
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Boutons de navigation */
    .nav-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .nav-buttons .btn {
        width: 100%;
    }
    
    /* Boutons d'action */
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .action-buttons .action-button, 
    .action-buttons form {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Formulaires */
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-control {
        padding: 12px;
        font-size: 16px;
    }
    
    label.form-label {
        font-size: 16px;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    /* Modales */
    .modal-content {
        width: 95% !important;
        margin: 5% auto;
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    /* Timeline et historique */
    .timeline-item {
        padding-left: 30px;
    }
    
    .timeline-title {
        font-size: 1rem;
    }
    
    /* Badges et statuts */
    .badge {
        font-size: 0.9rem;
        padding: 5px 8px;
    }
    
    /* Images et pièces jointes */
    .attachment-preview img,
    .attachment-preview video {
        max-width: 100%;
        height: auto;
    }
    
    /* Addendums */
    .addendum-item .card-header {
        padding: 10px;
    }
    
    .addendum-item h4 {
        font-size: 1rem;
    }
    
    /* Alertes */
    .alert {
        padding: 15px;
        margin-bottom: 1rem;
        font-size: 15px;
    }
}

/* Ajustements pour les très petits écrans */
@media (max-width: 480px) {
    body {
        font-size: 16px;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .table {
        font-size: 13px;
    }
    
    .table th, .table td {
        padding: 8px 5px;
    }
    
    /* Réduire encore l'espacement */
    .container, .dashboard-grid {
        padding: 8px;
    }
    
    .card .p-3 {
        padding: 12px !important;
    }
}

/* Effet de surbrillance pour les éléments à mettre en évidence */
@keyframes highlight-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 123, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

.highlight-element {
    animation: highlight-pulse 1s ease-in-out infinite;
    border: 2px solid #007bff !important;
    background-color: rgba(0, 123, 255, 0.1) !important;
    transition: all 0.3s ease;
}
