/* Split layout for Ranking table with right-side profile panel */

/* Container: left (table/cards) + right (perfil-dashboard) */
.ranking-split {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 420px;
  gap: 1rem;
  align-items: start;
}

.ranking-split-left {
  min-width: 0;
}

.ranking-split-right {
  position: sticky;
  top: 80px;
  height: calc(100vh - 100px);
  overflow: auto;
  border-radius: 18px;
}

/* Hide right panel on small screens; mobile uses drawer/modal instead */
@media (max-width: 1024px) {
  .ranking-split {
    grid-template-columns: 1fr;
  }
  .ranking-split-right {
    display: none;
  }
}

/* Name cell with photo */
.rc-name {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Tabela: wrapper com foto + nome */
.ea-player-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.ea-row-photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  background: #1b1f23;
}

/* Ensure profile panel content fits nicely */
.ranking-split-right .ea-app-wrap,
.ranking-split-right .ea-modern-profile {
  max-width: 100%;
}

/* Minor tweak: table wrapper should not overflow within split */
.ranking-split-left .ranking-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
}

/* Skin roxa estilo standings */
.ea-standings-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.ea-standings-table thead tr {
  background: #007BFF;
  color: #FFFFFF;
}

.ea-standings-table th {
  padding: 0.75rem 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.ea-standings-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.ea-standings-table tbody tr {
  background: rgba(23, 9, 36, 0.75);
}

.ea-standings-table tbody tr:nth-child(odd) {
  background: rgba(23, 9, 36, 0.65);
}

.ea-standings-table tbody tr:hover {
  background: rgba(255,255,255,0.06);
}

.ea-standings-table .col-pos,
.ea-standings-table td.col-pos {
  width: 64px;
  text-align: center;
  color: #fff;
  font-weight: 700;
}

.ea-standings-table .col-name {
  min-width: 220px;
}

.ea-standings-table .col-stat {
  width: 72px;
  text-align: center;
}

.ranking-table-wrapper {
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(4px);
}

/* Standings header: solid blue, rounded corners, subtle outline */
.ea-standings-table thead tr.ea-thead {
  background: #007BFF;
  color: #FFFFFF;
  border: 1px solid rgba(255,255,255,0.12);
}
.ea-standings-table thead th {
  padding: 0.6rem 0.8rem;
  font-weight: 600;
  letter-spacing: 0.015em;
}
.ea-standings-table thead th:first-child { border-top-left-radius: 16px; }
.ea-standings-table thead th:last-child { border-top-right-radius: 16px; }
.ranking-table-wrapper { border-radius: 16px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06); }

/* Body rows: alternating background, hover, numeric typography */
.ea-standings-table tbody tr { background: rgba(255,255,255,0.02); }
.ea-standings-table tbody tr.even-row { background: rgba(255,255,255,0.04); }
.ea-standings-table tbody tr:hover { background: rgba(255,255,255,0.07); }
.ea-standings-table td.col-stat { font-weight: 600; letter-spacing: 0.015em; text-align: center; }
.ea-standings-table td, .ea-standings-table th { vertical-align: middle; white-space: nowrap; word-break: keep-all; }

/* Column sizing and alignment */
.ea-standings-table .col-pos { width: 44px; text-align: center; }
.ea-standings-table .col-name { min-width: 180px; }
.ea-standings-table .col-med { width: 72px; text-align: center; }
.ea-standings-table .col-stat { width: 64px; }

/* Top 3 highlights */
.ea-standings-table tbody tr.top1-row { background: linear-gradient(90deg, rgba(255, 215, 0, 0.18), rgba(255,255,255,0.02)); border-left: 3px solid #FFD700; }
.ea-standings-table tbody tr.top2-row { background: linear-gradient(90deg, rgba(192, 192, 192, 0.18), rgba(255,255,255,0.02)); border-left: 3px solid #C0C0C0; }
.ea-standings-table tbody tr.top3-row { background: linear-gradient(90deg, rgba(205, 127, 50, 0.18), rgba(255,255,255,0.02)); border-left: 3px solid #CD7F32; }

/* Logged-in user highlight */
.ea-standings-table tbody tr.logged-user-row { background: rgba(0, 168, 255, 0.12); box-shadow: inset 0 0 0 1px rgba(0, 168, 255, 0.35); }

/* Avatar sizing inside name cell */
.ea-row-photo { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; margin-right: 8px; }
.ea-name { display: flex; align-items: center; gap: 8px; }

/* Responsive adjustments */
@media (max-width: 1024px) {
  .ea-standings-table .col-name { min-width: 180px; }
  .ea-standings-table .col-med { width: 68px; }
  .ea-standings-table .col-stat { width: 72px; }
}
@media (max-width: 768px) {
  .ea-standings-table thead th { padding: 0.6rem 0.7rem; font-size: 0.95rem; }
  .ea-standings-table td { padding: 0.6rem 0.7rem; }
  .ea-standings-table td.col-stat { font-size: 0.95rem; }
  .ea-standings-table .col-name { min-width: 170px; }
  .ea-standings-table .col-med { width: 64px; }
  .ea-standings-table .col-stat { width: 68px; }
  .ea-row-photo { width: 30px; height: 30px; }
}
@media (max-width: 480px) {
  .ea-standings-table thead th { padding: 0.55rem 0.65rem; font-size: 0.92rem; }
  .ea-standings-table td { padding: 0.55rem 0.65rem; }
  .ea-standings-table td.col-stat { font-size: 0.92rem; }
  .ea-standings-table .col-name { min-width: 150px; }
  .ea-standings-table .col-med { width: 58px; }
  .ea-standings-table .col-stat { width: 64px; }
  .ea-row-photo { width: 28px; height: 28px; }
}

/* Loading spinner overlay */
.ea-spinner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
  z-index: 5;
}
.ea-spinner {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ea-spinner-circle {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 6px solid rgba(255,255,255,0.18);
  border-top-color: #00a8ff;
  border-right-color: #2a7be0;
  animation: ea-spin 1s linear infinite;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.ea-spinner-percent {
  position: relative;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.ea-spinner-text {
  margin-top: 10px;
  color: #fff;
  font-weight: 600;
  opacity: 0.9;
}
@keyframes ea-spin { to { transform: rotate(360deg); } }
@media (max-width: 480px) {
  .ea-spinner { width: 80px; height: 80px; }
  .ea-spinner-text { display: none; }
}
/* Smooth fade transition for overlay */
.ea-fade-enter-active, .ea-fade-leave-active { transition: opacity .2s ease, transform .2s ease; }
.ea-fade-enter-from, .ea-fade-leave-to { opacity: 0; transform: scale(0.98); }

/* Header legibility improvements */
.ea-standings-table thead th { color: #FFFFFF; font-size: 1rem; line-height: 1.2; }
.ea-standings-table thead th.col-name, .ea-standings-table td.col-name { text-align: left; }
.ea-standings-table thead th.col-stat, .ea-standings-table td.col-stat, .ea-standings-table thead th.col-pos, .ea-standings-table td.col-pos { text-align: center; }

/* Consolidated wrapper rules */
.ranking-table-wrapper { position: relative; max-height: 60vh; overflow-y: auto; overflow-x: auto; }
.ranking-table-wrapper { scrollbar-width: thin; scrollbar-color: var(--brand-cyan, #00a8ff) rgba(255,255,255,0.08); }
.ranking-table-wrapper::-webkit-scrollbar { width: 10px; height: 10px; }
.ranking-table-wrapper::-webkit-scrollbar-track { background: rgba(255,255,255,0.08); border-radius: 10px; }
.ranking-table-wrapper::-webkit-scrollbar-thumb { background: linear-gradient(90deg, var(--brand-cyan, #00a8ff) 0%, var(--brand-blue, #0e2740) 100%); border-radius: 10px; border: 2px solid rgba(255,255,255,0.12); }

/* Lateral scroll hint on mobile */
@media (max-width: 768px) {
  .ranking-table-wrapper { position: relative; }
  .ranking-table-wrapper::before,
  .ranking-table-wrapper::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 20px;
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  .ranking-table-wrapper::before { left: 0; background: linear-gradient(90deg, rgba(10,22,40,0.85), rgba(10,22,40,0)); }
  .ranking-table-wrapper::after { right: 0; background: linear-gradient(90deg, rgba(10,22,40,0), rgba(10,22,40,0.85)); }
  .ranking-table-wrapper.has-scroll::before,
  .ranking-table-wrapper.has-scroll::after { opacity: 1; }
  .ranking-table-wrapper.at-left::before { opacity: 0; }
  .ranking-table-wrapper.at-right::after { opacity: 0; }
}