/* ==========================================================================
   TURNAMEN VOLI - GLOBAL CSS DESIGN SYSTEM
   Modern, Clean, Sports Dashboard Theme (No Frameworks)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Color Palette */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-glow: rgba(37, 99, 235, 0.2);

  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --accent-win: #10b981;
  --accent-win-bg: #d1fae5;
  --accent-loss: #ef4444;
  --accent-loss-bg: #fee2e2;
  --accent-warning: #f59e0b;
  --accent-warning-bg: #fef3c7;

  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* Geometry & Shadows */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 10px 25px -5px rgba(37, 99, 235, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  --transition: all 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

ul {
  list-style: none;
}

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

/* Layout Container */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Header Navbar */
.navbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-sm);
}

.brand span.accent {
  color: var(--primary);
}

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

.nav-link {
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.nav-link i {
  font-size: 1.05rem;
}

.nav-admin-btn {
  background-color: var(--primary);
  color: white !important;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.nav-admin-btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

/* Mobile Hamburger Toggle */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.5rem;
}

/* Main Content Layout */
.main-wrapper {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Hero Banner */
.hero-banner {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #3b82f6 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 350px;
  height: 350px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.25;
}

.hero-desc {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 650px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* Primary & Secondary Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-light {
  background-color: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.btn-light:hover {
  background-color: #f8fafc;
  color: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-light);
}

.btn-danger {
  background-color: var(--accent-loss);
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

/* Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.green {
  background: var(--accent-win-bg);
  color: var(--accent-win);
}

.stat-icon.orange {
  background: var(--accent-warning-bg);
  color: var(--accent-warning);
}

.stat-info .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-info .stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title i {
  color: var(--primary);
}

/* Card Surface */
.card-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  transition: var(--transition);
}

/* Data Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.data-table th {
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background-color: rgba(241, 245, 249, 0.6);
}

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

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-pending {
  background-color: #f1f5f9;
  color: #475569;
}

.badge-live {
  background-color: #fef3c7;
  color: #d97706;
  animation: pulse 2s infinite;
}

.badge-success {
  background-color: var(--accent-win-bg);
  color: var(--accent-win);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Match Cards Grid (For Hasil Pertandingan) */
.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.match-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.match-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-glow);
}

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.75rem;
}

.match-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.team-box {
  flex: 1;
  text-align: center;
}

.team-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.team-name.winner {
  color: var(--primary);
}

.match-score-badge {
  background: var(--bg-subtle);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-main);
  letter-spacing: 2px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.match-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--primary-light);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* Horizontal Bar Chart (Standings Visualizer) */
.chart-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.chart-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chart-label-row {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.9rem;
}

.chart-bar-track {
  height: 24px;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.chart-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #3b82f6);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-bar-item:nth-child(1) .chart-bar-fill {
  background: linear-gradient(90deg, #10b981, #34d399);
}

/* Search and Filter Bar */
.filter-bar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.search-input-group {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-input-group i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg-surface);
  color: var(--text-main);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

select.form-control {
  padding-left: 1rem;
  cursor: pointer;
}

.filter-tabs {
  display: flex;
  background: var(--bg-subtle);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  gap: 0.25rem;
}

.filter-tab {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
}

.filter-tab.active {
  background: white;
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.empty-state h4 {
  font-size: 1.2rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

/* Scroll To Top Button */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 99;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  background: var(--primary-hover);
  transform: translateY(-3px);
}

/* Footer */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 0;
  margin-top: auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .hero-title {
    font-size: 1.85rem;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 65px;
    left: 0;
    width: 100%;
    background: var(--bg-surface);
    flex-direction: column;
    padding: 1.5rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-150%);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    width: 100%;
    justify-content: flex-start;
    padding: 0.8rem 1rem;
  }

  .hero-banner {
    padding: 2rem 1.5rem;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-tabs {
    overflow-x: auto;
  }
}
