/* ============ CSS VARIABLES ============ */
:root {
  --primary: #1a237e;
  --primary-light: #3949ab;
  --primary-dark: #0d1642;
  --accent: #ffc107;
  --accent-dark: #ff8f00;
  --gold: #d4af37;
  --gold-light: #f0d060;
  --bg-dark: #0a0e27;
  --bg-card: #131736;
  --bg-card-hover: #1a1f45;
  --text-white: #ffffff;
  --text-light: #b0bec5;
  --text-muted: #78909c;
  --success: #4caf50;
  --danger: #f44336;
  --border-color: rgba(255,255,255,0.08);
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
}

/* ============ RESET & BASE ============ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-dark);
  color: var(--text-white);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--gold-light); }

/* ============ HEADER / NAVBAR ============ */
.navbar {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 0.8rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
  border-bottom: 2px solid var(--gold);
}

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

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-wrapper img {
  height: 42px;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(76, 175, 80, 0.15);
  color: var(--success);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(76, 175, 80, 0.3);
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.logo-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

.nav-links {
  display: flex;
  list-style: none;
  gap: 0;
  align-items: center;
}

.nav-links li a,
.nav-links li button {
  color: var(--text-white);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.6rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.3s;
  border-radius: var(--radius-sm);
  display: block;
}

.nav-links li a:hover,
.nav-links li button:hover,
.nav-links li a.active,
.nav-links li button.active {
  background: rgba(255,193,7,0.15);
  color: var(--accent);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* ============ CONTAINER ============ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ============ HERO SECTION ============ */
.hero-section {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #283593 100%);
  padding: 2.5rem 0;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,193,7,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(57,73,171,0.2) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-title {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.hero-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ============ LATEST RESULT CARD ============ */
.latest-result-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: -1.5rem auto 2rem;
  max-width: 900px;
  position: relative;
  z-index: 2;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.result-date {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.result-date strong {
  color: var(--accent);
}

.result-label {
  background: linear-gradient(135deg, var(--gold), var(--accent-dark));
  color: var(--primary-dark);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.prize-section {
  margin-bottom: 1.5rem;
}

.prize-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.8rem;
  text-align: center;
}

.prize-title.first { color: var(--gold); }
.prize-title.second { color: #90caf9; }
.prize-title.third { color: #a5d6a7; }

.ball-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.ball {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: white;
  position: relative;
  animation: ballDrop 0.5s ease-out;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.ball.gold {
  background: linear-gradient(145deg, #ffd54f, #ff8f00);
  box-shadow: 0 4px 15px rgba(255,193,7,0.4), inset 0 -3px 6px rgba(0,0,0,0.15);
}

.ball.blue {
  background: linear-gradient(145deg, #42a5f5, #1565c0);
  box-shadow: 0 4px 15px rgba(33,150,243,0.4), inset 0 -3px 6px rgba(0,0,0,0.15);
}

.ball.green {
  background: linear-gradient(145deg, #66bb6a, #2e7d32);
  box-shadow: 0 4px 15px rgba(76,175,80,0.4), inset 0 -3px 6px rgba(0,0,0,0.15);
}

.ball::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 12px;
  width: 14px;
  height: 8px;
  background: rgba(255,255,255,0.35);
  border-radius: 50%;
  transform: rotate(-30deg);
}

@keyframes ballDrop {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.prizes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.prize-box {
  text-align: center;
  padding: 1rem;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

/* ============ COUNTDOWN SECTION ============ */
.countdown-section {
  background: linear-gradient(135deg, var(--primary) 0%, #283593 100%);
  padding: 2rem 0;
  text-align: center;
  border-top: 2px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
}

.countdown-title {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.countdown-wrapper {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.countdown-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  min-width: 100px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.countdown-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.3rem;
}

.countdown-draw-time {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.countdown-draw-time strong {
  color: var(--accent);
}

/* ============ LIVE DRAW ============ */
.livedraw-section {
  padding: 3rem 0;
}

.livedraw-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.livedraw-status.waiting {
  background: rgba(255, 193, 7, 0.15);
  color: var(--accent);
  border-color: rgba(255, 193, 7, 0.3);
}

.livedraw-status::before {
  content: '';
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.draw-animation-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

/* ============ HISTORY TABLE ============ */
.history-section {
  padding: 2rem 0 3rem;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.results-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.results-table thead {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.results-table th {
  padding: 1rem;
  text-align: center;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  font-weight: 700;
  border-bottom: 2px solid var(--gold);
}

.results-table td {
  padding: 0.85rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  transition: background 0.2s;
}

.results-table tbody tr:hover {
  background: var(--bg-card-hover);
}

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

.table-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  margin: 0 2px;
}

.table-ball.gold { background: linear-gradient(145deg, #ffd54f, #ff8f00); }
.table-ball.blue { background: linear-gradient(145deg, #42a5f5, #1565c0); }
.table-ball.green { background: linear-gradient(145deg, #66bb6a, #2e7d32); }

.day-badge {
  background: rgba(255,193,7,0.1);
  color: var(--accent);
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ============ PAGINATION ============ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.pagination button {
  background: var(--bg-card);
  color: var(--text-white);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.pagination button:hover,
.pagination button.active {
  background: var(--accent);
  color: var(--primary-dark);
  border-color: var(--accent);
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ============ FOOTER ============ */
.footer {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #0a0e27 100%);
  padding: 2rem 0 1rem;
  border-top: 2px solid var(--gold);
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.footer-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.footer-payments {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1rem;
}

.footer-payments img {
  height: 30px;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.footer-payments img:hover {
  opacity: 1;
}

.footer-right {
  text-align: right;
}

.footer-wla {
  width: 100px;
  opacity: 0.7;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--accent);
}

/* ============ PAGE SECTIONS ============ */
.page-section {
  display: none;
  min-height: 60vh;
}

.page-section.active {
  display: block;
}

/* ============ POLICY & CONTACT ============ */
.content-page {
  padding: 2rem 0;
}

.content-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.content-card h2 {
  color: var(--accent);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.content-card p {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.content-card ul {
  color: var(--text-light);
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.content-card li {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

/* ============ LOADING ============ */
.loading-spinner {
  display: flex;
  justify-content: center;
  padding: 3rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    border-bottom: 2px solid var(--gold);
  }

  .nav-links.open {
    display: flex;
  }

  .mobile-menu-btn {
    display: block;
  }

  .logo-text {
    font-size: 1.1rem;
  }

  .logo-badge {
    display: none;
  }

  .prizes-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .countdown-wrapper {
    gap: 0.5rem;
  }

  .countdown-item {
    padding: 0.8rem 1rem;
    min-width: 80px;
  }

  .countdown-number {
    font-size: 1.8rem;
  }

  .ball {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .ball-container {
    gap: 5px;
  }

  .table-ball {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }

  .results-table th,
  .results-table td {
    padding: 0.6rem 0.4rem;
    font-size: 0.75rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }

  .footer-right {
    text-align: center;
  }

  .latest-result-card {
    margin: -1rem 0.5rem 1.5rem;
    padding: 1.5rem 1rem;
  }

  .result-header {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .countdown-wrapper {
    flex-direction: row;
    gap: 0.4rem;
  }

  .countdown-item {
    min-width: 70px;
    padding: 0.6rem 0.8rem;
  }

  .countdown-number {
    font-size: 1.5rem;
  }

  .ball {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
  }

  .ball-container {
    gap: 4px;
  }
}
