/* Reset basique */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Corps de la page */
body {
  font-family: 'Roboto', Arial, sans-serif;
  background: linear-gradient(to right, #f1f1f1, #e8f5e9);
  color: #2c3e50;
}

/* Conteneur Bootstrap : on ajoute un peu de style */
.container {
  margin-top: 20px;
}

/* Filtres : zone supérieure */
.filters, .row.g-3 {
  background-color: #fff;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Labels des filtres */
label.form-label {
  font-weight: 500;
  color: #2c3e50;
}

/* Champs de saisie, select, etc. */
input.form-control, select.form-select {
  border: 1px solid #dcdcdc;
  border-radius: 4px;
  transition: border-color 0.2s ease-in-out;
}

input.form-control:focus, select.form-select:focus {
  border-color: #29abe2;
  outline: none;
}

/* Grille des charts */
.charts {
  display: grid;
  grid-template-areas:
    "nouv dept age"
    "sexe sect sect";
  grid-template-columns: 1fr 1fr 1.5fr;
  grid-gap: 16px;
  margin-bottom: 30px;
}

/* Chaque zone chart-box */
.chart-box {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  position: relative;
  transition: transform 0.2s ease-in-out;
}

/* Petit effet au survol de chaque chart-box */
.chart-box:hover {
  transform: translateY(-2px);
}

/* Titres des charts */
.chart-title {
  margin-bottom: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  text-align: center;
}

/* Zones pour chart amCharts */
.chartdiv {
  width: 100%;
  height: 100%;
  min-height: 300px;
  position: relative;
}

#chartSecteurs {
  height: 100%;
  min-height: 400px;
}

.card {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
  background-color: #f8f9fa;
  font-weight: bold;
}

/* On peut préciser des styles spécifiques pour chaque zone */
.chart-box.nouvelles-entreprises  { grid-area: nouv; }
.chart-box.departements          { grid-area: dept; }
.chart-box.age-dirigeant         { grid-area: age; }
.chart-box.sexe-dirigeant        { grid-area: sexe; }
.chart-box.secteurs              { grid-area: sect; }

/* Exemple de style pour le “petit bonhomme” */
/*#chartBonhomme {
  border: 2px dashed #ccc;
  border-radius: 4px;
  background-color: #fafafa;
}*/

/* Améliorations diverses pour la légende (amCharts) : facultatif */


.am5-Legend-marker {
  width: 16px !important;
  height: 16px !important;
  margin-right: 8px !important;
}

/* Apparence des inputs dateRange (si besoin) */
input#dateRange {
  cursor: pointer;
  background-color: #fff;
}

/* Common styling for all chart labels */
.chartdiv .am5-Label text,
.chart-box .am5-Label,
.am5-Legend-label {
  font-family: 'Roboto', Arial, sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #2c3e50 !important;
}

/* Period selection components */
.period-container {
  position: relative;
}

#periodSelect {
  margin-bottom: 0.5rem;
}

/* Styles for reload button */
.reload-button {
    background-color: #0d6efd;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 32px;
    transition: background-color 0.2s;
}

.reload-button:hover {
    background-color: #0b5ed7;
}

.reload-button:active {
    background-color: #0a58ca;
}

.reload-button i {
    margin-right: 6px;
}

/* Disable button during loading */
.reload-button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.65;
}

/*******************************/
/* Assurer l'alignement vertical des éléments */
.row.g-3.align-items-end {
  align-items: flex-end !important;
}

/* Uniformiser la hauteur des selects */
.select2-filter {
  height: 38px !important; /* Correspond à la hauteur Bootstrap */
}

/* Correction pour le conteneur Select2 */
.select2-container--default .select2-selection--single {
  height: 38px !important;
  display: flex !important;
  align-items: center !important;
  border: 1px solid #dcdcdc !important;
  border-radius: 4px !important;
}

/* Alignement des labels */
.form-label {
  margin-bottom: 0.5rem !important; /* Espacement uniforme sous les labels */
}

/* Correction spécifique pour la colonne "Activité principale" */
#activiteSelect + .select2 {
  width: 100% !important; /* Forcer la largeur complète */
}
/* Supprimer l'icône de fermeture dans Select2 */
.select2-container--default .select2-selection--single .select2-selection__clear {
  display: none !important;
}
/* Centrer l'icône de collapse dans les dropdowns Select2 */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%; /* Prendre toute la hauteur du dropdown */
}

/* Style de l'icône de flèche */
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border: none !important; /* Supprimer la bordure par défaut de Select2 */
    margin-left: 0 !important;
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Utiliser une icône Font Awesome pour la flèche */
.select2-container--default .select2-selection--single .select2-selection__arrow::after {
    content: "\f078"; /* Code de l'icône Font Awesome pour une flèche vers le bas */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 12px;
    color: #6c757d; /* Couleur de la flèche */
    position: relative;
    top: 0;
    right: 0;
}

/* Styles for cache status alerts */
.cache-status-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.cache-status-alert.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.cache-status-alert.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.cache-status-alert.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 500px;
}