/* ═══════════════════════════════════════════════════════════════════════
   ROLES SECTION V3 - Styles dédiés
   Design moderne avec timeline, role cards et progression
   Couleur thème: Jaune/Orange (#fbbf24 / #f97316)
   ═══════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════
   INFO BANNER
   ═══════════════════════════════════════════════════════════════════════ */

.roles-section-v2 .roles-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(249, 115, 22, 0.08) 100%);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.roles-section-v2 .info-icon {
  font-size: 1.375rem;
  line-height: 1;
  flex-shrink: 0;
}

.roles-section-v2 .info-content {
  flex: 1;
}

.roles-section-v2 .info-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   TIMELINE - Visualisation de la progression
   ═══════════════════════════════════════════════════════════════════════ */

.roles-section-v2 .roles-timeline-v2 {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
}

.roles-section-v2 .timeline-track {
  position: relative;
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
  overflow: visible;
}

.roles-section-v2 .timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f97316);
  border-radius: var(--radius-full);
  opacity: 0.3;
}

.roles-section-v2 .timeline-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.roles-section-v2 .marker-dot {
  display: block;
  width: 20px;
  height: 20px;
  background: var(--marker-color, #fbbf24);
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  box-shadow:
    0 0 0 2px var(--marker-color, #fbbf24),
    0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all var(--transition-normal);
}

.roles-section-v2 .timeline-marker:hover .marker-dot {
  transform: scale(1.3);
  box-shadow:
    0 0 0 3px var(--marker-color, #fbbf24),
    0 6px 20px rgba(251, 191, 36, 0.4);
}

.roles-section-v2 .timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════
   TIMELINE INTERACTIVE - Drag & Drop
   ═══════════════════════════════════════════════════════════════════════ */

.roles-section-v2 .roles-timeline-v2.interactive {
  user-select: none;
}

.roles-section-v2 .roles-timeline-v2.dragging {
  cursor: grabbing;
}

.roles-section-v2 .timeline-header {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.roles-section-v2 .timeline-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius-full);
}

.roles-section-v2 .hint-icon {
  font-size: 1rem;
}

.roles-section-v2 .hint-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Timeline Marker Draggable */
.roles-section-v2 .timeline-marker.draggable {
  cursor: grab;
  transition: all 0.15s ease;
}

.roles-section-v2 .timeline-marker.draggable:hover {
  transform: translate(-50%, -50%) scale(1.15);
}

.roles-section-v2 .timeline-marker.draggable:active,
.roles-section-v2 .timeline-marker.is-dragging {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.25);
  z-index: 100 !important;
}

.roles-section-v2 .timeline-marker.is-dragging .marker-dot {
  box-shadow:
    0 0 0 4px var(--marker-color, #fbbf24),
    0 8px 25px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(251, 191, 36, 0.5);
  animation: pulse-glow 1s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Marker Label (percentage badge) */
.roles-section-v2 .marker-label {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: all 0.2s ease;
  pointer-events: none;
}

.roles-section-v2 .marker-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: inherit;
}

.roles-section-v2 .timeline-marker:hover .marker-label,
.roles-section-v2 .timeline-marker.is-dragging .marker-label {
  opacity: 1;
}

.roles-section-v2 .timeline-marker.is-dragging .marker-label {
  transform: translateX(-50%) scale(1.1);
}

/* Marker Name */
.roles-section-v2 .marker-name {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.roles-section-v2 .timeline-marker:hover .marker-name,
.roles-section-v2 .timeline-marker.is-dragging .marker-name {
  opacity: 1;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════
   ROLES GRID
   ═══════════════════════════════════════════════════════════════════════ */

.roles-section-v2 .roles-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .roles-section-v2 .roles-grid-v2 {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   ROLE CARD V2
   ═══════════════════════════════════════════════════════════════════════ */

.roles-section-v2 .role-card-v2 {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  transition: all var(--transition-normal);
  backdrop-filter: blur(8px);
}

.roles-section-v2 .role-card-v2:hover {
  transform: translateY(-4px);
  border-color: var(--role-color, rgba(251, 191, 36, 0.4));
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.2),
    0 0 0 1px var(--role-color, rgba(251, 191, 36, 0.2));
}

/* Color Bar - Top accent */
.roles-section-v2 .role-color-bar {
  height: 4px;
  width: 100%;
  background: var(--role-color, #fbbf24);
}

/* Card Content */
.roles-section-v2 .role-card-content {
  padding: 1.25rem;
}

/* Role Header */
.roles-section-v2 .role-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1rem;
}

.roles-section-v2 .role-icon-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.roles-section-v2 .role-icon {
  font-size: 1.5rem;
}

.roles-section-v2 .role-info {
  flex: 1;
  min-width: 0;
}

.roles-section-v2 .role-name {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roles-section-v2 .role-color-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Role Stats */
.roles-section-v2 .role-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.roles-section-v2 .stat-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.roles-section-v2 .stat-icon {
  font-size: 1rem;
}

.roles-section-v2 .stat-value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.roles-section-v2 .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Progress Bar */
.roles-section-v2 .role-progress-bar {
  position: relative;
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.roles-section-v2 .progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.roles-section-v2 .progress-label {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.625rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.roles-section-v2 .role-card-v2:hover .progress-label {
  opacity: 1;
}

/* Role Actions */
.roles-section-v2 .role-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  gap: 0.375rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: all var(--transition-normal);
}

.roles-section-v2 .role-card-v2:hover .role-actions {
  opacity: 1;
  transform: translateY(0);
}

.roles-section-v2 .btn-action {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
}

.roles-section-v2 .btn-action:hover {
  transform: scale(1.1);
}

.roles-section-v2 .btn-action.edit:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
}

.roles-section-v2 .btn-action.delete:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════════════ */

.roles-section-v2 .empty-state-v2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-xl);
  border: 1px dashed var(--glass-border);
  text-align: center;
}

.roles-section-v2 .empty-visual {
  position: relative;
  margin-bottom: 1.5rem;
}

.roles-section-v2 .empty-icon {
  font-size: 3.5rem;
  position: relative;
  z-index: 2;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.roles-section-v2 .empty-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.roles-section-v2 .empty-rings .ring {
  position: absolute;
  border: 2px solid rgba(251, 191, 36, 0.2);
  border-radius: 50%;
  animation: ring-pulse 2s ease-in-out infinite;
}

.roles-section-v2 .empty-rings .ring:nth-child(1) {
  width: 80px;
  height: 80px;
  top: -40px;
  left: -40px;
  animation-delay: 0s;
}

.roles-section-v2 .empty-rings .ring:nth-child(2) {
  width: 110px;
  height: 110px;
  top: -55px;
  left: -55px;
  animation-delay: 0.3s;
}

.roles-section-v2 .empty-rings .ring:nth-child(3) {
  width: 140px;
  height: 140px;
  top: -70px;
  left: -70px;
  animation-delay: 0.6s;
}

@keyframes ring-pulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.05);
  }
}

.roles-section-v2 .empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.roles-section-v2 .empty-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem 0;
  max-width: 300px;
}

.roles-section-v2 .btn-hero-gradient {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  border: none;
  border-radius: var(--radius-lg);
  color: #1e1e1e;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.roles-section-v2 .btn-hero-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(251, 191, 36, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════════
   SUMMARY SECTION
   ═══════════════════════════════════════════════════════════════════════ */

.roles-section-v2 .roles-summary-v2 {
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(249, 115, 22, 0.05) 100%);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius-lg);
}

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

.roles-section-v2 .summary-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.roles-section-v2 .summary-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0.25rem 0.625rem;
  background: var(--bg-card);
  border-radius: var(--radius-full);
}

.roles-section-v2 .summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.roles-section-v2 .summary-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--chip-color, #fbbf24);
  transition: all var(--transition-fast);
}

.roles-section-v2 .summary-chip:hover {
  transform: translateY(-2px);
  border-color: var(--chip-color, #fbbf24);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.roles-section-v2 .chip-percent {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--chip-color, #fbbf24);
}

.roles-section-v2 .chip-name {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* ═══════════════════════════════════════════════════════════════════════
   HEADER ADD BUTTON
   ═══════════════════════════════════════════════════════════════════════ */

.roles-section-v2 .btn-add-fancy {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  border: none;
  border-radius: var(--radius-md);
  color: #1e1e1e;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 2px 10px rgba(251, 191, 36, 0.25);
  margin-left: auto;
}

.roles-section-v2 .btn-add-fancy:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.35);
}

.roles-section-v2 .btn-add-fancy .btn-icon {
  font-size: 1.125rem;
  font-weight: 700;
}

.roles-section-v2 .btn-add-fancy .btn-text {
  font-size: 0.875rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .roles-section-v2 .roles-info-banner {
    flex-direction: column;
    text-align: center;
  }

  .roles-section-v2 .role-stats {
    flex-direction: column;
    gap: 0.5rem;
  }

  .roles-section-v2 .stat-item {
    justify-content: center;
  }

  .roles-section-v2 .summary-chips {
    justify-content: center;
  }

  .roles-section-v2 .btn-add-fancy .btn-text {
    display: none;
  }

  .roles-section-v2 .btn-add-fancy {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
}
