/**
 * Roles Band Component - Refactored CSS
 * Navigation horizontale des rôles BookConnect avec défilement
 */

/* ===== BASE STYLES ===== */
.roles-band {
  background: #223243;
  color: #cfe8ff;
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  position: fixed;
  top: calc(var(--navbar-h, 140px) + 2px);
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1200;
  display: flex;
  align-items: center;
}

/* ===== NAVIGATION BUTTONS ===== */
.roles-nav {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cfe8ff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  z-index: 1201;
}

.roles-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: scale(1.1);
}

.roles-nav-prev {
  margin-left: 15px;
  margin-right: 10px;
}

.roles-nav-next {
  margin-left: 10px;
  margin-right: 15px;
}

/* ===== CONTAINER & SCROLLING ===== */
.roles-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  scroll-behavior: smooth;
}

.roles-scroll::-webkit-scrollbar {
  height: 8px;
}

.roles-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
}

.roles-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.roles-band .icon-band-list {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 18px;
  scroll-snap-type: x mandatory;
  list-style: none;
  padding: 0 20px;  /* Padding pour éviter que les éléments touchent les bords */
  margin: 0;
  min-width: max-content;  /* Assure que la liste prend la largeur nécessaire */
}

/* ===== NAVIGATION ITEMS ===== */
.roles-band .icon-item {
  flex: 0 0 auto;
  min-width: 160px;
  text-align: center;
}

.roles-band .icon-item .icon-link {
  display: block;
  padding: 12px 8px;
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
  scroll-snap-align: start;
  position: relative;
}

/* ===== HOVER & FOCUS STATES ===== */
.roles-band .icon-item .icon-link:hover,
.roles-band .icon-item .icon-link:focus {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  outline: none;
}

/* ===== ACTIVE STATE ===== */
.roles-band .icon-item.active .icon-link {
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.20), rgba(88, 166, 255, 0.10));
  border: 1px solid rgba(88, 166, 255, 0.45);
}

/* ===== ICONS & TYPOGRAPHY ===== */
.roles-band .icon-item i {
  font-size: 28px;
  color: #58a6ff;
  display: block;
  margin-bottom: 8px;
}

.roles-band .icon-item.active i {
  color: #7bb4ff;
}

.roles-band .icon-item h3 {
  margin: 8px 0 4px;
  font-weight: 600;
  font-size: 16px;
  color: #e6f1ff;
}

.roles-band .icon-item .subtitle {
  margin: 0;
  font-size: 14px;
  color: #cde3ff;
  opacity: 0.9;
}

/* ===== TOOLTIP ===== */
.roles-band .icon-item .icon-link::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 8px);
  background: rgba(20, 30, 40, 0.95);
  color: #e6f1ff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 5;
}

.roles-band .icon-item .icon-link:hover::after,
.roles-band .icon-item .icon-link:focus::after {
  opacity: 1;
}

/* ===== NAVIGATION ARROWS ===== */
.roles-band .roles-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20, 30, 40, 0.65);
  color: #e6f1ff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease;
}

.roles-band .roles-nav:hover,
.roles-band .roles-nav:focus {
  background: rgba(20, 30, 40, 0.85);
  outline: none;
}


/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .roles-nav {
    width: 35px;
    height: 35px;
  }
  
  .roles-nav-prev {
    margin-left: 10px;
    margin-right: 8px;
  }
  
  .roles-nav-next {
    margin-left: 8px;
    margin-right: 10px;
  }
  
  .roles-band .icon-item {
    min-width: 140px;
  }
}

@media (max-width: 576px) {
  .roles-nav {
    display: none;
  }

  .roles-scroll {
    padding: 0 15px;
  }

  .roles-band .icon-band-list {
    justify-content: flex-start;
    padding: 0 5px;
  }

  .roles-band .icon-item {
    min-width: 120px;
  }
}

/* ===== SPECIAL CONTEXTS ===== */
/* Les styles spéciaux ne sont plus nécessaires car la roles-band est maintenant fixed */

/* ===== ACCESSIBILITY ===== */
.roles-band .icon-item .icon-link:focus-visible {
  outline: 2px solid #58a6ff;
  outline-offset: 2px;
}

/* ===== SCROLL BEHAVIOR ===== */
.roles-scroll {
  scroll-behavior: smooth;
}

/* ===== LOADING STATE ===== */
.roles-band.loading {
  opacity: 0.7;
  pointer-events: none;
}

.roles-band.loading .icon-item {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
