/* Module Replay Filters - Styles CSS */

/* Conteneur principal du formulaire avec affichage en grille 4 colonnes */
.replay-filters-form-grid {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 1fr auto;
    gap: 10px;
    align-items: end;
    padding: 10px;
    background: #eaf4ff;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Styles des champs de formulaire */
.replay-filters-form-grid .form-select,
.replay-filters-form-grid .form-date {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  background-color: #ffffff;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.replay-filters-form-grid .form-select:focus,
.replay-filters-form-grid .form-date:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Styles spécifiques pour le champ de date (input type="date") */
.replay-filters-form-grid input[type="date"] {
  width: 100%;
  max-width: 100%;
  padding: 10px 15px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  background-color: #ffffff;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  box-shadow: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.replay-filters-form-grid input[type="date"]:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.replay-filters-form-grid input[type="date"]:required {
  box-shadow: none;
}

/* Classe has-value pour le champ de date (gestion du placeholder) */
.replay-filters-form-grid input[type="date"].has-value {
  color: #495057;
}

.replay-filters-form-grid input[type="date"]:not(.has-value) {
  color: #6c757d;
}

/* Correctifs spécifiques pour iOS Safari */
/* Fix pour la largeur débordante sur iOS */
.replay-filters-form-grid input[type="date"] {
  min-width: 0;
  box-sizing: border-box;
}

/* Wrapper pour le champ de date avec placeholder simulé */
.date-wrapper {
  position: relative;
  width: 100%;
}

/* Label flottant pour simuler le placeholder sur iOS */
.date-wrapper .date-placeholder {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  pointer-events: none;
  transition: opacity 0.2s;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Masquer le placeholder quand le champ a une valeur ou est focus */
.date-wrapper input[type="date"]:focus + .date-placeholder,
.date-wrapper input[type="date"].has-value + .date-placeholder {
  opacity: 0;
}

/* Icône calendrier dans le placeholder */
.date-placeholder .calendar-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%236c757d" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Sur les navigateurs non-iOS, afficher l'icône en background de l'input */
@supports (-webkit-touch-callout: none) {
  /* iOS Safari uniquement */
  .replay-filters-form-grid input[type="date"] {
    background-image: none;
    padding-right: 15px;
  }
}

@supports not (-webkit-touch-callout: none) {
  /* Non-iOS (Android, Desktop) */
  .replay-filters-form-grid input[type="date"] {
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px 18px;
    padding-right: 10px;
  }

  .date-wrapper .date-placeholder {
    display: none;
  }
}

/* Conteneur des actions (4ème colonne) */
.form-actions.replay-filters-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Bouton submit transformé en icône de rotation */
.rf-submit-icon {
  width: 40px;
  height: 40px;
  border: 1px solid #6c757d;
  border-radius: 6px;
  background-color: #ffffff;
  background-image: url('https://rci.10gitallab.org/themes/custom/bootstrap_barrio/subtheme/img/rotate-solid-black.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  padding: 0;
}

.rf-submit-icon:hover {
  background-color: #f8f9fa;
  border-color: #495057;
  transform: rotate(90deg);
}

.rf-submit-icon:active {
  transform: rotate(180deg);
  background-color: #e9ecef;
}

/* Masquer le bouton reset comme demandé */
.replay-filter-reset {
  display: none !important;
}

/* Responsive pour tablettes */
@media (max-width: 768px) {
  .replay-filters-form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  
  .form-actions.replay-filters-actions {
    grid-column: span 2;
    justify-content: center;
    margin-top: 10px;
  }
}

/* Responsive pour mobiles */
@media (max-width: 576px) {
  .replay-filters-form-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 15px;
  }

  .form-actions.replay-filters-actions {
    grid-column: span 1;
    justify-content: center;
  }

  /* Corrections spécifiques iOS pour mobile */
  .replay-filters-form-grid input[type="date"] {
    font-size: 16px; /* Évite le zoom automatique sur iOS */
    height: auto;
    min-height: 44px; /* Hauteur tactile recommandée iOS */
  }

  /* Assurer que le champ date ne déborde pas */
  .replay-filters-form-grid .form-date,
  .replay-filters-form-grid input[type="date"] {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden;
  }

  /* Wrapper du champ date */
  .date-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
}

/* Styles pour les tags de filtres actifs (existant) */
.replay-filters-tags {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.replay-filters-tags .filter-tag {
  display: inline-flex;
  align-items: center;
  background-color: #0d6efd;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.replay-filters-tags .filter-tag:hover {
  background-color: #0b5ed7;
  color: white;
  text-decoration: none;
}

.replay-filters-tags .filter-tag .remove-tag {
  margin-left: 8px;
  cursor: pointer;
  font-weight: bold;
  background: none;
  border: none;
  color: white;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

.replay-filters-tags .filter-tag .remove-tag:hover {  
  color: #f8f9fa;
}

.replay-filters-tags .clear-all {
  background-color: #6c757d;
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s;
  border: none;
  cursor: pointer;
}

.replay-filters-tags .clear-all:hover {
  background-color: #5a6268;
  color: white;
  text-decoration: none;
}

/* Animation de rotation pour le bouton lors du submit */
@keyframes rotate-submit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.rf-submit-icon.submitting {
  animation: rotate-submit 1s linear infinite;
}
.active-filters{margin-top:.75rem}
.filters-tags{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;font-size: 12px;}
.filters-tags .label{font-weight:600;margin-right:.25rem}
.filter-tag{background:var(--rf-tag);border:1px solid var(--rf-tag-border);border-radius:999px;padding:.25rem .5rem;display:inline-flex;align-items:center;gap:.35rem}
.filter-remove{background:transparent;border:none;color:#000;cursor:pointer;font-size:1rem;line-height:1}
.filter-clear{background:transparent;border:1px solid #666;border-radius:999px;padding:.25rem .6rem;cursor:pointer}
@media (max-width:768px){.replay-filters .filters-form{flex-direction:column;align-items:stretch}.replay-filters .filters-form .form-actions{margin-left:0}}


div#block-filtresreplay {
    border: none;
}
.path-replays div#block-filtresreplay h3 {
  display: none;
}

.path-replays div#block-filtresreplay fieldset {
    padding: 0px !important;
    margin: 0px !important;
}

.form-actions.replay-filters-actions {
    margin: 0px;
}

span.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #055BAA;
}

.filter-remove {
    background: transparent;
    border: none;
    color: #055BAA;
    border: 2px #055BAA solid;
    cursor: pointer;
    padding: 2px;
    font-size: 22px;
    line-height: 14px;
    border-radius: 4px;
}

.filter-clear {
    background: transparent;
    border: 2px solid #055BAA;
    border-radius: 5px;
    padding: 2px 7px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #055BAA;
}

.block-header h3:after {
    content: '';
    display: block;
    height: 5px;
    background-color: #085baa;
    border-radius: 5px;
    margin-left: 20px;
    flex: 1;
}

.block-header h3  {
    display: flex
;
    align-items: center;
    color: #085baa;
    flex: 10;
    margin-top: 40px;
    margin-bottom: 15px;
    font-size: 1.75rem;
}

#block-filtresreplay button#edit-submit {
    background-color: #FFF;
    border: 1px solid #ced4da;
}