/**
 * @file
 * Styles pour les éléments UI des vues (pager, more link, etc.)
 */

/* ==================== */
/* PAGERS               */
/* ==================== */

.pager {
  margin: 2rem 0;
  text-align: center;
}

.pager__items {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pager__item {
  margin: 0 !important;
}

.pager__item > a,
.pager__item.is-active {
  display: inline-block !important;
  padding: 0.5rem 0.875rem !important;
  min-width: 40px !important;
  min-height: auto !important;
  text-align: center !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
  line-height: 1.4 !important;
  margin: 0 0.25rem !important;
}

/* Liens de navigation */
.pager__item > a {
  background: white !important;
  color: var(--mt-color-primary, #0d75a3) !important;
  border: 1px solid #e0e0e0 !important;
  border-width: 1px !important;
  border-style: solid !important;
}

.pager__item > a:hover {
  background: var(--mt-color-primary, #0d75a3) !important;
  color: white !important;
  border-color: var(--mt-color-primary, #0d75a3) !important;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Page active */
.pager__item.is-active {
  background: var(--mt-color-primary, #0d75a3) !important;
  color: white !important;
  border: 1px solid var(--mt-color-primary, #0d75a3) !important;
  border-width: 1px !important;
  border-style: solid !important;
  font-weight: 600 !important;
  /* Cache le texte "Page X" pour ne garder que le numéro */
  font-size: 0 !important;
  margin: 0 0.25rem !important;
}

.pager__item.is-active::after {
  content: '•';
  font-size: 1.5rem !important;
  line-height: 1 !important;
  display: inline-block;
}

/* Boutons Précédent/Suivant */
.pager__item--previous,
.pager__item--next {
  font-weight: 600 !important;
}

.pager__item--previous > a,
.pager__item--next > a {
  background: var(--mt-color-primary, #0d75a3) !important;
  color: white !important;
  border-color: var(--mt-color-primary, #0d75a3) !important;
  border-width: 1px !important;
  font-size: 1.25rem !important;
  padding: 0.375rem 0.75rem !important;
  line-height: 1.2 !important;
}

.pager__item--previous > a:hover,
.pager__item--next > a:hover {
  background: var(--mt-color-primary-dark, #0b6187) !important;
  border-color: var(--mt-color-primary-dark, #0b6187) !important;
  color: white !important;
}

/* Ellipsis */
.pager__item--ellipsis {
  padding: 0.5rem 0.875rem;
  color: #666;
}

/* Empty view */
.view-empty {
    text-align: center;
    font-size: 1.2em;
}

/* ==================== */
/* MORE LINKS           */
/* ==================== */

.more-link {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #e0e0e0;
}

/* ==================== */
/* DROPBUTTONS          */
/* ==================== */

/* Reset du style des dropbuttons */
.dropbutton-wrapper,
.dropbutton-widget {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.dropbutton {
  list-style: none;
  padding: 0;
  margin: 0;
  border: none !important;
}

.dropbutton li {
  border: none !important;
  background: transparent !important;
}

.dropbutton-action {
  border: none !important;
}

/* Style des liens dans les dropbuttons */
.dropbutton a {
  border: none !important;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--mt-color-primary, #0d75a3);
  transition: color 0.2s ease;
}

.dropbutton a:hover {
  color: var(--mt-color-primary-dark, #0b6187);
  background: transparent !important;
}

/* ==================== */
/* RESPONSIVE           */
/* ==================== */

@media (max-width: 768px) {
  .pager__items {
    gap: 0.25rem !important;
  }
  
  .pager__item > a,
  .pager__item.is-active {
    padding: 0.375rem 0.625rem !important;
    min-width: 35px !important;
    font-size: 0.875rem !important;
    margin: 0 0.15rem !important;
  }
  
  .more-link a {
    padding: 0.625rem 1.5rem !important;
    font-size: 0.875rem !important;
  }
}

/* ==================== */
/* VARIANTES PAR VUE    */
/* ==================== */

/* Style compact pour les blocs dashboard */
.layout-builder__layout .pager {
  margin: 1.5rem 0 0.5rem;
}

.layout-builder__layout .more-link {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
}

.layout-builder__layout .more-link a {
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
}
