/* Team Page mockup scoped styles. Builds on mockups/styleguide.css tokens. */

/* Base layout classes from styleguide */
.showcase-container { max-width: 1200px; margin: 0 auto; padding: 48px 24px; }
.component-section { margin-bottom: 48px; }
.component-grid { display: grid; gap: 24px; }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-col-span-2 { grid-column: span 2; }
.flex-group { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

/* Card base styles */
.card { 
  background: rgba(22, 24, 34, 0.7); 
  border-radius: 12px; 
  box-shadow: 0 6px 28px rgba(0,0,0,0.45);
  border: 1px solid rgba(99, 102, 241, 0.2);
}
.card-header { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 12px; 
  padding: 16px 24px; 
  border-bottom: 1px solid rgba(148,163,255,0.18); 
  min-height: 66px; 
}
.card-header h2 { 
  margin: 0; 
  font-size: 1.12rem; 
  font-weight: 650; 
  letter-spacing: 0.01em; 
  color: rgba(235,240,255,0.94); 
}
.card-body { padding: 18px 22px; }

/* Utility classes */
.muted { color: #94A3B8; }
.divider { border: none; border-top: 1px solid rgba(148,163,255,0.2); margin: 8px 0; }
.stack { display: grid; gap: 12px; }
.label { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: #94A3B8; }
.value { font-weight: 600; }
.truncate-inline { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: clip; }

.team-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.8fr) minmax(320px, 1fr);
}
.team-left {
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
}
.team-right {
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
}

/* Header polish */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(148,163,255,0.25);
  background: rgba(14,21,38,0.65);
  color: rgba(223,230,255,0.88);
}
.badge-verified { border-color: rgba(34,197,94,0.38); background: rgba(22,163,74,0.16); color: rgba(110,231,183,0.96); }
.badge-region { border-color: rgba(148,163,255,0.32); background: rgba(39,46,90,0.52); color: rgba(196,205,255,0.86); }
.overview-card .card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: nowrap; }
.card-header-actions { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; padding-left: 12px; }
.card-heading { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.team-tag-inline {
  font-size: 1rem;
  font-weight: 620;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(148,163,255,0.8);
  margin-right: 12px;
}
.team-tag-header {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6366F1;
}

.rating-label {
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: rgba(235,240,255,0.94);
}

.rating-value {
  font-size: 1rem;
  font-weight: 620;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(148,163,255,0.8);
  background: rgba(39,46,90,0.52);
  border: 1px solid rgba(148,163,255,0.32);
  border-radius: 6px;
  padding: 4px 10px;
  display: inline-block;
}

.team-profile p { margin: 0 0 8px; color: rgba(194,205,255,0.75); }
.team-profile ul { margin: 0; padding-left: 18px; color: rgba(220,228,255,0.86); }

/* Team overview card */
#team-title { display: inline-flex; align-items: baseline; gap: 12px; }
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) min-content minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.overview-primary { display: grid; gap: 14px; min-width: 0; }
.overview-secondary { display: grid; gap: 18px; min-width: 0; }
.overview-divider {
  width: 1px;
  background: linear-gradient(180deg, rgba(148,163,255,0), rgba(148,163,255,0.28), rgba(148,163,255,0));
  min-height: 100%;
}
.overview-item { display: grid; gap: 4px; }
.overview-label { font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(148,163,255,0.6); }
.overview-value { font-size: 1rem; font-weight: 550; color: rgba(226,232,255,0.94); display: inline-flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.overview-tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(30,41,59,0.85);
  color: rgba(196,205,255,0.88);
  border: 1px solid rgba(129,140,248,0.4);
}
.status-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(34,197,94,0.14);
  color: rgba(134,239,172,0.9);
  border: 1px solid rgba(16,185,129,0.35);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.status-pill.neutral {
  background: rgba(56,189,248,0.12);
  color: rgba(165,243,252,0.88);
  border-color: rgba(14,165,233,0.32);
}
.overview-highlight { display: grid; gap: 8px; padding: 14px 16px; border-radius: 14px; background: rgba(24,33,56,0.68); border: 1px solid rgba(59,130,246,0.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02); }
.overview-highlight + .overview-highlight { margin-top: 4px; }
.highlight-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(148,163,255,0.6); }
.highlight-value { font-size: 0.98rem; font-weight: 600; color: rgba(226,232,255,0.92); }
.highlight-text { margin: 0; color: rgba(198,206,255,0.82); line-height: 1.5; font-size: 0.9rem; }
.highlight-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-ghost { background: transparent; border: 1px solid rgba(148,163,255,0.24); color: rgba(196,205,255,0.78); box-shadow: none; }
.btn-ghost:hover { border-color: rgba(56,189,248,0.5); color: rgba(235,240,255,0.92); background: rgba(56,189,248,0.14); }

/* Graph container */
.team-graph-container { display: grid; gap: 8px; }
#team-graph { width: 100%; height: 120px; background: rgba(148,163,255,0.06); border: 1px solid rgba(148,163,255,0.2); border-radius: 10px; }

.applications-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 16px;
}
.application-card {
  display: flex;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(148,163,255,0.22);
  border-radius: 12px;
  background: rgba(14,21,38,0.65);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.application-card:hover {
  border-color: rgba(56,189,248,0.4);
  background: rgba(56,189,248,0.08);
  box-shadow: 0 4px 16px rgba(8,12,24,0.32);
}
.application-main {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  min-width: 0;
}
.application-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(8,12,24,0.32);
}
.application-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.application-details {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.application-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.application-name {
  font-weight: 600;
  color: rgba(226,232,255,0.94);
  font-size: 0.9rem;
}
.application-meta {
  font-size: 0.8rem;
  color: rgba(191,201,255,0.75);
}
.application-message {
  font-size: 0.88rem;
  color: rgba(206,214,255,0.86);
  line-height: 1.5;
  font-style: italic;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.application-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.application-actions .btn {
  min-width: 68px;
  font-weight: 500;
}

/* small button helpers matching styleguide proportions */
.btn-sm { padding: 6px 10px; font-size: 0.9rem; border-radius: 8px; }

/* Members */
.member-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.member-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 16px 12px 12px;
  border: 1px solid rgba(148,163,255,0.22);
  border-radius: 12px;
  background: rgba(14,21,38,0.55);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.member-card:hover {
  border-color: rgba(56,189,248,0.55);
  background: rgba(56,189,248,0.2);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(8,12,24,0.46);
}
.member-card:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(56,189,248,0.4), 0 0 0 3px rgba(56,189,248,0.24);
}
.member-card-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; overflow: hidden; }
.member-avatar { width: 50px; height: 50px; border-radius: 50%; overflow: hidden; border: none; flex-shrink: 0; box-shadow: 0 6px 16px rgba(8,12,24,0.38); }
.member-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.member-text { display: grid; gap: 4px; min-width: 0; flex: 1; overflow: hidden; }
.member-name { position: relative; display: flex; align-items: center; min-width: 0; flex: 1; padding-right: 24px; }
.member-name-label { font-weight: 600; color: rgba(226,232,255,0.94); line-height: 1.28; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: clip; transition: color 0.2s ease; }
.member-meta { font-size: 0.85rem; color: rgba(192,202,255,0.76); }
.member-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.role-indicator {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(250,250,250,0.96);
  background: linear-gradient(135deg, rgba(79,70,229,0.48), rgba(6,182,212,0.55));
  border: 1px solid rgba(129,140,248,0.6);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}
.role-indicator[aria-label="Captain"] {
  background: linear-gradient(135deg, rgba(251,191,36,0.55), rgba(245,158,11,0.65));
  border-color: rgba(253,224,71,0.7);
}
.member-chevron { font-size: 1rem; color: rgba(148,163,255,0.55); transition: transform 0.2s ease, color 0.2s ease; }
.member-card:hover .member-name-label,
.member-card:focus-visible .member-name-label { color: rgba(235,240,255,0.96); }
.member-card:hover .member-meta,
.member-card:focus-visible .member-meta { color: rgba(210,220,255,0.85); }
.member-card:hover .member-chevron,
.member-card:focus-visible .member-chevron { color: rgba(235,240,255,0.85); transform: translateX(2px); }

/* Lists & rows */
.matches-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border: 1px solid rgba(148,163,255,0.18); border-radius: 12px; overflow: visible; background: rgba(14,21,38,0.5); }
.match-row { border-bottom: 1px solid rgba(148,163,255,0.12); }
.match-row:last-child { border-bottom: none; }
.match-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.25s ease, border-radius 0.2s ease;
  width: 100%;
}

.match-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}
.match-item:hover {
  background: rgba(56,189,248,0.16);
  box-shadow: inset 0 0 0 1px rgba(56,189,248,0.32);
}
.match-row:first-child .match-item {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
.match-row:last-child .match-item {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}
.match-item:hover .match-score { color: rgba(235,255,255,0.94); }
.match-opponent { display: grid; gap: 8px; min-width: 0; }
.match-top { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 14px; align-items: center; min-width: 0; }
.match-top .match-date { text-align: right; }
.match-name-block { display: flex; align-items: center; gap: 12px; min-width: 0; }
.match-name-block .match-tag { flex-shrink: 0; padding: 4px 10px; white-space: nowrap; border-radius: 999px; }
.match-opponent-name { display: flex; align-items: center; gap: 3px; min-width: 0; color: rgba(226,232,255,0.94); transition: color 0.2s ease; }
.match-opponent-name .match-name-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: clip; padding-right: 8px; }
.match-opponent-name .match-tournament { white-space: nowrap; color: rgba(191,201,255,0.78); transition: color 0.2s ease; font-size: 0.8rem; }
.match-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid rgba(148,163,255,0.34);
  background: linear-gradient(135deg, rgba(51,65,131,0.7), rgba(36,43,102,0.7));
  color: rgba(210,220,255,0.92);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.match-date {
  font-size: 0.85rem;
  white-space: nowrap;
  text-align: right;
  color: rgba(191,201,255,0.82);
  transition: color 0.2s ease;
}
.match-tournament {
  font-size: 0.8rem;
  color: rgba(191,201,255,0.78);
}
.match-score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  text-align: right;
  min-width: 56px;
  font-size: 1rem;
}
.match-score.win {
  color: #22c55e;
}
.match-score.loss {
  color: #ef4444;
}
.result-dot {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid;
  font-weight: 800;
  font-size: 0.8rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-left: auto;
}
.result-dot.win { color: #22c55e; border-color: rgba(34,197,94,0.45); background: rgba(34,197,94,0.12); }
.result-dot.loss { color: #ef4444; border-color: rgba(239,68,68,0.45); background: rgba(239,68,68,0.12); }
.match-item:hover .result-dot { box-shadow: 0 6px 16px rgba(8,12,24,0.28); }
.match-item:hover .match-opponent-name { color: rgba(235,240,255,0.96); }
.match-item:hover .match-opponent-name .match-tournament { color: rgba(209,219,255,0.9); }
.match-item:hover .match-date { color: rgba(209,219,255,0.88); }

/* Rating graph */
.team-graph-container {
  width: 100%;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cards & layout helpers */
.card { background: var(--surface-1); border-radius: 12px; box-shadow: var(--shadow-1); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid rgba(148,163,255,0.18); min-height: 66px; }
.card-header h2 { margin: 0; font-size: 1.12rem; font-weight: 650; letter-spacing: 0.01em; color: rgba(235,240,255,0.94); }
.card-body { padding: 18px 22px; }
.muted { color: var(--muted); }
.divider { border: none; border-top: 1px solid rgba(148,163,255,0.2); margin: 8px 0; }
.stack { display: grid; gap: 12px; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.label { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.value { font-weight: 600; }
.grid-col-span-2 { grid-column: span 2; }

/* Empty states */
.no-matches {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

/* Error and loading states */
.team-page-loading,
.team-page-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Responsive */
@media (max-width: 1024px) {
  .team-grid { grid-template-columns: 1fr; }
  .grid-col-span-2 { grid-column: span 1; }
}
@media (max-width: 768px) {
  .matches-list { border-radius: 10px; }
  .match-item { flex-direction: column; align-items: flex-start; gap: 12px; }
  .match-score, .result-dot { justify-self: start; }
}
