/* Star Savior Tier List Styles - Adapted for Haikyu */

.custom-tier-list-bsr {
  width: 100%;
  margin-top: 30px;
}

/* Tier Row - CZN Style */
.tier-row-bsr {
  display: flex;
  margin-bottom: 12px;
  background: #141417;
  
  overflow: hidden;
  
}

/* Tier Label (Left Side) */
.tier-label-bsr {
  min-width: 50px;
  width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.3rem;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  padding: 10px 8px;
  position: relative;
}

/* Tier Colors */
.tier-label-bsr.tier-t0 { background: #d32f2f; }
.tier-label-bsr.tier-ss { background: #ec6563; }
.tier-label-bsr.tier-s { background: #ff7f7f; }
.tier-label-bsr.tier-a { background: #f9a2a2; }
.tier-label-bsr.tier-b { background: #ffbf7f; }
.tier-label-bsr.tier-c { background: #ffff7f; }
.tier-label-bsr.tier-d { background: linear-gradient(135deg, #bfff7f 0%, #81c784 100%); }

/* Role Columns Container */
.tier-roles-container {
  display: flex;
  flex: 1;
  min-height: 45px;
}

/* Header Row Roles Container */
.tier-roles-container-header {
  background-color: #2a2a30;
}

/* Individual Role Column */
.role-column-bsr {
  flex: 1;
  padding: 8px 6px;
  border-left: 1px solid #2a2a30;
  display: flex;
  flex-direction: column;
}

/* Desktop: Header row columns */
.tier-header-row .role-column-bsr {
  justify-content: center;
  align-items: center;
  padding: 10px 6px;
}

/* Role Header */
.role-header-bsr {
  font-size: 0.75rem;
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding: 6px 0;
  font-weight: 600;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

/* Desktop: Header row styling */
.tier-header-row .role-header-bsr {
  background: transparent;
  font-size: 1rem;
  margin-bottom: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* Header row role colors (using generic colors for positions) */
.tier-header-row .role-header-bsr { color: #e0e0e0; }

/* Header Row */
.tier-header-row {
  display: flex;
}

/* Invisible tier label */
.tier-header-label-invisible {
  
 
  background-color: #23232a;
}

/* Hide role headers in tier rows on desktop */
.tier-row-bsr:not(.tier-header-row) .role-header-bsr {
  display: none;
}

/* Character Grid in Role Column */
.role-characters-bsr {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: flex-start;
}

/* Character Card */
.char-card-bsr {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 96px; /* Adjusted for Haikyu style */
  cursor: pointer;
  transition: transform 0.2s;
  text-decoration: none;
  
}

.char-card-bsr:hover {
  transform: translateY(-4px);
}

.char-avatar-bsr {
  width: 86px; /* Haikyu Portrait Width */
  height: 120px; /* Haikyu Portrait Height */
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.char-avatar-bsr img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Changed to contain for full body art */
  object-position: center;
}

/* Rarity Background Colors */
.char-avatar-bsr.Character-UR { background: linear-gradient(to top, rgba(227, 56, 57, 0.8), rgba(227, 56, 57, 0.4), rgba(0, 0, 0, 0.3)); }
.char-avatar-bsr.Character-SSR { background: linear-gradient(to top, rgba(222, 144, 19, 0.8), rgba(222, 144, 19, 0.4), rgba(0, 0, 0, 0.3)); }
.char-avatar-bsr.Character-SR { background: linear-gradient(to top, rgba(138, 43, 226, 0.8), rgba(138, 43, 226, 0.4), rgba(0, 0, 0, 0.3)); }
.char-avatar-bsr.Character-SP { background: linear-gradient(135deg, rgb(199, 229, 255) 0%, rgb(90, 166, 247) 50%, rgb(91, 110, 229) 100%); }
.char-avatar-bsr.Character-R { background: linear-gradient(to top, rgba(135, 206, 235, 0.8), rgba(135, 206, 235, 0.4), rgba(0, 0, 0, 0.3)); }
.char-avatar-bsr.Character-N { background: linear-gradient(to top, rgba(211, 211, 211, 0.8), rgba(211, 211, 211, 0.4), rgba(0, 0, 0, 0.3)); }

/* Character Name */
.char-name-bsr {
  margin-top: 6px;
  font-size: 0.7rem;
  color: #ccc;
  text-align: center;
  line-height: 1.2;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.empty-role {
  color: #444;
  font-size: 0.75rem;
  font-style: italic;
  text-align: center;
  padding: 20px 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .tier-header-row { display: none; }
  .tier-row-bsr:not(.tier-header-row) .role-header-bsr { display: block; }
  .tier-row-bsr { flex-direction: column; }
  .tier-label-bsr { min-width: 100%; width: 100%; padding: 8px; font-size: 1.1rem; }
  .tier-roles-container { flex-direction: column; }
  .role-column-bsr { border-left: none; border-top: 1px solid #2a2a30; padding: 10px; }
  .role-header-bsr { font-size: 0.8rem; margin-bottom: 6px; padding: 5px 0; }
  .char-card-bsr { width: 72px; }
  .char-avatar-bsr { width: 72px; height: 100px; }
  .char-name-bsr { font-size: 0.7rem; max-width: 72px; }
}

/* Last Updated Info */
.last-updated { font-size: 0.85rem; color: #888; margin-bottom: 20px; }

/* Tier Description */
.tier-description { background: rgba(26, 26, 29, 0.6); border: 1px solid #32323e; border-radius: 2px; padding: 20px; margin-bottom: 25px; }
.tier-description h3 { color: #7a5af8; margin-bottom: 15px; font-size: 1.1rem; }
.tier-description ul { list-style: none; padding: 0; margin: 0; }
.tier-description li { margin-bottom: 8px; font-size: 0.9rem; color: #bbb; display: flex; align-items: flex-start; gap: 10px; }

.tier-badge { display: inline-block; min-width: 28px; padding: 2px 8px; border-radius: 4px; font-weight: 700; font-size: 0.75rem; text-align: center; color: white; }
.tier-badge.t0 { background: #d32f2f; }
.tier-badge.ss { background: #ec6563; }
.tier-badge.s { background: #ff7f7f; }
.tier-badge.a { background: #f9a2a2; }
.tier-badge.b { background: #ffbf7f; }
.tier-badge.c { background: #ffff7f; }
.tier-badge.d { background: linear-gradient(135deg, #bfff7f 0%, #81c784 100%); }

/* Filter Bar Styles (from sstierlist.css) */
.employees-filter-bar.lost { border-radius: 4px; padding: 8px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 24px; }
.filter-bar-element { display: flex; align-items: center; }
.filter-bar-element.search { position: relative; margin-right: 4px; }
.filter-bar-element.search input.form-control { background-color: #0e0e11; border: 1px solid #32323e; border-radius: 4px; color: #e0e0e0; padding: 0 30px 0 10px; font-size: 0.9rem; height: 38px; width: 200px; transition: border-color 0.2s; box-sizing: border-box; line-height: 38px; }
.filter-bar-element.search input.form-control:focus { outline: none; border-color: #7a5af8; }
.filter-bar-element.search .clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #888; cursor: pointer; font-size: 1.2rem; line-height: 1; display: none; user-select: none; }
.filter-bar-element.search input:not(:placeholder-shown) + .clear { display: block; }
.btn-group { display: inline-flex; border-radius: 4px; overflow: hidden; border: 1px solid #32323e; }
.btn { display: inline-flex; align-items: center; justify-content: center; background-color: #212126; color: #a0a0a0; border: none; border-right: 1px solid #32323e; padding: 0 16px; height: 38px; font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn:last-child { border-right: none; }
.btn:hover { background-color: #2a2a30; color: #fff; }
.btn.active { background-color: #7a5af8a1; color: #fff; box-shadow: inset 0 3px 5px rgba(0,0,0,0.125); border-color: #7a5af8a1; }
.btn svg { fill: currentColor; }
.reset-button { background-color: #2a2a30; border: 1px solid #32323e; border-radius: 4px; color: #a0a0a0; padding: 0 16px; height: 38px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; transition: all 0.2s; font-size: 0.9rem; }
.reset-button:not([disabled]):hover { background-color: #7a5af8a1; border-color: #7a5af8a1; color: white; }
.reset-button[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn img { width: 28px; height: 28px; object-fit: contain; transition: filter 0.2s; display: block; transform: scale(1.2); }

@media (max-width: 768px) {
  .employees-filter-bar.lost { flex-direction: column; align-items: stretch; padding: 10px; }
  .filter-bar-element { width: 100%; justify-content: center; }
  .filter-bar-element.search input.form-control { width: 100%; }
  .btn-group { width: 100%; display: flex; }
  .btn { flex: 1; padding: 0 4px; font-size: 0.85rem; }
  .reset-button { width: 100%; justify-content: center; }
}
