/*
╔══════════════════════════════════════════════════════════════════╗
║  css/base.css — Reset & Elemen Dasar                            ║
║  Menghapus style bawaan browser dan menetapkan fondasi visual   ║
╚══════════════════════════════════════════════════════════════════╝
*/

/* ── CSS RESET MODERN ── */
*,
*::before,
*::after {
  box-sizing: border-box;  /* Padding tidak menambah ukuran elemen */
  margin: 0;               /* Hapus margin bawaan browser */
  padding: 0;              /* Hapus padding bawaan browser */
}

/* ── ROOT / HTML ── */
html {
  font-size: 16px;         /* Base font size — 1rem = 16px */
  scroll-behavior: smooth; /* Scroll halus */
  -webkit-text-size-adjust: 100%; /* Cegah zoom font di iOS */
}

/* ── BODY ── */
body {
  font-family: var(--font-body);        /* Font Rajdhani dari variables.css */
  font-size: var(--text-base);
  font-weight: var(--fw-medium);
  line-height: 1.6;
  color: var(--text-primary);           /* Teks putih untuk latar gelap */
  background-color: var(--bg-page);    /* Latar hitam biru gelap */
  min-height: 100vh;                    /* Minimal setinggi layar */
  overflow-x: hidden;                   /* Cegah scroll horizontal */
  position: relative;                   /* Untuk positioning anak absolut */
}

/* ── TIPOGRAFI HEADING ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);   /* Font Orbitron untuk semua heading */
  font-weight: var(--fw-bold);
  line-height: 1.2;
  color: var(--text-heading);
  letter-spacing: 0.02em;
}

/* ── TEKS BIASA ── */
p {
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ── LINK ── */
a {
  color: var(--blue-300);
  text-decoration: none;
  transition: var(--tr-fast);
}
a:hover {
  color: var(--yellow-400);
  text-decoration: underline;
}

/* ── GAMBAR ── */
img {
  max-width: 100%;    /* Gambar tidak overflow dari kontainer */
  height: auto;       /* Jaga rasio aspek */
  display: block;     /* Hilangkan gap di bawah gambar inline */
}

/* ── INPUT & FORM ── */
input,
textarea,
select {
  font-family: var(--font-body);           /* Sama dengan body */
  font-size: var(--text-base);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  background-color: var(--bg-input);      /* Latar input gelap */
  border: 1.5px solid var(--border-mid);  /* Border halus */
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  width: 100%;
  outline: none;
  transition: var(--tr-base);
  -webkit-appearance: none;               /* Hilangkan style default browser */
  appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue-400);           /* Border biru saat fokus */
  box-shadow: 0 0 0 3px rgba(59,130,246,0.2); /* Glow fokus */
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);               /* Placeholder redup */
  font-weight: var(--fw-normal);
}

/* Select: tambah ikon panah custom */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%2360a5fa' d='M5 7l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;    /* Ruang untuk ikon panah */
  cursor: pointer;
}

/* Warna option di select */
select option {
  background-color: var(--blue-800);
  color: var(--text-primary);
}

textarea {
  resize: vertical;   /* User hanya bisa resize vertikal */
  min-height: 80px;
}

label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
  letter-spacing: 0.05em;
  text-transform: uppercase;  /* Label form selalu kapital */
}

/* Tanda bintang required */
.req {
  color: var(--red-400);
  margin-left: 2px;
}

/* ── SCROLLBAR CUSTOM (Webkit) ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-page);
}
::-webkit-scrollbar-thumb {
  background: var(--blue-600);
  border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--blue-400);
}

/* ── SELEKSI TEKS ── */
::selection {
  background-color: var(--blue-600);
  color: var(--text-primary);
}

/* ── UTILITY CLASSES ── */
.hidden {
  display: none !important;  /* Sembunyikan elemen — dipanggil JS */
}

.visible {
  display: block !important;  /* Tampilkan elemen */
}

/* Visually hidden tapi masih accessible untuk screen reader */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ── PRINT STYLES ── */
@media print {
  /* Saat mencetak hasil, sembunyikan elemen non-essensial */
  .btn-mute,
  .game-header,
  .scanlines,
  #network-canvas,
  .btn--secondary { display: none !important; }

  body { background: white; color: black; }
  .report-wrap { box-shadow: none; }
}

/* ── EFEK SCANLINE CRT ── */
/* Memberikan kesan monitor komputer lama yang khas di dunia IT */
.scanlines {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;     /* Tidak memblok klik */
  z-index: var(--z-header); /* Di atas semua konten */
  /* Garis horizontal halus dengan gradien berulang */
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.05) 2px,
    rgba(0, 0, 0, 0.05) 4px
  );
  opacity: 0.5;
}

/* ── RESPONSIVE BREAKPOINTS HELPER ── */
/* Kelas ini bisa dipakai di HTML untuk kontrol visibilitas */
@media (max-width: 768px) {
  html { font-size: 14px; }  /* Sedikit kecilkan font di mobile */
}

@media (max-width: 480px) {
  html { font-size: 13px; }
}
