/* ============================
   PLAYER PANEL & MATCH LIST MODAL STYLES
   Extracted from match.css for use on multiple pages
   ============================ */


/* Position badges keep their specific colors */
.pos-tag,
.position-badge {
    color: inherit !important;
}

.pos-tag.gk,
.position-badge.pos-goalkeeper,
.position-badge.pos-gk {
    color: #fff !important;
}

.pos-tag.df,
.position-badge.pos-defender,
.position-badge.pos-df {
    color: #fff !important;
}

.pos-tag.mf,
.position-badge.pos-midfielder,
.position-badge.pos-mf {
    color: #000 !important;
}

.pos-tag.fw,
.position-badge.pos-forward,
.position-badge.pos-fw {
    color: #000 !important;
}

/* Stat badges keep their colors */
.stat-badge.goals {
    color: #3fa63f !important;
}

.stat-badge.yellow {
    color: #ffeb3b !important;
}

.stat-badge.red {
    color: #ff4444 !important;
}

/* Match result badges */
.match-result.result-w {
    color: #3fa63f !important;
}

.match-result.result-d {
    color: #ffc107 !important;
}

.match-result.result-l {
    color: #d9534f !important;
}

/* Stat items with specific colors */
.stat-item.stat-win .stat-number {
    color: #3fa63f !important;
}

.stat-item.stat-draw .stat-number {
    color: #ffc107 !important;
}

.stat-item.stat-loss .stat-number {
    color: #d9534f !important;
}

/* Clickable stat items (yellow background with black text) */
.stat-item-clickable .stat-number,
.stat-item-clickable .stat-label {
    color: #000 !important;
}

/* Backdrop overlay for player panel */
.player-panel-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.player-panel-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.player-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 90%;
  max-width: 600px;
  height: 100vh;
  
  background: rgba(0, 22, 58, 0.95);
  backdrop-filter: blur(18px);
 

  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.25, 0.1, 0.25, 1);

  border-left: 2px solid rgba(255,255,255,0.08);
  box-shadow: -6px 0 18px rgba(0,0,0,0.45);

  z-index: 10001;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #ffffff;
  font-family: "Segoe UI", Roboto, sans-serif;
}


.player-panel.open {
  right: 0;
  transform: translateX(0);
}

.panel-scroll {
  flex: 1;
  overflow-y: auto !important;
  padding: 24px 22px;
  -webkit-overflow-scrolling: touch;
}

/* Close button */
.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  pointer-events: auto !important;
}

/* Header */
.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.popup-title h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  color: #7ab4ff !important;
}

.popup-subtitle {
  margin-top: 4px;
  font-size: 0.9rem;
  color: #c9d6ff !important;
}

/* Player photo */
.popup-photo img {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.25);
}

/* Section cards */
.popup-section {
  background: rgba(255,255,255,0.06);
  padding: 16px 18px;
  border-radius: 10px;
  margin-bottom: 18px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.popup-section h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.1rem;
  color: #7ab4ff !important;
}

.popup-section p {
  margin: 4px 0;
  font-size: 0.95rem;
}

/* Match events */
.match-events div {
  margin: 6px 0;
  font-size: 0.95rem;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px 0;
  font-size: 1.1rem;
  opacity: 0.8;
}

.popup-name {
    margin: 0;
    font-size: 22px;
    font-weight: bold;
}

.popup-position {
    font-size: 14px;
    color: #ccc;
}

.popup-field {
    margin: 4px 0;
}

.popup-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popup-list li {
    margin: 4px 0;
}

/* ==== CARD-BASED LAYOUT STYLES ==== */

.popup-nav-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.nav-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(122, 180, 255, 0.3);
    background: rgba(122, 180, 255, 0.12);
    color: #7ab4ff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover:not(:disabled) {
    background: rgba(122, 180, 255, 0.25);
    border-color: rgba(122, 180, 255, 0.6);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.popup-profile {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 14px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.popup-name-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.popup-name-badge h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #7ab4ff;
    letter-spacing: -0.3px;
}

.position-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 14px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.4px;
    background: #0057b8;
    color: #ffffff;
    white-space: nowrap;
}

/* Position-specific colors matching match.php pos-tag */
.position-badge.pos-goalkeeper,
.position-badge.pos-gk {
    background: #3fa63f; /* Green */
    color: #fff;
}

.position-badge.pos-defender,
.position-badge.pos-df {
    background: #d9534f; /* Red */
    color: #fff;
}

.position-badge.pos-midfielder,
.position-badge.pos-mf {
    background: #5bc0de; /* Blue */
    color: #000 !important;
}

.position-badge.pos-forward,
.position-badge.pos-fw {
    background: #ff9f1c; /* Orange */
    color: #000 !important;
}

.popup-info-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.85rem;
    line-height: 1.3;
}

.info-label {
    color: #a8b8d8;
    font-weight: 500;
    font-size: 0.85rem;
}

.info-value {
    color: #ffffff;
}

/* STAT CARDS */
.stat-card {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px 12px;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #7ab4ff;
    text-transform: uppercase;
    letter-spacing: 0.35px;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 8px;
}

/* Default stat item = STATIC (non-clickable), no cursor pointer, no hover effects */
.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: rgba(0, 43, 102, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
    cursor: default;
}

.stat-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: #7ab4ff;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.65rem;
    color: #a8b8d8;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    margin-top: 2px;
    font-weight: 500;
}

/* Clickable stat items (APPS tile only) - yellow background with black text */
.stat-item-clickable {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.5) !important;
    cursor: pointer !important;
    transition: all 0.2s ease;
}

.stat-item-clickable .stat-number {
    color: #000 !important;
}

.stat-item-clickable .stat-label {
    color: #000 !important;
    font-weight: 700 !important;
}

.stat-item-clickable:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.6);
}

/* Color-coded stat tiles - W/D/L (static, no click/hover behavior) */
.stat-item.stat-win {
    background: rgba(63, 166, 63, 0.2) !important;
    border: 1px solid rgba(63, 166, 63, 0.4) !important;
    cursor: default !important;
}

.stat-item.stat-win .stat-number {
    color: #3fa63f !important;
}

.stat-item.stat-draw {
    background: rgba(255, 193, 7, 0.2) !important;
    border: 1px solid rgba(255, 193, 7, 0.4) !important;
    cursor: default !important;
}

.stat-item.stat-draw .stat-number {
    color: #ffc107 !important;
}

.stat-item.stat-loss {
    background: rgba(217, 83, 79, 0.2) !important;
    border: 1px solid rgba(217, 83, 79, 0.4) !important;
    cursor: default !important;
}

.stat-item.stat-loss .stat-number {
    color: #d9534f !important;
}

/* Ensure static (non-clickable) tiles never show hover feedback */
.stat-item:not(.stat-item-clickable):hover {
    transform: none !important;
    box-shadow: none !important;
}

.stat-item-disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
}

.stat-item-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Clickable stat cards */
.stat-card-link {
    text-decoration: none;
    display: block;
}

.stat-card-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.stat-card-clickable:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(122, 180, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stat-card-clickable h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-arrow {
    font-size: 1.1rem;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.stat-card-clickable:hover .card-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* Match List Panel (Centered Modal) */
.match-list-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    z-index: 10002;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none !important;
    transition: opacity 0.3s ease;
}

.match-list-modal.open {
    display: flex;
    opacity: 1;
    pointer-events: auto !important;
    overflow: hidden;
}

/* CRITICAL FIX: Ensure modal content allows clicks */
.match-list-modal.open * {
    pointer-events: auto !important;
}

/* But keep backdrop click-through behavior */
.match-list-modal.open > :not(.match-list-container) {
    pointer-events: none !important;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden !important;
}

.match-list-container {
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    background: linear-gradient(135deg, rgba(0, 22, 58, 0.95), rgba(0, 33, 70, 0.95));
    border-radius: 16px;
    border: 2px solid rgba(122, 180, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.match-list-modal.open .match-list-container {
    transform: scale(1);
}

.match-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.match-list-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #ffffff;
    flex: 1;
    text-align: center;
}

.back-btn {
    background: rgba(122, 180, 255, 0.15);
    border: 1px solid rgba(122, 180, 255, 0.3);
    color: #7ab4ff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: rgba(122, 180, 255, 0.25);
    border-color: rgba(122, 180, 255, 0.5);
}

.match-list-header .close-btn {
    position: static;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-list-header .close-btn:hover {
    background: rgba(255,255,255,0.25);
}

.match-list-content {
    flex: 1;
    overflow-y: auto !important;
    max-height: calc(85vh - 80px) !important;
    padding: 20px 24px;
    padding-bottom: 40px;
    background: rgba(0, 22, 58, 0.95);
}

.match-list-header-info {
    margin-bottom: 20px;
    text-align: center;
}

.match-list-header-info h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #fff;
}

.match-list-header-info p {
    margin: 0;
    color: #a8b8d8;
    font-size: 0.9rem;
}

.match-list-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.match-list-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px 16px;
    text-decoration: none !important;
    color: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
    display: block;
}

.match-list-item:visited,
.match-list-item:link,
.match-list-item:active {
    text-decoration: none !important;
    color: #fff;
}

.match-list-item:hover {
    background: rgba(0, 87, 184, 0.15);
    border-color: rgba(0, 87, 184, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 87, 184, 0.25);
}

.match-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.75rem;
}

.match-date {
    color: #8ab4f8;
    font-weight: 600;
    font-size: 0.8rem;
}

.match-comp {
    color: #7ab4ff;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.match-item-details {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.match-opponent {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    flex: 1;
}

.match-venue {
    color: #a8b8d8;
    font-size: 0.75rem;
    font-weight: 500;
}

.match-result {
    margin-left: auto;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 60px;
    text-align: center;
}

.match-result.result-w {
    background: rgba(63, 166, 63, 0.2);
    color: #3fa63f;
    border: 1px solid rgba(63, 166, 63, 0.4);
}

.match-result.result-d {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.match-result.result-l {
    background: rgba(217, 83, 79, 0.2);
    color: #d9534f;
    border: 1px solid rgba(217, 83, 79, 0.4);
}

.match-item-stats {
    display: flex;
    gap: 8px;
    align-items: center;
}

.stat-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stat-badge.goals {
    background: rgba(63, 166, 63, 0.2);
    color: #3fa63f;
    border: 1px solid rgba(63, 166, 63, 0.3);
}

.stat-badge.yellow {
    background: rgba(255, 235, 59, 0.2);
    color: #ffeb3b;
    border: 1px solid rgba(255, 235, 59, 0.3);
}

.stat-badge.red {
    background: rgba(255, 0, 0, 0.2);
    color: #ff4444;
    border: 1px solid rgba(255, 0, 0, 0.3);
}

/* Appearances by Manager list */
.manager-apps-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.manager-apps-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0, 43, 102, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.manager-apps-row:hover {
    background: rgba(122, 180, 255, 0.15);
    border-color: rgba(122, 180, 255, 0.4);
    transform: translateY(-1px);
}

.manager-apps-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
}

.manager-apps-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.manager-apps-count {
    color: #ffd700;
    font-weight: 700;
}

.manager-apps-sep {
    color: #a8b8d8;
    opacity: 0.6;
}

.manager-apps-goals {
    color: #5cd65c;
    font-weight: 700;
}


