/* ============================================================
   MEDC Invitational — Player Dashboard (My Team) — Esports UI
   ============================================================ */

/* ---------- Dashboard layout ---------- */
.player-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 32px;
}

/* ---------- Captain summary (top bar) ---------- */
.captain-summary {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(13, 18, 35, 0.95) 100%);
  border: 1px solid rgba(96, 165, 250, 0.15);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.captain-summary__inner {
  padding: 16px 20px;
}

.captain-summary__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
  align-items: center;
}

.captain-summary__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.captain-summary__team .captain-summary__value {
  font-weight: 800;
  font-size: 18px;
  color: rgba(234, 240, 255, 0.98);
}

.captain-summary__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(183, 195, 230, 0.75);
}

.captain-summary__value {
  font-size: 14px;
  font-weight: 600;
  color: rgba(234, 240, 255, 0.95);
}

.captain-summary__value.status-badge {
  font-size: 12px;
  padding: 4px 10px;
  align-self: flex-start;
}

.captain-summary__next {
  color: rgba(147, 197, 253, 0.95);
}

@media (max-width: 640px) {
  .captain-summary__grid {
    gap: 14px 20px;
  }
  .captain-summary__team .captain-summary__value {
    font-size: 16px;
  }
}

/* ---------- Tab navigation ---------- */
.player-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.player-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(183, 195, 230, 0.9);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.player-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(234, 240, 255, 0.98);
}

.player-tab.is-active {
  background: rgba(96, 165, 250, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.player-tab--owner {
  margin-left: auto;
  color: rgba(249, 115, 22, 0.95);
}

.player-tab--owner.is-active {
  background: rgba(249, 115, 22, 0.15);
  color: #fdba74;
  border-color: rgba(249, 115, 22, 0.4);
}

/* ---------- Tab panels ---------- */
.player-panel {
  display: none;
  min-height: 200px;
  animation: playerPanelIn 0.2s ease;
}

.player-panel.is-active {
  display: block;
}

.player-panel > .card,
.player-panel > .dashboard-card {
  margin-bottom: 20px;
}

.player-panel > .card:last-child,
.player-panel > .dashboard-card:last-child {
  margin-bottom: 0;
}

.player-panel-empty {
  background: rgba(13, 18, 35, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.player-panel-empty .cardPad {
  padding: 24px;
}

.player-panel-empty .muted {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

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

/* ---------- Card: shared ---------- */
.dashboard-card {
  background: rgba(13, 18, 35, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(96, 165, 250, 0.06);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
  border-color: rgba(96, 165, 250, 0.15);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(96, 165, 250, 0.1);
}

.dashboard-card__inner {
  padding: 20px 24px;
}

.dashboard-card__title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(234, 240, 255, 0.98);
}

.dashboard-card__hint,
.dashboard-card__desc {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- Team Overview Panel ---------- */
.dashboard-card--overview {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(13, 18, 35, 0.9) 100%);
  border-color: rgba(96, 165, 250, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(96, 165, 250, 0.08);
}

.team-overview {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.team-overview__logo {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-overview__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-overview__logo-placeholder {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(183, 195, 230, 0.5);
}

.team-overview__info {
  flex: 1;
  min-width: 200px;
}

.team-overview__name {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: rgba(234, 240, 255, 0.98);
  line-height: 1.2;
}

.team-overview__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 14px;
}

.team-overview__label {
  color: rgba(183, 195, 230, 0.8);
  min-width: 80px;
}

.team-overview__meta .status-badge {
  font-size: 12px;
  padding: 4px 12px;
}

/* Status badge colors (esports) */
.status-approved { background: rgba(34, 197, 94, 0.2); border: 1px solid rgba(34, 197, 94, 0.5); color: #86efac; }
.status-pending { background: rgba(234, 179, 8, 0.2); border: 1px solid rgba(234, 179, 8, 0.5); color: #facc15; }
.status-rejected { background: rgba(239, 68, 68, 0.2); border: 1px solid rgba(239, 68, 68, 0.5); color: #fca5a5; }
.status-needs-changes { background: rgba(249, 115, 22, 0.2); border: 1px solid rgba(249, 115, 22, 0.5); color: #fdba74; }

.status-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.status-desc { font-size: 13px; margin: 0 0 8px; }
.status-rejection-msg { font-size: 13px; margin: 10px 0 0; }
.team-name-display { margin-top: 4px; }

.dashboard-card--roster-link { margin-top: 12px; }
.dashboard-card--roster-link .dashboard-card__desc { margin-bottom: 12px; }
.dashboard-card--history { margin-top: 16px; }
.application-history-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.application-history-item { font-size: 13px; padding: 8px 12px; background: rgba(0,0,0,0.2); border-radius: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.application-history-date { color: rgba(183,195,230,0.9); }

/* ---------- Team Logo (captain panel) ---------- */
.dashboard-card--team-logo { margin-bottom: 20px; }
.team-logo-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}
.team-logo-preview-wrap {
  flex-shrink: 0;
}
.team-logo-preview {
  width: 120px;
  height: 120px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.team-logo-preview--placeholder .team-logo-placeholder-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(183, 195, 230, 0.5);
}
.team-logo-preview .team-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.team-logo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.team-logo-message {
  font-size: 13px;
  margin: 0;
  min-height: 1.2em;
}
.team-logo-message.team-logo-message--success { color: rgba(34, 197, 94, 0.95); }
.team-logo-message.team-logo-message--error { color: #fca5a5; }

@media (max-width: 768px) {
  .team-logo-preview { width: 96px; height: 96px; }
}

/* ---------- Profile & Branding ---------- */
.branding-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 8px;
}

.branding-upload {
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  text-align: center;
}

.branding-upload__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(183, 195, 230, 0.9);
  margin-bottom: 12px;
}

.branding-upload__preview {
  width: 140px;
  height: 140px;
  margin: 0 auto 14px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.branding-upload__preview .preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.branding-upload__preview .preview-placeholder {
  font-size: 12px;
  color: rgba(183, 195, 230, 0.5);
}

.btn--upload {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(96, 165, 250, 0.4);
  background: rgba(96, 165, 250, 0.15);
  color: rgba(234, 240, 255, 0.95);
  border-radius: 10px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn--upload:hover {
  background: rgba(96, 165, 250, 0.25);
  border-color: rgba(96, 165, 250, 0.5);
  transform: translateY(-1px);
}

/* ---------- Roster table ---------- */
.roster-edit { margin-top: 12px; }

.roster-add-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.roster-add-input {
  flex: 1;
  min-width: 160px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 14px;
}

.roster-add-input::placeholder { color: rgba(183, 195, 230, 0.4); }

.roster-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.roster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.roster-table th,
.roster-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.roster-table th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(183, 195, 230, 0.8);
  background: rgba(0, 0, 0, 0.2);
}

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

.roster-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

.roster-row__avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.25), rgba(139, 92, 246, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  vertical-align: middle;
  overflow: hidden;
}

.roster-row__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.roster-row__name { font-weight: 600; color: rgba(234, 240, 255, 0.95); }
.roster-row__profile-link { font-size: 13px; font-weight: 600; color: rgba(96, 165, 250, 0.95); text-decoration: none; }
.roster-row__profile-link:hover { color: #93c5fd; text-decoration: underline; }

.roster-row__role {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.roster-row__role--captain {
  background: rgba(96, 165, 250, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #93c5fd;
}

.roster-row__role--player {
  background: rgba(183, 195, 230, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(183, 195, 230, 0.9);
}

.roster-remove {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.roster-remove:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
}

/* ---------- Team Name Change ---------- */
.team-name-pending {
  margin-bottom: 12px;
  font-size: 13px;
}

.team-name-form__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(183, 195, 230, 0.9);
  margin-bottom: 4px;
}

.team-name-current {
  margin-bottom: 14px;
  font-size: 14px;
}

.team-name-form__row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.team-name-form__input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 14px;
}

.btn--primary {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid rgba(96, 165, 250, 0.5);
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.35), rgba(139, 92, 246, 0.25));
  color: rgba(234, 240, 255, 0.98);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn--primary:hover {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.45), rgba(139, 92, 246, 0.35));
  border-color: rgba(96, 165, 250, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(96, 165, 250, 0.2);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .dashboard-card__inner { padding: 16px 18px; }
  .team-overview { gap: 16px; }
  .team-overview__logo { width: 72px; height: 72px; }
  .team-overview__name { font-size: 18px; }
  .branding-grid { grid-template-columns: 1fr; }
  .roster-table th, .roster-table td { padding: 10px 12px; font-size: 13px; }
  .team-name-form__row { flex-direction: column; align-items: stretch; }
  .team-name-form__input { min-width: 100%; }
}

@media (max-width: 480px) {
  .roster-add-row { flex-direction: column; align-items: stretch; }
  .roster-add-input { min-width: 100%; }
}

/* ---------- Match Center ---------- */
.match-center-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.match-center-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.match-center-item__teams {
  flex: 1;
  min-width: 180px;
  font-weight: 600;
  color: rgba(234, 240, 255, 0.95);
}

.match-center-item__round {
  font-size: 12px;
  color: rgba(183, 195, 230, 0.85);
}

.match-center-item__score {
  font-size: 14px;
  font-weight: 700;
  color: rgba(234, 240, 255, 0.9);
}

.match-center-item__status {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.match-center-item__status--upcoming {
  background: rgba(96, 165, 250, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #93c5fd;
}

.match-center-item__status--live {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.match-center-item__status--completed {
  background: rgba(183, 195, 230, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(183, 195, 230, 0.95);
}

.match-center-item__status--disputed {
  background: rgba(249, 115, 22, 0.2);
  border: 1px solid rgba(249, 115, 22, 0.5);
  color: #fdba74;
}

.match-center-item__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.match-center-item__view {
  font-size: 13px;
  font-weight: 600;
  color: rgba(96, 165, 250, 0.95);
  text-decoration: none;
}

.match-center-item__view:hover {
  color: #93c5fd;
  text-decoration: underline;
}

/* ---------- Submit match result modal ---------- */
.match-submit-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s ease, opacity 0.2s ease;
}

.match-submit-modal:not(.hide) {
  visibility: visible;
  opacity: 1;
}

.match-submit-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

.match-submit-modal__box {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: auto;
  background: rgba(13, 18, 35, 0.98);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(96, 165, 250, 0.1);
}

.match-submit-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.match-submit-modal__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: rgba(234, 240, 255, 0.98);
}

.match-submit-modal__close {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(183, 195, 230, 0.8);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.match-submit-modal__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.match-submit-modal__body {
  padding: 20px;
}

.match-submit-form .form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(183, 195, 230, 0.9);
  margin-bottom: 6px;
  margin-top: 12px;
}

.match-submit-form .form-label:first-of-type { margin-top: 0; }

.match-submit-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text, rgba(234, 240, 255, 0.95));
  font-size: 14px;
  box-sizing: border-box;
}

.match-submit-preview {
  margin-top: 8px;
  max-width: 200px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.match-submit-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.match-submit-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
