/* ===== MODERN RANKINGS SECTION ===== */

/* Fix spacing between title and ranking section */
.page-title.ranking-title-fix {
  margin-bottom: 0 !important;
}

.new-ranking-section {
  background: rgba(10, 15, 30, 0.4);
  border-radius: 0 0 12px 12px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-top: none;
  padding: 15px;
  margin-top: 0;
}

/* Tabs */
.new-ranking-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  justify-content: center;
}

.new-tab-btn {
  flex: 1;
  max-width: 200px;
  padding: 12px 24px;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.6), rgba(15, 23, 42, 0.8));
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.new-tab-btn i {
  font-size: 16px;
}

.new-tab-btn:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.2));
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.new-tab-btn.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: #60a5fa;
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.5);
}

/* Tab Content */
.new-tab-content {
  display: none;
}

.new-tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ranking Cards Container */
.ranking-cards-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Ranking Card */
.ranking-card-compact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(90deg, rgba(17, 24, 39, 0.5), rgba(15, 23, 42, 0.7));
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.ranking-card-compact::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
  transition: left 0.6s ease;
}

.ranking-card-compact:hover::before {
  left: 100%;
}

.ranking-card-compact:hover {
  background: linear-gradient(90deg, rgba(17, 24, 39, 0.7), rgba(15, 23, 42, 0.9));
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

/* Position Badge */
.ranking-position-compact {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.3), rgba(71, 85, 105, 0.3));
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  color: #94a3b8;
  border: 2px solid rgba(100, 116, 139, 0.4);
}

/* Top 3 Positions */
.ranking-card-compact.first-place .ranking-position-compact {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #ffffff;
  border-color: #fbbf24;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}

.ranking-card-compact.second-place .ranking-position-compact {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: #ffffff;
  border-color: #94a3b8;
  box-shadow: 0 0 20px rgba(148, 163, 184, 0.5);
}

.ranking-card-compact.third-place .ranking-position-compact {
  background: linear-gradient(135deg, #cd7f32, #b87333);
  color: #ffffff;
  border-color: #cd7f32;
  box-shadow: 0 0 20px rgba(205, 127, 50, 0.5);
}

/* Avatar */
.ranking-avatar-compact {
  flex-shrink: 0;
  width: 45px;
  height: 45px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(59, 130, 246, 0.3);
  background: rgba(17, 24, 39, 0.6);
}

.ranking-avatar-compact img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Guild Logo */
.ranking-guild-logo-compact {
  flex-shrink: 0;
  width: 45px;
  height: 45px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(59, 130, 246, 0.3);
  background: rgba(17, 24, 39, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ranking-guild-logo-compact img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Info */
.ranking-info-compact {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.player-name-compact,
.guild-name-compact {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-class-compact,
.guild-master-compact {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stats */
.player-stats-compact,
.guild-stats-compact {
  display: flex;
  gap: 12px;
  align-items: center;
}

.stat-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(59, 130, 246, 0.15);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.stat-compact i {
  font-size: 12px;
}

/* Responsive */
@media (max-width: 991px) {
  .new-ranking-section {
    padding: 15px;
  }
  
  .new-ranking-tabs {
    gap: 8px;
  }
  
  .new-tab-btn {
    padding: 10px 18px;
    font-size: 13px;
  }
  
  .ranking-card-compact {
    padding: 10px 12px;
    gap: 10px;
  }
  
  .ranking-position-compact {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
  
  .ranking-avatar-compact,
  .ranking-guild-logo-compact {
    width: 42px;
    height: 42px;
  }
  
  .player-name-compact,
  .guild-name-compact {
    font-size: 14px;
  }
  
  .player-class-compact,
  .guild-master-compact {
    font-size: 11px;
  }
  
  .stat-compact {
    padding: 4px 8px;
    font-size: 11px;
  }
}

@media (max-width: 767px) {
  .new-ranking-section {
    padding: 10px;
  }
  
  .ranking-cards-container {
    gap: 5px;
  }
  
  .new-ranking-tabs {
    flex-direction: column;
    gap: 0;
    margin-bottom: 12px;
    position: relative;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.8), rgba(15, 23, 42, 0.9));
    border-radius: 10px;
    overflow: visible;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  }
  
  /* Dropdown cerrado: solo mostrar botón activo */
  .new-ranking-tabs.mobile-dropdown .new-tab-btn:not(.active) {
    display: none !important;
    opacity: 0;
    transform: translateY(-10px);
  }
  
  /* Dropdown abierto: mostrar todos los botones */
  .new-ranking-tabs.mobile-dropdown.open .new-tab-btn {
    display: flex !important;
    animation: slideDown 0.3s ease forwards;
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .new-tab-btn {
    max-width: 100%;
    padding: 12px 14px;
    font-size: 13px;
    border-radius: 0 !important;
    position: relative;
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    background: transparent;
    transition: all 0.3s ease;
  }
  
  .new-tab-btn:first-child {
    border-radius: 10px 10px 0 0 !important;
  }
  
  .new-tab-btn:last-child {
    border-bottom: none;
    border-radius: 0 0 10px 10px !important;
  }
  
  /* Solo cuando hay un botón (cerrado) */
  .new-ranking-tabs.mobile-dropdown:not(.open) .new-tab-btn.active {
    border-radius: 10px !important;
  }
  
  .new-tab-btn:not(.active):hover {
    background: rgba(59, 130, 246, 0.15);
    padding-left: 18px;
  }
  
  /* Flecha en el botón activo cuando está en modo dropdown */
  .new-ranking-tabs.mobile-dropdown .new-tab-btn.active::after {
    content: '\f078';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 14px;
    font-size: 12px;
    transition: transform 0.3s ease;
    color: #60a5fa;
  }
  
  .new-ranking-tabs.mobile-dropdown.open .new-tab-btn.active::after {
    transform: rotate(180deg);
  }
  
  /* Mejorar apariencia del botón activo */
  .new-ranking-tabs.mobile-dropdown .new-tab-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.15));
    border-color: rgba(59, 130, 246, 0.3);
  }
  
  .new-tab-btn i {
    font-size: 14px;
  }
  
  .ranking-card-compact {
    padding: 8px 10px;
    gap: 8px;
  }
  
  .ranking-position-compact {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-width: 1px;
  }
  
  .ranking-avatar-compact,
  .ranking-guild-logo-compact {
    width: 38px;
    height: 38px;
    border-width: 1px;
  }
  
  .player-name-compact,
  .guild-name-compact {
    font-size: 13px;
  }
  
  .player-class-compact,
  .guild-master-compact {
    font-size: 10px;
  }
  
  .player-stats-compact,
  .guild-stats-compact {
    gap: 6px;
  }
  
  .stat-compact {
    padding: 4px 8px;
    font-size: 11px;
    gap: 4px;
  }
  
  .stat-compact i {
    font-size: 10px;
  }
}

@media (max-width: 575px) {
  .new-ranking-section {
    padding: 8px;
  }
  
  .ranking-cards-container {
    gap: 5px;
  }
  
  .new-ranking-tabs {
    gap: 5px;
    margin-bottom: 12px;
  }
  
  .new-tab-btn {
    padding: 7px 12px;
    font-size: 11px;
  }
  
  .ranking-card-compact {
    padding: 7px 8px;
    gap: 7px;
  }
  
  .ranking-position-compact {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
  
  .ranking-avatar-compact,
  .ranking-guild-logo-compact {
    width: 35px;
    height: 35px;
  }
  
  .player-name-compact,
  .guild-name-compact {
    font-size: 12px;
  }
  
  .player-class-compact,
  .guild-master-compact {
    font-size: 9px;
  }
  
  .stat-compact {
    padding: 3px 6px;
    font-size: 10px;
  }
}
