/* =========================================
   1. Variables & Reset (Design System)
   ========================================= */
:root {
  /* Colors */
  --primary: #00462e;
  /* FIFA Deep Green */
  --primary-dark: #003322;
  --secondary: #dcb043;
  /* Trophy Gold */
  --secondary-hover: #c49a32;
  --accent-red: #d12e2e;

  /* Neutral Colors */
  --bg-body: #f4f6f8;
  /* Light Grey Background */
  --bg-white: #ffffff;
  --text-main: #1a1a1a;
  --text-secondary: #5f6368;
  --border-color: #e0e0e0;

  /* Spacing & Layout */
  --container-width: 1200px;
  --header-height: 80px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);

  /* Typography */
  --font-base: 'Noto Sans TC', 'Poppins', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font-base);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.3s;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* =========================================
   2. Utility Classes
   ========================================= */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section-padding {
  padding: 80px 0;
}

.bg-light {
  background-color: #ffffff;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.center {
  text-align: center;
}

.mt-4 {
  margin-top: 2rem;
}

/* Grid System */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-gold {
  background: var(--secondary);
  color: #000;
}

.btn-gold:hover {
  background: var(--secondary-hover);
  transform: translateY(-2px);
}

.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-link {
  color: var(--primary);
  font-weight: 600;
}

.btn-link:hover {
  color: var(--secondary);
  text-decoration: underline;
}

.btn-lg {
  padding: 16px 48px;
  font-size: 1.2rem;
}

/* Headings */
h1,
h2,
h3 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--text-main);
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.section-header {
  margin-bottom: 40px;
}

.sub-title {
  color: var(--secondary);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 8px;
}

/* =========================================
   3. Navbar
   ========================================= */
.navbar {
  background: var(--primary);
  height: var(--header-height);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: 0.3s;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar.scrolled {
  background: rgba(0, 70, 46, 0.95);
  backdrop-filter: blur(10px);
}

.navbar-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 1px;
}

.logo img {
  height: 40px;
}

.nav-menu {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-size: 1rem;
}

.nav-link:hover {
  color: var(--secondary);
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #fff;
  min-width: 180px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
  padding: 8px 0;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu li a {
  display: block;
  padding: 10px 20px;
  color: var(--text-main);
  font-size: 0.95rem;
}

.dropdown-menu li a:hover {
  background: #f0f0f0;
  color: var(--primary);
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  transition: 0.3s;
}

/* =========================================
   4. Hero Section
   ========================================= */
.hero {
  position: relative;
  min-height: 600px;
  display: flex;
  align-items: center;
  /* 垂直置中 */
  justify-content: center;
  /* 水平置中 (修改這裡) */
  margin-top: 0;
  text-align: center;
  /* 文字置中 (新增這裡) */
}

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

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* 調整漸層：因為置中，讓黑色遮罩均勻一點比較好看 */
  background: rgba(0, 30, 20, 0.65);
}

.hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
  max-width: 800px;
  /* 稍微放寬一點，因為置中後空間比較大 */
  margin: 3rem auto 0 auto;
  /* 確保容器本身置中 */
  padding: 0 20px;
}

.hero-tag {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(5px);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--secondary);
  display: inline-block;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-content h1 {
  font-size: 3.5rem;
  line-height: 1.2;
  margin-bottom: 24px;
  color: #fff;
}

.hero-content p {
  font-size: 1.25rem;
  opacity: 0.9;
  margin-bottom: 32px;
  max-width: 600px;
  /* 限制內文寬度，避免文字太長難讀 */
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  /* 按鈕水平置中 (修改這裡) */
}

.hero-actions .btn-outline {
  border-color: #fff;
  color: #fff;
}

.hero-actions .btn-outline:hover {
  background: #fff;
  color: var(--primary);
}

/* =========================================
   Hero Countdown (新增倒數計時樣式)
   ========================================= */
.hero-countdown {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 30px;
  /* 與下方文字保持距離 */
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  /* 毛玻璃背景 */
  backdrop-filter: blur(8px);
  padding: 10px 15px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  min-width: 80px;
}

.count-num {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--secondary);
  /* 金色數字 */
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.count-label {
  font-size: 0.75rem;
  color: #ddd;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 5px;
}

.countdown-separator {
  font-size: 2rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 5px;
}

/* =========================================
   5. Features (Lazy Pack)
   ========================================= */
.feature-card {
  background: var(--bg-white);
  padding: 32px 24px;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: 0.3s;
  border: 1px solid transparent;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-color);
}

.icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.icon-green {
  background: #e6f4ea;
  color: var(--primary);
}

.icon-gold {
  background: #fff8e1;
  color: #f9a825;
}

.icon-blue {
  background: #e3f2fd;
  color: #1565c0;
}

.icon-red {
  background: #ffebee;
  color: #c62828;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* =========================================
   6. Host Countries (Card Design)
   ========================================= */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: 0.3s;
}

.host-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-img {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.5s;
}

.host-card:hover .card-img img {
  transform: scale(1.1);
}

.host-badge {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.card-body {
  padding: 24px;
}

.card-body h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: var(--primary);
}

.card-body p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* =========================================
   7. Teams Preview (Grid)
   ========================================= */
.teams-grid {
  margin-top: 30px;
}

.team-item {
  background: #fff;
  padding: 20px;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: 0.2s;
  border: 1px solid #f0f0f0;
}

.team-item:hover {
  border-color: var(--secondary);
  box-shadow: var(--shadow-md);
}

.team-item img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.team-item span {
  display: block;
  font-weight: 600;
  color: var(--text-main);
}

/* =========================================
   8. Groups Table (Clean Style)
   ========================================= */
.group-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.group-header h3 {
  font-size: 1.2rem;
  margin: 0;
}

.status-dot {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 10px;
  background: #eee;
  color: #666;
}

.status-dot.live {
  background: #ffebee;
  color: var(--accent-red);
  font-weight: bold;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th,
.table td {
  padding: 14px 24px;
  border-bottom: 1px solid #f0f0f0;
}

.table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
  background: #fafafa;
}

.table td {
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 500;
}

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

.table-hover tr:hover {
  background: #f9f9f9;
}

.flag-icon {
  width: 24px;
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 2px;
}

.tbd {
  color: #aaa;
  font-style: italic;
}

/* =========================================
   9. Schedule (Timeline)
   ========================================= */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 30px;
  /* Timeline line position */
  top: 0;
  height: 100%;
  width: 2px;
  background: #e0e0e0;
}

.match-row {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  position: relative;
}

.match-date {
  width: 60px;
  text-align: center;
  flex-shrink: 0;
  background: var(--bg-body);
  z-index: 2;
  padding: 10px 0;
  border: 2px solid var(--primary);
  border-radius: 12px;
  color: var(--primary);
  margin-right: 30px;
}

.match-date .day {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
}

.match-date .month {
  font-size: 0.8rem;
  font-weight: 600;
}

.match-card-h {
  flex-grow: 1;
  background: #fff;
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: 0.3s;
}

.match-card-h:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(5px);
}

.match-card-h .team-home,
.match-card-h .team-away {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  font-weight: 700;
  font-size: 1.1rem;
}

.match-card-h .team-home {
  justify-content: flex-end;
}

.match-card-h .team-away {
  justify-content: flex-start;
}

.match-card-h img {
  width: 32px;
}

.match-info {
  text-align: center;
  padding: 0 20px;
  min-width: 140px;
}

.match-info .time {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.match-info .venue {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* =========================================
   10. CTA & Footer
   ========================================= */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, #002e1e 100%);
  color: #fff;
  text-align: center;
  padding: 100px 0;
}

.cta-content h2 {
  color: #fff;
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.cta-content p {
  font-size: 1.2rem;
  margin-bottom: 32px;
  opacity: 0.9;
}

.footer {
  background: #111;
  color: #fff;
  padding: 60px 0 20px;
}

.footer-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  margin-bottom: 40px;
}

.footer-brand {
  flex: 2;
  min-width: 300px;
}

.footer-logo {
  width: 120px;
  margin-bottom: 20px;
}

.footer-brand p {
  color: #888;
  max-width: 400px;
}

.footer-links {
  flex: 1;
  min-width: 150px;
}

.footer-links h4 {
  margin-bottom: 20px;
  color: #fff;
  font-size: 1.1rem;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: #aaa;
}

.footer-links a:hover {
  color: var(--secondary);
}

.footer-bottom {
  border-top: 1px solid #333;
  pt: 20px;
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  padding-top: 20px;
}

.nav-cta {
  background-color: var(--secondary);
  color: #000;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.nav-cta:hover {
  background-color: var(--secondary-hover);
  transform: translateY(-2px);
}
/* =========================================
   11. RWD (Mobile & Tablet)
   ========================================= */
@media (max-width: 1024px) {
  .hero h1 {
    font-size: 2.8rem;
  }

  .grid-4,
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-6 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {

  /* Navbar */
  .hamburger {
    display: block;
    z-index: 1002;
    position: relative;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: #003322;
    flex-direction: column;
    padding-top: 80px;
    transition: 0.4s;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .nav-link {
    display: block;
    padding: 20px;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .nav-cta {
    margin: 20px;
    width: 80%;
    text-align: center;
  }

  /* Dropdown Mobile Fix */
  .dropdown-menu {
    position: static;
    /* 取消絕對定位，讓它佔據空間 */
    visibility: visible;
    opacity: 1;
    transform: none;
    background: rgba(223, 223, 223, 0.041);
    /* 稍微深一點的背景區隔 */
    box-shadow: none;
    display: none;
    /* 預設隱藏 */
    width: 100%;
    padding-left: 20px;
    /* 內縮增加層次感 */
    border-radius: 4px;
    margin-top: 5px;
  }
  .dropdown-menu li a {
    padding: 10px 0;  
    color: #ffffffb9;
  }

  /* 當 JS 加上 .active 類別時才顯示 */
  .dropdown.active .dropdown-menu {
    display: block;
  }

  /* 讓箭頭可以旋轉 (選用) */
  .dropdown-toggle::after {
    content: ' ▼';
    font-size: 0.7em;
    margin-left: 5px;
    display: inline-block;
    transition: 0.3s;
  }

  .dropdown.active .dropdown-toggle::after {
    transform: rotate(180deg);
  }

  .dropdown:hover .dropdown-menu {
  transform: translateX(0) translateY(0);
}
  /* Hero */
  .hero {
    height: auto;
    padding: 100px 0 60px;
    text-align: center;
    justify-content: center;
  }

  .hero-content {
    margin: 0 auto;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-countdown {
    gap: 8px;
  }

  .countdown-item {
    min-width: 60px;
    padding: 8px;
  }

  .count-num {
    font-size: 1.5rem;
  }

  .countdown-separator {
    font-size: 1.5rem;
    margin-top: 2px;
  }

  /* Grids */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Components */
  .timeline::before {
    left: 20px;
  }

  .match-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .match-date {
    display: flex;
    align-items: baseline;
    gap: 5px;
    width: auto;
    border: none;
    background: transparent;
    padding: 0 0 10px 0;
    margin: 0 0 0 20px;
  }

  .match-card-h {
    width: 100%;
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .match-card-h .team-home,
  .match-card-h .team-away {
    justify-content: center;
  }

  .match-info {
    padding: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    width: 100%;
  }

  .footer-flex {
    flex-direction: column;
    gap: 30px;
  }
}