﻿/* =============================================
   Leagues CSS v2  Dashboard Style
   ============================================= */

/* League grid  slightly wider than lobby-grid */
.lg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

/* ---- League Card ---- */
.lg-card {
  background: rgba(20, 32, 52, 0.88);
  border: 1px solid rgba(100, 160, 220, 0.13);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.lg-card:hover {
  border-color: rgba(255, 123, 71, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 123, 71, 0.12);
}
.lg-card .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lg-card .title {
  font-weight: 800;
  color: #e2ecff;
  font-size: 1rem;
  letter-spacing: 0.4px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lg-dates {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: rgba(180, 210, 245, 0.65);
}
.lg-dates i { color: #ff7b47; margin-right: 4px; }
.lg-desc {
  font-size: 0.82rem;
  color: rgba(180, 210, 245, 0.5);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lg-card .footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(100, 160, 220, 0.1);
}
.lg-founder { font-size: 0.8rem; color: rgba(180, 210, 245, 0.6); }
.lg-founder i { color: #f59e0b; margin-right: 4px; }

/* ---- Status Badges ---- */
.lg-status-upcoming {
  background: rgba(59, 130, 246, 0.18); color: #7ab4f5;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 12px; padding: 2px 10px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; white-space: nowrap;
}
.lg-status-active {
  background: rgba(34, 197, 94, 0.15); color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 12px; padding: 2px 10px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; white-space: nowrap;
}
.lg-status-finished {
  background: rgba(148, 163, 184, 0.12); color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px; padding: 2px 10px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; white-space: nowrap;
}

/* ---- Delete btn on card ---- */
.btn-delete {
  border: 1px solid rgba(220, 53, 69, 0.32);
  border-radius: 8px; padding: 5px 10px;
  font-size: 0.75rem; font-weight: 700;
  background: rgba(220, 53, 69, 0.18); color: #ff7b7b;
  cursor: pointer; transition: background 0.15s; font-family: inherit;
}
.btn-delete:hover { background: rgba(220, 53, 69, 0.35); }

/* ---- Toast notifications ---- */
.lg-toast {
  background: rgba(20, 32, 52, 0.97);
  border: 1px solid rgba(100, 160, 220, 0.2);
  border-radius: 10px; padding: 12px 18px;
  font-size: 0.88rem; color: #e2ecff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  min-width: 260px; max-width: 380px;
  display: flex; align-items: center; gap: 10px;
  animation: lg-toast-in 0.2s ease;
}
.lg-toast.success { border-left: 3px solid #22c55e; }
.lg-toast.error   { border-left: 3px solid #ef4444; }
@keyframes lg-toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---- League Details Header ---- */
.league-details-header {
  background: rgba(13, 21, 36, 0.9);
  padding: 22px; border-radius: 12px; margin-bottom: 20px;
  border: 1px solid rgba(255, 123, 71, 0.18);
}
.league-details-title { font-size: 1.5rem; font-weight: 800; color: #e2ecff; margin-bottom: 8px; }
.league-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.league-details-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.league-meta-item { display: flex; align-items: center; gap: 6px; color: rgba(180, 210, 245, 0.7); font-size: 0.85rem; }
.league-meta-item i { color: #ff7b47; }

/* ---- Details Tabs ---- */
.league-details-tabs { margin-bottom: 20px; }
.league-details-tabs .nav-link {
  color: rgba(180, 210, 245, 0.55);
  border: 1px solid rgba(100, 160, 220, 0.12);
  background: transparent; margin-right: 6px; border-radius: 8px;
  padding: 8px 16px; font-size: 0.83rem; font-weight: 600;
  transition: color 0.15s, border-color 0.15s;
}
.league-details-tabs .nav-link:hover { color: rgba(200, 230, 255, 0.85); }
.league-details-tabs .nav-link.active {
  color: #ff7b47; background: rgba(255, 123, 71, 0.1); border-color: rgba(255, 123, 71, 0.4);
}

/* ---- Standings Table ---- */
.standings-table {
  background: rgba(13, 21, 36, 0.7);
  border-radius: 10px; overflow: hidden;
  border: 1px solid rgba(100, 160, 220, 0.1);
}
.standings-table table { width: 100%; margin: 0; }
.standings-table thead { background: rgba(255, 123, 71, 0.08); }
.standings-table th {
  color: #ff7b47; font-weight: 700; padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 123, 71, 0.2);
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px;
}
.standings-table td {
  color: #e2ecff; padding: 10px;
  border-bottom: 1px solid rgba(100, 160, 220, 0.07); font-size: 0.88rem;
}
.standings-table tbody tr:hover { background: rgba(255, 123, 71, 0.04); }
.standings-position { font-weight: 800; color: #ff7b47; width: 40px; text-align: center; }
.standings-player { display: flex; align-items: center; gap: 8px; }
.standings-player-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255, 123, 71, 0.3); }
.standings-stats { text-align: center; color: rgba(180, 210, 245, 0.8); }
.standings-points { font-weight: 800; color: #4ade80; font-size: 1rem; text-align: center; }

/* ---- Match Cards ---- */
.match-card {
  background: rgba(20, 32, 52, 0.88);
  border: 1px solid rgba(100, 160, 220, 0.12);
  border-radius: 12px; padding: 16px; margin-bottom: 12px;
  transition: border-color 0.15s;
}
.match-card:hover { border-color: rgba(255, 123, 71, 0.3); }
.match-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.match-round { color: #ff7b47; font-weight: 700; font-size: 0.85rem; }
.match-date { color: rgba(180, 210, 245, 0.5); font-size: 0.8rem; }
.match-players { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-bottom: 14px; }
.match-player { display: flex; align-items: center; gap: 10px; }
.match-player.right { flex-direction: row-reverse; }
.match-player.right .match-player-info { text-align: right; }
.match-player-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255, 123, 71, 0.25); }
.match-player-name { color: #e2ecff; font-weight: 700; font-size: 1rem; }
.match-vs { color: #ff7b47; font-weight: 900; font-size: 1.4rem; text-align: center; }
.match-score { font-size: 1.7rem; font-weight: 900; color: rgba(180, 210, 245, 0.6); }
.match-score.winner { color: #4ade80; }
.match-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid rgba(100, 160, 220, 0.08); }
.match-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.match-status { padding: 3px 10px; border-radius: 16px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.match-status.scheduled { background: rgba(59,130,246,0.15); color: #7ab4f5; border: 1px solid rgba(59,130,246,0.3); }
.match-status.in_progress { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.match-status.completed { background: rgba(34,197,94,0.12); color: #4ade80; border: 1px solid rgba(34,197,94,0.28); }

/* ---- Participants ---- */
.participant-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: rgba(20, 32, 52, 0.7); border: 1px solid rgba(100, 160, 220, 0.1); border-radius: 10px; margin-bottom: 8px; }
.participant-info { display: flex; align-items: center; gap: 10px; }
.participant-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255, 123, 71, 0.25); }
.participant-name { color: #e2ecff; font-weight: 600; font-size: 0.92rem; }

/* ---- Search / Participant picker ---- */
.search-results { max-height: 200px; overflow-y: auto; background: rgba(13, 21, 36, 0.95); border: 1px solid rgba(100, 160, 220, 0.15); border-radius: 8px; }
.search-result-item { padding: 9px 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(100, 160, 220, 0.07); transition: background 0.15s; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: rgba(255, 123, 71, 0.1); }
.search-result-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.search-result-name { color: #e2ecff; font-weight: 500; font-size: 0.88rem; }

.selected-participants { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; background: rgba(13, 21, 36, 0.5); border: 1px solid rgba(100, 160, 220, 0.12); border-radius: 8px; min-height: 52px; }
.selected-participant { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: rgba(255, 123, 71, 0.15); border: 1px solid rgba(255, 123, 71, 0.35); border-radius: 16px; color: #e2ecff; font-size: 0.83rem; }
.selected-participant i { cursor: pointer; color: #ff7b7b; }
.selected-participant i:hover { color: #ef4444; }

/* ---- Leg form ---- */
.leg-form { background: rgba(13, 21, 36, 0.6); border: 1px solid rgba(100, 160, 220, 0.12); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.leg-form-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.leg-form-title { color: #ff7b47; font-weight: 700; font-size: 0.9rem; }
.leg-form-remove { color: #ff7b7b; cursor: pointer; font-size: 1rem; }
.leg-form-remove:hover { color: #ef4444; }

/* ---- League info block ---- */
.league-info { display: flex; flex-direction: column; gap: 6px; color: rgba(180, 210, 245, 0.7); font-size: 0.87rem; }
.league-info i { color: #ff7b47; margin-right: 6px; width: 14px; }

/* ---- Status used in details modal (legacy aliases) ---- */
.league-status { padding: 3px 10px; border-radius: 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.league-status.upcoming  { background: rgba(59,130,246,0.18);  color:#7ab4f5; border:1px solid rgba(59,130,246,0.35); }
.league-status.active    { background: rgba(34,197,94,0.15);   color:#4ade80; border:1px solid rgba(34,197,94,0.35); }
.league-status.finished  { background: rgba(148,163,184,0.12); color:#94a3b8; border:1px solid rgba(148,163,184,0.25); }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .match-players { grid-template-columns: 1fr; gap: 10px; }
  .match-player.right { flex-direction: row; }
  .match-player.right .match-player-info { text-align: left; }
  .match-vs { display: none; }
  .lg-grid { grid-template-columns: 1fr; }
}
