/* Base Styles */
body {
  margin: 80px 0 40px 0;
  background-color: #f8f9fa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Container */
.container {
  max-width: 1800px;
  padding: 0 15px;
}

/* Table Styles */
.table {
  width: 100%;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
  background-color: white;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
}

.table thead th {
  background-color: #343a40;
  color: white;
  border: none;
  padding: 12px 8px;
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background-color: rgba(0,0,0,0.02);
}

/* Top User Styles */
.top-user {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.top-1 {
  background: linear-gradient(135deg, #ffd700, #ffecb3);
  border: 2px solid #ffd700;
}

.top-2 {
  background: linear-gradient(135deg, #c0c0c0, #e0e0e0);
  border: 2px solid #c0c0c0;
}

.top-3 {
  background: linear-gradient(135deg, #cd7f32, #e0b080);
  border: 2px solid #cd7f32;
}

.medal {
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 24px;
}

.top-user td {
  position: relative;
  z-index: 1;
}

/* User Avatar */
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
  object-fit: cover;
  border: 2px solid #dee2e6;
}

/* Badges */
.badge {
  font-weight: 500;
  padding: 5px 8px;
  font-size: 0.85rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  body {
    margin: 60px 0 20px 0;
  }
  
  .container {
    padding: 0 10px;
  }
  
  .table thead th {
    padding: 8px 5px;
    font-size: 0.9rem;
  }
  
  .table td {
    padding: 8px 5px;
    font-size: 0.9rem;
  }
  
  .user-avatar {
    width: 32px;
    height: 32px;
  }
  
  .medal {
    font-size: 20px;
    right: 5px;
    top: 5px;
  }
  
  .badge {
    padding: 3px 5px;
    font-size: 0.75rem;
  }
}

@media (max-width: 576px) {
  .table thead th:nth-child(4),
  .table td:nth-child(4),
  .table thead th:nth-child(6),
  .table td:nth-child(6) {
    display: none;
  }
  
  .table thead th {
    font-size: 0.8rem;
  }
  
  .table td {
    font-size: 0.8rem;
  }
  
  .user-avatar {
    width: 28px;
    height: 28px;
    margin-right: 5px;
  }
  
  h2 {
    font-size: 1.5rem;
  }
}

/* Network Diagram Styles */
.svg-container {
  width: 95vw;
  max-width: 1000px;
  margin: auto;
  overflow: visible;
}

#network-diagram, #activity-chart {
  width: 100%;
  height: auto;
  display: block;
}

.svg-container svg {
  width: 100%;
  height: auto;
  max-height: 600px;
  display: block;
  margin: 0 auto;
}

@media (max-width: 600px) {
  svg#network-diagram {
    width: 100% !important;
    height: 500px !important;
  }
  circle.node {
    r: 15px !important;
  }
  text {
    font-size: 16px !important;
  }
}