/* ============================================================
   MML — Midnight Metropolitan League
   Component Styles
   ============================================================ */


/* ============================================================
   1. CARD — Glassmorphism
   ============================================================ */
.card {
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(13, 21, 32, 0.85) 0%,
    rgba(26, 39, 68, 0.45) 100%
  );
  border: 1px solid rgba(74, 111, 165, 0.12);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: var(--space-xl);
  transition:
    border-color var(--transition-medium),
    box-shadow var(--transition-medium),
    transform var(--transition-medium);
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    ellipse at 30% 0%,
    rgba(74, 111, 165, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.card:hover {
  border-color: rgba(74, 111, 165, 0.25);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}


/* ============================================================
   2. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.75rem;
  min-height: 44px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

/* ---- Primary ---- */
.btn-primary {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-navy-mid) 100%);
  color: var(--color-pearl-bright);
  box-shadow: 0 4px 16px rgba(74, 111, 165, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(74, 111, 165, 0.4);
  transform: translateY(-1px);
}

/* Shine sweep on hover */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 100%
  );
  transition: left 0.5s var(--transition-smooth);
}

.btn-primary:hover::after {
  left: 100%;
}

/* ---- Outline ---- */
.btn-outline {
  background: transparent;
  color: var(--color-pearl);
  border: 1px solid rgba(74, 111, 165, 0.35);
}

.btn-outline:hover {
  background: rgba(74, 111, 165, 0.1);
  border-color: var(--color-accent);
  color: var(--color-pearl-bright);
}


/* ============================================================
   3. BADGES — Result Indicators
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 0.15rem 0.55rem;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  line-height: 1.4;
}

.badge-win {
  background: rgba(46, 160, 67, 0.15);
  color: #3fb950;
  border: 1px solid rgba(46, 160, 67, 0.3);
}

.badge-loss {
  background: rgba(218, 54, 51, 0.15);
  color: #f85149;
  border: 1px solid rgba(218, 54, 51, 0.3);
}

.badge-draw {
  background: rgba(210, 170, 80, 0.15);
  color: #d2aa50;
  border: 1px solid rgba(210, 170, 80, 0.3);
}


/* ============================================================
   4. TABLES — Standings & Stats
   ============================================================ */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(74, 111, 165, 0.12);
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.stats-table thead {
  position: sticky;
  top: 0;
  z-index: var(--z-base);
}

.stats-table th {
  background: var(--color-navy);
  color: var(--color-pearl-dim);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.85rem 1rem;
  text-align: left;
  white-space: nowrap;
}

.stats-table th:first-child {
  border-radius: var(--radius-lg) 0 0 0;
}

.stats-table th:last-child {
  border-radius: 0 var(--radius-lg) 0 0;
}

.stats-table td {
  padding: 0.85rem 1rem;
  color: var(--color-pearl);
  border-bottom: 1px solid rgba(74, 111, 165, 0.08);
  white-space: nowrap;
}

.stats-table tbody tr {
  background: var(--color-bg-card);
  transition: background var(--transition-fast);
}

/* ---- Striped Rows ---- */
.stats-table tbody tr:nth-child(even) {
  background: rgba(13, 21, 32, 0.6);
}

/* ---- Hover Highlight ---- */
.stats-table tbody tr:hover {
  background: rgba(74, 111, 165, 0.1);
}

/* ---- Rank Column ---- */
.stats-table .rank {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-gold);
  text-align: center;
  width: 40px;
}

/* ---- Team Name in Table ---- */
.stats-table .team-name {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  color: var(--color-pearl-bright);
}


/* ============================================================
   5. SECTION HEADER
   ============================================================ */
.section-header {
  margin-bottom: var(--space-2xl);
}

.section-header .section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.section-header .section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 2px;
  background: var(--color-accent);
  border-radius: var(--radius-full);
}

.section-header .section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--color-pearl-bright);
  line-height: 1.15;
}

.section-header .section-line {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), transparent);
  border-radius: var(--radius-full);
  margin-top: var(--space-md);
}


/* ============================================================
   6. TEAM BADGE — Color Indicator
   ============================================================ */
.team-badge {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.team-badge--platinum   { background: var(--team-platinum);   color: var(--team-platinum);   }
.team-badge--diamond    { background: var(--team-diamond);    color: var(--team-diamond);    box-shadow: 0 0 6px rgba(42, 42, 42, 0.6); }
.team-badge--ome        { background: var(--team-ome);        color: var(--team-ome);        }
.team-badge--mitsubishi { background: var(--team-mitsubishi); color: var(--team-mitsubishi); }
.team-badge--marubeni   { background: var(--team-marubeni);   color: var(--team-marubeni);   }
.team-badge--sj         { background: var(--team-sj);         color: var(--team-sj);         }


/* ============================================================
   7. MATCH CARD — Game Result
   ============================================================ */
.match-card {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: linear-gradient(
    135deg,
    rgba(13, 21, 32, 0.9) 0%,
    rgba(26, 39, 68, 0.4) 100%
  );
  border: 1px solid rgba(74, 111, 165, 0.1);
  border-radius: var(--radius-lg);
  transition:
    border-color var(--transition-medium),
    box-shadow var(--transition-medium);
}

.match-card:hover {
  border-color: rgba(74, 111, 165, 0.25);
  box-shadow: var(--shadow-glow);
}

/* ---- Date / Meta ---- */
.match-card .match-date {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-pearl-dim);
  flex-shrink: 0;
  min-width: 80px;
}

/* ---- Teams ---- */
.match-card .match-teams {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
}

.match-card .match-team {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-pearl-bright);
}

.match-card .match-team img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.match-card .match-vs {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--color-pearl-dim);
  letter-spacing: 0.05em;
}

/* ---- Score ---- */
.match-card .match-score {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  color: var(--color-pearl-bright);
  flex-shrink: 0;
}

.match-card .match-score .score-separator {
  color: var(--color-pearl-dim);
  margin: 0 0.15em;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .match-card {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
    padding: var(--space-md);
  }

  .match-card .match-teams {
    flex-direction: column;
    gap: var(--space-sm);
  }
}


/* ============================================================
   8. DIVIDER — Decorative Line
   ============================================================ */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-2xl) 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(74, 111, 165, 0.2),
    transparent
  );
}

.divider .divider-diamond {
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  transform: rotate(45deg);
  flex-shrink: 0;
  opacity: 0.6;
}


/* ============================================================
   9. TAG — Small Label
   ============================================================ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-pearl-dim);
  background: rgba(74, 111, 165, 0.1);
  border: 1px solid rgba(74, 111, 165, 0.15);
  border-radius: var(--radius-full);
  white-space: nowrap;
}
