/* =========================================
   Groups Page Specific Styles
   ========================================= */

/* 1. Page Hero (Re-using logic but adjusting height) */
.page-hero {
  position: relative;
  height: 35vh;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-top: 0;
  color: #fff;
  background: #000;
}

.page-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.page-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5; /* Slightly darker */
}

.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,70,46,0.9) 0%, rgba(0,0,0,0.5) 100%);
}

.page-hero-content {
  position: relative;
  z-index: 1;
}

.page-hero-content h1 {
  font-size: 2.8rem;
  margin-bottom: 12px;
}

/* 2. Legend Bar (圖例) */
.legend-bar {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.legend-content {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.indicator { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.indicator.promote { background: var(--primary); } /* 綠色 */
.indicator.wild { background: var(--secondary); opacity: 0.6; } /* 金色(半透明) */

/* 3. Grid Layout */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* 較寬的卡片適合表格 */
  gap: 30px;
}

/* 4. Group Card */
.group-card {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: 0.3s;
}

.group-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.group-header {
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.group-header h3 {
  font-size: 1.25rem;
  margin: 0;
  color: var(--primary);
}

.status-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f5f5f5;
  color: #888;
  font-weight: 600;
}

.status-badge.live {
  background: #e8f5e9;
  color: var(--primary);
  border: 1px solid rgba(0,70,46,0.2);
}

/* 5. Modern Table Design */
.table-responsive {
  width: 100%;
  overflow-x: auto; /* 防止手機版破版 */
}

.table-standings {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table-standings th {
  background: #fafafa;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 12px 8px;
  text-align: center;
  border-bottom: 1px solid #eee;
}

.table-standings td {
  padding: 12px 8px;
  text-align: center;
  border-bottom: 1px solid #f9f9f9;
  color: var(--text-main);
}

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

/* Column Specifics */
.col-pos { width: 40px; font-weight: 600; color: #aaa; }
.col-team { text-align: left; font-weight: 600; width: 45%; }
.col-team img { width: 20px; height: 15px; border-radius: 2px; vertical-align: middle; margin-right: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); display: inline-block; }
.col-stat { color: var(--text-secondary); font-family: 'Poppins', sans-serif; font-size: 0.9rem; }
.col-pts { font-weight: 700; color: var(--text-main); font-family: 'Poppins', sans-serif; background: rgba(0,0,0,0.02); }

/* Promotion Highlighting */
/* 直接晉級 (1-2名) */
.row-promote td:first-child {
  border-left: 4px solid var(--primary); /* 左側綠條 */
}
.row-promote { background: rgba(0, 70, 46, 0.02); }

/* 最佳第三 (3名) */
.row-wild td:first-child {
  border-left: 4px solid rgba(220, 176, 67, 0.5); /* 左側淡金條 */
}

/* Responsive Table */
@media (max-width: 480px) {
  /* 手機版隱藏 "淨勝球"，節省空間 */
  .mobile-hide { display: none; }
  
  .col-team { width: auto; font-size: 0.9rem; }
  .table-standings th, .table-standings td { padding: 10px 4px; }
  
  .page-hero h1 { font-size: 2rem; }
  .groups-grid { grid-template-columns: 1fr; }
}