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

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

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

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

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

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

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

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

/* ============================================
   INFO CARD
   ============================================ */
.votetop-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);
  margin: 0 10rem auto;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(226, 1, 205, 0.1), rgba(31, 158, 158, 0.1));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--primary);
  /* max-width: 1000px; */
  /* margin-left: auto; */
  /* margin-right: auto; */
  /* margin-bottom: 2rem; */
  box-shadow: none;
}

.votetop-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);
}

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

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

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

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

/* ============================================
   LIST CONTAINER
   ============================================ */
.votetop-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: 2rem 10rem auto;
}

@media (max-width: 768px) {
  .votetop-list-container {
    padding: 1rem;
    margin: 0 auto;
  }
}

@media (max-width: 1920px) {
  .votetop-list-container {
    margin: 0 auto;
  }
}

/* ============================================
   TABLE STYLES (для rating/index.php)
   ============================================ */
.votetop-list-container table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

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

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

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

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

.votetop-list-container table tbody tr:last-child {
  border-bottom: none;
}

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

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

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

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

.votetop-list-container table tbody tr:nth-child(4) {
  background: linear-gradient(90deg, rgba(226, 1, 205, 0.08), rgba(255, 255, 255, 0.02));
}

.votetop-list-container table tbody tr:nth-child(5) {
  background: linear-gradient(90deg, rgba(31, 158, 158, 0.08), rgba(255, 255, 255, 0.02));
}

.votetop-list-container 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);
}

.votetop-list-container 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);
}

.votetop-list-container 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);
}

.votetop-list-container table tbody tr:nth-child(4):hover {
  background: linear-gradient(90deg, rgba(226, 1, 205, 0.15), rgba(31, 158, 158, 0.08));
  box-shadow: 0 0 15px rgba(226, 1, 205, 0.2);
}

.votetop-list-container table tbody tr:nth-child(5):hover {
  background: linear-gradient(90deg, rgba(31, 158, 158, 0.15), rgba(226, 1, 205, 0.08));
  box-shadow: 0 0 15px rgba(31, 158, 158, 0.2);
}

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

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

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

.votetop-list-container table td {
  padding: 1rem 1.5rem;
  vertical-align: middle;
  text-align: center;
}

@media (max-width: 768px) {
  .votetop-list-container table th,
  .votetop-list-container table td {
    padding: 0.75rem 1rem;
  }
}

/* ============================================
   POSITION STYLING
   ============================================ */
.votetop-list-container table td:first-child {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--foreground);
}

/* Топ-5 позиции с особыми цветами */
.votetop-list-container table tbody tr:nth-child(1) td:first-child {
  color: #FFD700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.votetop-list-container table tbody tr:nth-child(2) td:first-child {
  color: #C0C0C0;
  text-shadow: 0 0 10px rgba(192, 192, 192, 0.5);
}

.votetop-list-container table tbody tr:nth-child(3) td:first-child {
  color: #CD7F32;
  text-shadow: 0 0 10px rgba(205, 127, 50, 0.5);
}

.votetop-list-container table tbody tr:nth-child(4) td:first-child {
  color: var(--primary);
  text-shadow: 0 0 10px rgba(226, 1, 205, 0.5);
}

.votetop-list-container table tbody tr:nth-child(5) td:first-child {
  color: var(--secondary);
  text-shadow: 0 0 10px rgba(31, 158, 158, 0.5);
}

/* ============================================
   PLAYER INFO STYLING
   ============================================ */
.votetop-list-container table td:nth-child(2) {
  text-align: left;
}

.votetop-list-container table td:nth-child(2) > div {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 0;
}

.votetop-list-container table td:nth-child(2) img {
  width: 48px;
  height: 48px;
  border-radius: 0.5rem;
  /* border: 2px solid var(--glass-border); */
  transition: all 0.3s ease;
  image-rendering: pixelated;
}

.votetop-list-container table tbody tr:hover td:nth-child(2) img {
  border-color: var(--primary);
  transform: scale(1.1);
}

.votetop-list-container table td:nth-child(2) a {
  color: var(--foreground);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
  position: static;
  margin: 0;
}

.votetop-list-container table td:nth-child(2) a:hover {
  color: var(--primary);
}

/* ============================================
   VOTES COUNT STYLING
   ============================================ */
.votetop-list-container table td:nth-child(3) {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--primary);
}

/* ============================================
   POSITION BADGE
   ============================================ */
.votetop-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 5 Special Styles */
.votetop-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;
}

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

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

.votetop-position-4 {
  background: linear-gradient(135deg, rgba(226, 1, 205, 0.4), rgba(226, 1, 205, 0.6));
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 15px rgba(226, 1, 205, 0.4);
}

.votetop-position-5 {
  background: linear-gradient(135deg, rgba(31, 158, 158, 0.4), rgba(31, 158, 158, 0.6));
  border-color: var(--secondary);
  color: #fff;
  box-shadow: 0 0 15px rgba(31, 158, 158, 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) {
  .votetop-position-badge {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

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

.votetop-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;
}

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

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

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

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

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

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

/* ============================================
   VOTES CONTAINER
   ============================================ */
.votetop-votes-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.votetop-votes-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.votetop-reward-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-secondary);
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.3);
  font-size: 0.75rem;
  font-weight: 600;
  color: #FFD700;
}

.votetop-reward-badge svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
}

/* Разные цвета для разных наград */
.votetop-row:nth-child(1) .votetop-reward-badge {
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.3);
  color: #FFD700;
}

.votetop-row:nth-child(2) .votetop-reward-badge {
  background: rgba(192, 192, 192, 0.15);
  border-color: rgba(192, 192, 192, 0.3);
  color: #C0C0C0;
}

.votetop-row:nth-child(3) .votetop-reward-badge {
  background: rgba(205, 127, 50, 0.15);
  border-color: rgba(205, 127, 50, 0.3);
  color: #CD7F32;
}

.votetop-row:nth-child(4) .votetop-reward-badge,
.votetop-row:nth-child(5) .votetop-reward-badge {
  background: rgba(226, 1, 205, 0.15);
  border-color: rgba(226, 1, 205, 0.3);
  color: var(--primary);
}

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

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

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

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

/* ============================================
   TABLE WRAPPER (для rating/index.php)
   ============================================ */
.votetop-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);
}

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

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

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

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

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

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

.votetop-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;
}

.votetop-th-position {
  width: 100px;
  text-align: center;
}

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

.votetop-th-votes {
  min-width: 150px;
  text-align: center;
}

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

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

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

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

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

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

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

.votetop-table tbody tr:nth-child(4) {
  background: linear-gradient(90deg, rgba(226, 1, 205, 0.08), rgba(255, 255, 255, 0.02));
}

.votetop-table tbody tr:nth-child(5) {
  background: linear-gradient(90deg, rgba(31, 158, 158, 0.08), rgba(255, 255, 255, 0.02));
}

.votetop-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);
}

.votetop-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);
}

.votetop-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);
}

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

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

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

.votetop-td-position {
  text-align: center;
}

.votetop-td-votes {
  text-align: center;
}

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

/* ============================================
   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) {
  .votetop-page {
    padding: 1rem 0;
  }
  
  .votetop-header {
    padding: 2rem 0 1rem;
  }
  
  .votetop-list-container {
    padding: 0.5rem;
    margin: 0;
  }
  
  .votetop-table {
    font-size: 0.875rem;
  }
  
  /* Скрываем заголовки на мобильных */
  .votetop-table thead {
    display: none;
  }
  
  /* Карточный вид для мобильных */
  .votetop-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);
  }
  
  .votetop-table tbody tr:last-child {
    margin-bottom: 0;
  }
  
  .votetop-table td {
    padding: 0.5rem 0;
    border: none;
    text-align: left !important;
  }
  
  .votetop-td-position {
    margin-bottom: 0.75rem;
    text-align: left !important;
  }
  
  .votetop-td-player {
    margin-bottom: 0.75rem;
  }
  
  .votetop-td-votes {
    width: 100%;
    text-align: left !important;
  }
  
  .votetop-votes-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .votetop-votes-value::before {
    content: 'Голосов: ';
    color: var(--muted-foreground);
    font-weight: 400;
    font-size: 0.875rem;
  }
}

/* Дополнительные улучшения для планшетов */
@media (min-width: 641px) and (max-width: 1024px) {
  .votetop-table {
    font-size: 0.9rem;
  }
  
  .votetop-list-container {
    margin: 0 2rem auto;
  }
}
