/**
 * PLAYERTOP.CSS - Стили для страницы рейтинга игроков
 * Использует дизайн-систему FM-NEXUS
 */

/* ============================================
   PAGE LAYOUT
   ============================================ */
.playertop-page {
  padding: 2rem 0;
  min-height: calc(100vh - 160px);
}

/* ============================================
   HEADER SECTION
   ============================================ */
.playertop-header {
  padding: 6rem 0 4rem;
  text-align: center;
}

@media (max-width: 1023px) {
  .playertop-header {
    padding: 2rem 0 1rem;
  }
}

@media (max-width: 1920px) {
  .playertop-header {
    padding: 4rem 0 2rem;
  }
}

.playertop-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.playertop-title-normal {
  color: var(--foreground);
}

.playertop-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--muted-foreground);
  margin: 0;
  animation-delay: 0.1s;
}

/* ============================================
   INFO CARD
   ============================================ */
.playertop-info {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  border-radius: var(--radius);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

.playertop-info-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(226, 1, 205, 0.2), rgba(31, 158, 158, 0.2));
  border: 1px solid var(--glass-border);
  color: var(--primary);
}

.playertop-info-content {
  flex: 1;
}

.playertop-info-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
  margin: 0 0 0.5rem 0;
}

.playertop-info-text {
  font-size: 0.95rem;
  color: var(--muted-foreground);
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 768px) {
  .playertop-info {
    flex-direction: column;
    padding: 1.5rem;
  }
  
  .playertop-info-icon {
    width: 48px;
    height: 48px;
  }
}

/* ============================================
   LIST CONTAINER
   ============================================ */
.playertop-list-container {
  padding: 2rem;
  border-radius: var(--radius);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  margin: 0 10rem auto;
}

@media (max-width: 768px) {
  .playertop-list-container {
    padding: 1rem;
  }
}

/* ============================================
   TABLE
   ============================================ */
.playertop-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-secondary);
  
  /* Кастомный скроллбар */
  scrollbar-width: thin;
  scrollbar-color: rgba(226, 1, 205, 0.3) rgba(255, 255, 255, 0.05);
}

.playertop-table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.playertop-table-wrapper::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.playertop-table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(226, 1, 205, 0.3);
  border-radius: 999px;
  transition: background 0.3s ease;
}

.playertop-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(226, 1, 205, 0.5);
}

.playertop-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

/* Table Header */
.playertop-table thead {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--glass-border);
}

.playertop-table th {
  padding: 1rem 1.5rem;
  text-align: left;
  font-weight: 600;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.playertop-th-position {
  width: 100px;
}

.playertop-th-player {
  min-width: 250px;
}

.playertop-th-time {
  min-width: 200px;
}

/* Table Body */
.playertop-table tbody tr {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--glass-border);
  transition: all 0.3s ease;
  position: relative;
}

.playertop-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.04);
}

.playertop-table tbody tr:last-child {
  border-bottom: none;
}

.playertop-table tbody tr:hover {
  background: rgba(226, 1, 205, 0.08);
  transform: translateX(4px);
}

/* Специальный эффект для топ-3 */
.playertop-table tbody tr:nth-child(1) {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.08), rgba(255, 255, 255, 0.02));
}

.playertop-table tbody tr:nth-child(2) {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.08), rgba(255, 255, 255, 0.04));
}

.playertop-table tbody tr:nth-child(3) {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.08), rgba(255, 255, 255, 0.02));
}

.playertop-table tbody tr:nth-child(1):hover {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.15), rgba(226, 1, 205, 0.08));
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.playertop-table tbody tr:nth-child(2):hover {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.15), rgba(226, 1, 205, 0.08));
  box-shadow: 0 0 15px rgba(192, 192, 192, 0.2);
}

.playertop-table tbody tr:nth-child(3):hover {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.15), rgba(226, 1, 205, 0.08));
  box-shadow: 0 0 15px rgba(205, 127, 50, 0.2);
}

/* Dark theme adjustments */
[data-theme="dark"] .playertop-table tbody tr {
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .playertop-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .playertop-table tbody tr:hover {
  background: rgba(226, 1, 205, 0.08);
}

.playertop-table td {
  padding: 1rem 1rem;
  vertical-align: middle;
}

@media (max-width: 768px) {
  .playertop-table th,
  .playertop-table td {
    padding: 0.75rem 1rem;
  }
  
  .playertop-th-position {
    width: 70px;
  }
}

/* ============================================
   POSITION BADGE
   ============================================ */
.playertop-td-position {
  text-align: center;
}

.playertop-position-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.125rem;
  background: linear-gradient(135deg, rgba(226, 1, 205, 0.2), rgba(31, 158, 158, 0.2));
  border: 2px solid var(--glass-border);
  color: var(--foreground);
  transition: all 0.3s ease;
}

/* Top 3 Special Styles */
.playertop-position-1 {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border-color: #FFD700;
  color: #000;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
  animation: pulse-gold 2s ease-in-out infinite;
}

.playertop-position-2 {
  background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
  border-color: #C0C0C0;
  color: #000;
  box-shadow: 0 0 15px rgba(192, 192, 192, 0.4);
}

.playertop-position-3 {
  background: linear-gradient(135deg, #CD7F32, #B87333);
  border-color: #CD7F32;
  color: #fff;
  box-shadow: 0 0 15px rgba(205, 127, 50, 0.4);
}

@keyframes pulse-gold {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
  }
}

@media (max-width: 768px) {
  .playertop-position-badge {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

/* ============================================
   PLAYER INFO
   ============================================ */
.playertop-player-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.playertop-player-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  transition: all 0.3s ease;
}

.playertop-player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.playertop-row:hover .playertop-player-avatar {
  border-color: var(--primary);
  transform: scale(1.05);
}

.playertop-player-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.playertop-player-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  text-decoration: none;
  transition: color 0.3s ease;
}

.playertop-player-name:hover {
  color: var(--primary);
}

.playertop-player-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  width: fit-content;
}

.playertop-status-inactive {
  background: rgba(175, 175, 175, 0.15);
  color: #AFAFAF;
  border: 1px solid rgba(175, 175, 175, 0.2);
}

.playertop-status-inactive svg {
  width: 8px;
  height: 8px;
}

@media (max-width: 768px) {
  .playertop-player-avatar {
    width: 40px;
    height: 40px;
  }
  
  .playertop-player-name {
    font-size: 0.9rem;
  }
}

/* ============================================
   TIME & PROGRESS
   ============================================ */
.playertop-time-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.playertop-time-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
}

.playertop-progress-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.playertop-progress-bar {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
}

.playertop-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* Server Breakdown Progress Bars */
.playertop-servers-breakdown {
  display: flex;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  gap: 1px;
}

.playertop-servers-breakdown .top-progress__bar__item {
  height: 100%;
  transition: all 0.3s ease;
  cursor: help;
  position: relative;
  border-radius: 2px;
}

.playertop-servers-breakdown .top-progress__bar__item:hover {
  filter: brightness(1.3);
  transform: scaleY(2);
  z-index: 10;
  box-shadow: 0 0 10px currentColor;
}

.playertop-servers-breakdown .top-progress__bar__item:first-child {
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
}

.playertop-servers-breakdown .top-progress__bar__item:last-child {
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
}

@media (max-width: 768px) {
  .playertop-time-value {
    font-size: 1rem;
  }
  
  .playertop-progress-bar {
    height: 6px;
  }
  
  .playertop-servers-breakdown {
    height: 3px;
  }
  
  .playertop-servers-breakdown .top-progress__bar__item:hover {
    transform: scaleY(1.5);
  }
}

/* ============================================
   EMPTY STATE
   ============================================ */
.playertop-empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.playertop-empty-state svg {
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.playertop-empty-state h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.playertop-empty-state p {
  color: var(--muted-foreground);
  margin: 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slide-up 0.8s ease-out forwards;
  opacity: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .playertop-page {
    padding: 1rem 0;
  }
  
  .playertop-header {
    padding: 2rem 0 1rem;
  }
  
  .playertop-list-container {
    padding: 0.5rem;
  }
  
  .playertop-table-wrapper {
    border-radius: 0;
  }
  
  .playertop-table {
    font-size: 0.875rem;
  }
  
  .playertop-th-time {
    min-width: 150px;
  }
  
  /* Скрываем заголовки на мобильных */
  .playertop-table thead {
    display: none;
  }
  
  /* Карточный вид для мобильных */
  .playertop-table tbody tr {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-secondary);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
  }
  
  .playertop-table tbody tr:last-child {
    margin-bottom: 0;
  }
  
  .playertop-table td {
    padding: 0;
    border: none;
  }
  
  .playertop-td-position {
    text-align: left;
    margin-bottom: 0.75rem;
  }
  
  .playertop-td-player {
    margin-bottom: 0.75rem;
  }
  
  .playertop-td-time {
    width: 100%;
  }
  
  .playertop-time-container {
    width: 100%;
  }
}

/* Дополнительные улучшения для планшетов */
@media (min-width: 641px) and (max-width: 1024px) {
  .playertop-table {
    font-size: 0.9rem;
  }
  
  .playertop-th-position {
    width: 80px;
  }
  
  .playertop-th-player {
    min-width: 200px;
  }
}
