/* ============================================
   COMPONENTS
   Reusable components: roles and related
   ============================================ */

/* Role squares */
.role{
  min-width:70px;
  max-width:100px;
  aspect-ratio:auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  padding:6px 8px;
  border-radius:8px;
  font-weight:700;
  font-size:11px;
  cursor:grab;
  user-select:none;
  transition:transform 0.15s ease;
}

.role:hover{
  transform:scale(1.03);
}

/* Role bloqueado */
.role.role-locked{
  opacity:0.3;
  cursor:not-allowed;
  filter:grayscale(1);
  pointer-events:none;
}

.role.role-locked:hover{
  transform:none;
}

/* Role colors by type */
.role[data-role^="Analista"]{
  background:#2563eb;
  color:#fff;
}

.role[data-role^="Programador"]{
  background:#16a34a;
  color:#fff;
}

.role[data-role^="QA/Tester"]{
  background:#f59e0b;
  color:#111;
}

.role.role-attached{
  opacity:0.95;
  cursor:grab;
  border:2px solid rgba(0,0,0,0.06);
}

.role.dragging-role{
  opacity:0.6;
}

/* Role inside cards */
.card .role{
  aspect-ratio:auto;
  width:80px;
  height:auto;
  min-height:42px;
  margin-top:8px;
  padding:4px 6px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
}

.card .role .role-name{
  font-size:10px;
  font-weight:700;
  margin:0;
  white-space:nowrap;
  text-overflow:ellipsis;
  text-align:center;
  opacity:0.85;
}

.card .role .role-stat-main{
  font-size:16px;
}

.card .role .role-stat-secondary{
  font-size:11px;
  gap:6px;
}

/* Role stats container */
.role-stats{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:3px;
  width:100%;
}

/* Main stat (Eficiência) */
.role-stat-main{
  font-size:22px;
  font-weight:800;
  line-height:1;
  text-align:center;
}

/* Secondary stats row (Felicidade + Talento) */
.role-stat-secondary{
  display:flex;
  gap:8px;
  font-size:18px;
  font-weight:600;
  justify-content:center;
  align-items:center;
}

.role-stat-item{
  display:inline-flex;
  align-items:center;
  gap:2px;
  line-height:1;
}

.role-name{
  font-size:12px;
  font-weight:700;
  text-align:center;
  margin-bottom:2px;
}

/* Role title wrapper for title + remove button */
.role-title-wrapper{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  width:100%;
  position:relative;
}

/* Remove button for attached roles */
.role-remove-btn{
  background:rgba(239,68,68,0.9);
  color:#fff;
  border:none;
  border-radius:50%;
  width:18px;
  height:18px;
  font-size:14px;
  line-height:1;
  cursor:pointer;
  display:none;
  align-items:center;
  justify-content:center;
  padding:0;
  flex-shrink:0;
  transition:all 0.15s ease;
  font-weight:bold;
}

/* Show button only when role is attached */
.role[data-attached="true"] .role-remove-btn,
.role.role-attached .role-remove-btn{
  display:flex;
}

.role-remove-btn:hover{
  background:#dc2626;
  transform:scale(1.1);
}

.role-remove-btn:active{
  transform:scale(0.95);
}

/* Ensure button is visible when role is in card */
.card .role .role-title-wrapper{
  margin-bottom:2px;
}

/* Responsive adjustments */
@media (max-width:800px){
  .role{
    min-width:70px;
    padding:6px 8px;
  }
}
