/* Modern TT Rating System - Custom Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Light Theme */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: #6366f1;
  --accent: #f59e0b;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  /* Neutral Colors */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* Background & Text */
  --bg-primary: #ffffff;
  --bg-secondary: var(--gray-50);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --border-color: var(--gray-200);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.18);
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: var(--gray-900);
  --bg-secondary: var(--gray-800);
  --text-primary: var(--gray-100);
  --text-secondary: var(--gray-400);
  --border-color: var(--gray-700);
  --glass-bg: rgba(15, 23, 42, 0.25);
  --glass-border: rgba(15, 23, 42, 0.18);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
}

/* Modern Container */
.container-modern {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

main.container-modern {
  min-height: calc(100vh - 400px);
}

/* Modern Navigation */
.navbar-modern {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 0 0 1rem 1rem;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: all 0.3s ease;
}

.navbar-brand-modern {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.nav-link-modern {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.nav-link-modern:hover {
  color: var(--primary);
  background: var(--glass-bg);
  transform: translateY(-1px);
}

.nav-link-modern::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.5s;
}

.nav-link-modern:hover::before {
  left: 100%;
}

/* Modern Cards */
.card-modern {
  background: var(--bg-primary);
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}

.card-modern:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
}

/* Modern Buttons */
.btn-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px 0 rgba(59, 130, 246, 0.35);
}

.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}

/* Modern Form Elements */
.form-modern {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group-modern {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label-modern {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.form-input-modern {
  padding: 0.875rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 0.75rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-input-modern:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Profile Image Modern */
.profile-img-modern {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.profile-img-modern:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

/* Ranking Cards */
.rank-card {
  background: var(--bg-primary);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.rank-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.rank-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, var(--accent), #f97316);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.rank-1 .rank-badge {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #92400e;
}

.rank-2 .rank-badge {
  background: linear-gradient(135deg, #c0c0c0, #e5e7eb);
  color: #374151;
}

.rank-3 .rank-badge {
  background: linear-gradient(135deg, #cd7f32, #d97706);
  color: white;
}

/* Rating Display */
.rating-display {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Statistics Cards */
.stat-card {
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all 0.3s ease;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  border-color: var(--primary);
  transform: rotate(180deg);
}

/* Loading Animation */
.loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==================== DASHBOARD HERO SECTION ==================== */

.dashboard-hero {
  position: relative;
  text-align: center;
  padding: 4rem 2rem;
  margin-bottom: 3rem;
  background: linear-gradient(135deg, 
    rgba(59, 130, 246, 0.1) 0%, 
    rgba(99, 102, 241, 0.1) 50%,
    rgba(244, 114, 182, 0.1) 100%
  );
  border-radius: 2rem;
  overflow: hidden;
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 50%, rgba(59, 130, 246, 0.15), transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(99, 102, 241, 0.15), transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 2rem;
  box-shadow: 0 20px 40px rgba(59, 130, 246, 0.3);
  animation: float 3s ease-in-out infinite;
}

.hero-icon i {
  color: white;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-weight: 500;
  max-width: 600px;
  margin: 0 auto;
}

.hero-decorations {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.decoration-circle {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
  filter: blur(40px);
  animation: float-decoration 6s ease-in-out infinite;
}

.decoration-circle:nth-child(1) {
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.decoration-circle:nth-child(2) {
  bottom: -100px;
  right: -100px;
  animation-delay: 2s;
}

.decoration-circle:nth-child(3) {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 4s;
}

@keyframes float-decoration {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, 20px) scale(1.1); }
}

/* ==================== PODIUM SECTION ==================== */

.podium-section {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title i {
  color: var(--accent);
  width: 1.75rem;
  height: 1.75rem;
}

.podium-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: end;
}

.podium-card {
  position: relative;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 1.5rem;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideUp 0.6s ease-out;
  overflow: hidden;
}

.podium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.podium-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.podium-1 {
  order: 2;
  transform: translateY(-20px);
  border-color: #ffd700;
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.podium-1::before {
  background: linear-gradient(90deg, #ffd700, #ffed4e);
}

.podium-2 {
  order: 1;
  border-color: #c0c0c0;
  box-shadow: 0 10px 30px rgba(192, 192, 192, 0.15);
}

.podium-2::before {
  background: linear-gradient(90deg, #c0c0c0, #e5e7eb);
}

.podium-3 {
  order: 3;
  border-color: #cd7f32;
  box-shadow: 0 10px 30px rgba(205, 127, 50, 0.15);
}

.podium-3::before {
  background: linear-gradient(90deg, #cd7f32, #d97706);
}

.podium-crown {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.podium-medal {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.podium-rank {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.podium-player {
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  margin-bottom: 1rem;
  transition: color 0.2s ease;
}

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

.podium-rating {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.podium-stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.stat-win {
  color: var(--success);
}

.stat-loss {
  color: var(--error);
}

/* ==================== DASHBOARD RESPONSIVE STYLES ==================== */

/* Dashboard Container */
.dashboard-container {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
  max-width: 100%;
}

.dashboard-main {
  min-width: 0;
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Card Headers */
.card-header-gradient {
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 1rem 1rem 0 0;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 2px solid var(--border-color);
}

.card-title {
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-header .card-title {
  color: var(--text-primary);
}

.card-badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.375rem 0.875rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.ranking-card {
  overflow: hidden;
}

/* Table Responsive */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  display: block;
  position: relative;
  margin: 0;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 750px;
}

.ranking-table thead tr {
  background: var(--bg-secondary);
}

.ranking-table th {
  padding: 1.125rem 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ranking-table th.rating-col,
.ranking-table th.wins-col,
.ranking-table th.age-col,
.ranking-table th.action-col {
  text-align: center;
}

.ranking-table td {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.ranking-row {
  transition: all 0.2s ease;
  position: relative;
}

.ranking-row:hover {
  background: linear-gradient(90deg, var(--glass-bg), transparent);
}

.ranking-row:hover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
}

/* Table Cell Styles */
.rank-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.medal-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.rank-number {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 1.125rem;
  min-width: 2rem;
}

.rank-number.top-rank {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.25rem;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-link {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.player-name {
  font-size: 1rem;
}

.top-player-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rating-col,
.wins-col {
  text-align: center;
}

.rating-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.rating-badge {
  font-size: 1.375rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rating-badge.rating-top {
  font-size: 1.5rem;
  position: relative;
}

.rating-badge.rating-top::after {
  content: '🔥';
  position: absolute;
  right: -1.25rem;
  top: -0.25rem;
  font-size: 0.875rem;
}

.rating-label {
  font-size: 0.625rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wins-losses-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.wins-count {
  color: var(--success);
  font-weight: 700;
  font-size: 1.125rem;
}

.separator {
  color: var(--text-secondary);
  font-weight: 600;
}

.losses-count {
  color: var(--error);
  font-weight: 700;
  font-size: 1.125rem;
}

.win-rate {
  text-align: center;
}

.win-rate-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.age-col,
.action-col {
  text-align: center;
}

.age-badge {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.btn-view {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-view:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

/* ==================== STATS CARD ==================== */

.stats-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(99, 102, 241, 0.05));
  border: 2px solid var(--border-color);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1.5rem;
}

.stat-item {
  background: var(--bg-primary);
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.stat-item:hover::before {
  transform: scaleX(1);
}

.stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-players .stat-icon {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.stat-matches .stat-icon {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.stat-avg .stat-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.stat-highest .stat-icon {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==================== MATCHES CARD ==================== */

.matches-card {
  background: var(--bg-primary);
}

.matches-container {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  max-height: 600px;
  overflow-y: auto;
}

.matches-container::-webkit-scrollbar {
  width: 6px;
}

.matches-container::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}

.matches-container::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

.match-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.875rem;
  padding: 1rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.match-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.match-item:hover {
  background: var(--bg-primary);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.match-item:hover::before {
  transform: scaleY(1);
}

.match-players {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.match-player {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.match-player.winner {
  color: var(--text-primary);
  font-weight: 700;
}

.match-vs {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  background: var(--border-color);
  border-radius: 0.375rem;
}

.match-score {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.score-set {
  font-size: 1.125rem;
}

.score-separator {
  opacity: 0.7;
}

.match-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.match-date,
.match-org {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.match-date i,
.match-org i {
  width: 0.875rem;
  height: 0.875rem;
}

.match-org {
  background: var(--bg-primary);
  padding: 0.25rem 0.625rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 2px solid var(--border-color);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */

/* iPad Pro and large tablets (1024px) */
@media (max-width: 1024px) {
  .container-modern {
    padding: 0 1.5rem;
  }
  
  .dashboard-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .dashboard-sidebar {
    grid-row: 2;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .podium-container {
    gap: 1rem;
  }
  
  .podium-card {
    padding: 1.5rem 1rem;
  }
  
  .ranking-table {
    min-width: 650px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Tablets and small laptops (768px) */
@media (max-width: 768px) {
  .container-modern {
    padding: 0 1rem;
  }
  
  .navbar-modern {
    border-radius: 0;
  }
  
  .dashboard-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* Hide columns on mobile */
  .hide-mobile {
    display: none !important;
  }
  
  /* Hero adjustments */
  .dashboard-hero {
    padding: 3rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: 1.5rem;
  }
  
  .hero-icon {
    width: 4rem;
    height: 4rem;
  }
  
  .hero-icon i {
    width: 2.5rem !important;
    height: 2.5rem !important;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  /* Podium adjustments */
  .podium-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .podium-1 {
    order: 1;
    transform: none;
  }
  
  .podium-2 {
    order: 2;
  }
  
  .podium-3 {
    order: 3;
  }
  
  .podium-section {
    margin-bottom: 2rem;
  }
  
  /* Table adjustments */
  .ranking-table {
    min-width: 500px;
    font-size: 0.875rem;
  }
  
  .ranking-table th,
  .ranking-table td {
    padding: 0.875rem 0.625rem;
  }
  
  .rank-number {
    font-size: 1rem;
  }
  
  .medal-icon {
    font-size: 1.25rem;
  }
  
  .rating-badge {
    font-size: 1.125rem;
  }
  
  .player-name {
    font-size: 0.9375rem;
  }
  
  /* Stats grid */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }
  
  .stat-item {
    padding: 1rem;
  }
  
  .stat-icon {
    width: 2.5rem;
    height: 2.5rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .stat-label {
    font-size: 0.6875rem;
  }
  
  /* Card adjustments */
  .card-modern {
    border-radius: 1rem;
  }
  
  .card-header,
  .card-header-gradient {
    padding: 1.25rem;
  }
  
  .card-title {
    font-size: 1.125rem;
  }
  
  /* Matches */
  .matches-container {
    max-height: 500px;
  }
  
  .match-item {
    padding: 0.875rem;
  }
  
  /* Buttons */
  .btn-modern {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
  
  .btn-view {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }
  
  /* Rating display */
  .rating-display {
    font-size: 1.5rem;
  }
  
  /* Prevent horizontal scroll */
  body {
    overflow-x: hidden;
    width: 100%;
  }
  
  main {
    max-width: 100vw;
    overflow-x: hidden;
  }
}

/* Mobile devices (480px and below) */
@media (max-width: 480px) {
  .container-modern {
    padding: 0 0.75rem;
  }
  
  /* Hero adjustments */
  .dashboard-hero {
    padding: 2rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 1rem;
  }
  
  .hero-icon {
    width: 3.5rem;
    height: 3.5rem;
  }
  
  .hero-icon i {
    width: 2rem !important;
    height: 2rem !important;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .hero-subtitle {
    font-size: 0.875rem;
  }
  
  /* Podium adjustments */
  .podium-card {
    padding: 1.25rem 1rem;
  }
  
  .podium-crown {
    font-size: 2rem;
  }
  
  .podium-medal {
    font-size: 2.5rem;
  }
  
  .podium-player {
    font-size: 1rem;
  }
  
  .podium-rating {
    font-size: 1.75rem;
  }
  
  /* Table adjustments */
  .ranking-table {
    min-width: 420px;
    font-size: 0.8125rem;
  }
  
  .ranking-table th,
  .ranking-table td {
    padding: 0.75rem 0.5rem;
  }
  
  .rank-cell {
    gap: 0.375rem;
  }
  
  .rank-number {
    font-size: 0.9375rem;
  }
  
  .medal-icon {
    font-size: 1.125rem;
  }
  
  .rating-badge {
    font-size: 1rem;
  }
  
  .player-name {
    font-size: 0.875rem;
  }
  
  .top-player-badge {
    font-size: 0.5625rem;
    padding: 0.125rem 0.375rem;
  }
  
  .wins-count,
  .losses-count {
    font-size: 1rem;
  }
  
  .win-rate-text {
    font-size: 0.6875rem;
  }
  
  /* Cards */
  .card-modern {
    border-radius: 0.875rem;
  }
  
  .card-header,
  .card-header-gradient {
    padding: 1rem;
  }
  
  .card-title {
    font-size: 1rem;
  }
  
  .card-title i {
    width: 1rem !important;
    height: 1rem !important;
  }
  
  .card-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
  }
  
  /* Stats */
  .stat-item {
    padding: 0.875rem;
    gap: 0.75rem;
  }
  
  .stat-icon {
    width: 2.25rem;
    height: 2.25rem;
  }
  
  .stat-value {
    font-size: 1.375rem;
  }
  
  .stat-label {
    font-size: 0.625rem;
  }
  
  /* Matches */
  .matches-container {
    padding: 0.75rem;
    max-height: 400px;
  }
  
  .match-item {
    padding: 0.75rem;
  }
  
  .match-player {
    font-size: 0.8125rem;
  }
  
  .match-score {
    padding: 0.375rem 0.75rem;
  }
  
  .score-set {
    font-size: 1rem;
  }
  
  .match-date,
  .match-org {
    font-size: 0.6875rem;
  }
  
  .card-footer {
    padding: 0.875rem 1rem;
  }
  
  /* Buttons */
  .btn-modern {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }
  
  .btn-view {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }
  
  /* Rating display */
  .rating-display {
    font-size: 1.25rem;
  }
  
  .section-title {
    font-size: 1.25rem;
  }
}

/* Very small devices (360px and below) */
@media (max-width: 360px) {
  .container-modern {
    padding: 0 0.5rem;
  }
  
  .ranking-table {
    min-width: 350px;
    font-size: 0.75rem;
  }
  
  .ranking-table th,
  .ranking-table td {
    padding: 0.625rem 0.375rem;
  }
  
  .hero-title {
    font-size: 1.5rem;
  }
  
  .hero-subtitle {
    font-size: 0.8125rem;
  }
  
  .stat-value {
    font-size: 1.25rem;
  }
  
  .podium-rating {
    font-size: 1.5rem;
  }
}

/* Animations */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.slide-up {
  animation: slideUp 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* Utility Classes */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.glass-effect {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}

/* User Profile & Dropdown */
.profile-img-modern {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
  transition: all 0.2s ease;
}

.profile-img-modern:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.user-profile {
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}

.user-profile:hover {
  background: var(--glass-bg);
}

.user-dropdown {
  position: relative;
}

.user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-xl);
  min-width: 220px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
  padding: 0.5rem;
}

.user-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-primary);
  border-radius: 0.5rem;
  margin: 0.125rem 0;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

.menu-item:hover {
  background: var(--bg-secondary);
  color: var(--primary);
  transform: translateX(4px);
}

.menu-item i {
  width: 1rem;
  height: 1rem;
  opacity: 0.7;
}

.menu-item:hover i {
  opacity: 1;
}

/* Logout item special styling */
.menu-item[href="logout.php"] {
  color: var(--error);
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
}

.menu-item[href="logout.php"]:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

/* Theme Toggle */
.theme-toggle {
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.05);
}

/* Responsive adjustments for user menu */
@media (max-width: 768px) {
  .user-info {
    display: none !important;
  }
  
  .user-menu {
    right: -1rem;
    min-width: 200px;
  }
  
  .desktop-nav {
    display: none !important;
  }
}