/* Rank Layout */
.brpro-rank-wrapper {
  padding: 30px 0 60px;
}

.brpro-rank-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}

/* Mobile Nav (Hidden on PC) */
.brpro-rank-nav {
  display: none;
  background: var(--brpro-panel);
  border-radius: var(--brpro-radius);
  padding: 8px;
  margin-bottom: 24px;
  box-shadow: var(--brpro-shadow-soft);
  border: 1px solid var(--brpro-border);
}

.rank-tab {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--brpro-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.rank-tab.active {
  background: var(--brpro-accent-10);
  color: var(--brpro-accent);
}

/* Rank Column Styling */
.brpro-rank-col .brpro-panel {
  padding: 0;
  overflow: hidden;
}

.rank-header {
  padding: 24px 24px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--brpro-border);
  background: var(--brpro-bg);
}

.rank-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.rank-icon-daily {
  background: linear-gradient(135deg, #FF6B6B, #FF8E53);
}

.rank-icon-weekly {
  background: linear-gradient(135deg, #4D96FF, #6FB1FF);
}

.rank-icon-monthly {
  background: linear-gradient(135deg, #6BCB77, #8FE099);
}

.rank-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--brpro-text);
  margin: 0;
}

/* List Styling */
.rank-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rank-item {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--brpro-border);
  transition: background-color 0.2s;
}

.rank-item:last-child {
  border-bottom: none;
}

.rank-item:hover {
  background: var(--brpro-bg);
}

.rank-num {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brpro-bg);
  color: var(--brpro-muted);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  margin-right: 16px;
  flex-shrink: 0;
}

/* Top 3 styling */
.rank-num.top-1 {
  background: #FFE0E0;
  color: #FF4747;
}

.rank-num.top-2 {
  background: #FFF4E0;
  color: #FF8A00;
}

.rank-num.top-3 {
  background: #FFF9E0;
  color: #FFB800;
}

body.black .rank-num.top-1 { background: rgba(255, 71, 71, 0.15); }
body.black .rank-num.top-2 { background: rgba(255, 138, 0, 0.15); }
body.black .rank-num.top-3 { background: rgba(255, 184, 0, 0.15); }

.rank-name {
  color: var(--brpro-text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.rank-name:hover {
  color: var(--brpro-accent);
}

/* View More Button */
.rank-more {
  padding: 16px 24px;
  background: var(--brpro-bg);
  border-top: 1px solid var(--brpro-border);
}

.rank-more a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--brpro-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.rank-more a:hover {
  color: var(--brpro-accent);
}

/* Responsive & Mobile Tab Logic */
@media (max-width: 1024px) {
  .brpro-rank-columns {
    gap: 16px;
  }
  
  .rank-item {
    padding: 12px 16px;
  }
  
  .rank-header {
    padding: 16px;
  }
}

@media (max-width: 768px) {
  .brpro-rank-nav {
    display: flex;
  }

  .brpro-rank-columns {
    display: block; /* Disable grid on mobile */
  }

  /* Default state: hide all columns */
  .brpro-rank-col {
    display: none;
  }

  /* Show column based on parent class (controlled by JS) */
  .brpro-rank-columns.d1 .t1class,
  .brpro-rank-columns.d2 .t2class,
  .brpro-rank-columns.d3 .t3class {
    display: block;
    animation: fadeIn 0.3s ease;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
