/* -----------------------------------------------------
   OFFICER PROJECT CALCULATOR — RESPONSIVE STYLESHEET
   -----------------------------------------------------
   Penjelasan:
   - Tampilan dibuat responsif untuk mobile, tablet, desktop
   - Menggunakan nuansa gelap biru dengan aksen biru muda
   - Komentar di setiap bagian agar mudah dimengerti
-------------------------------------------------------- */


/* ====== RESET & DASAR ====== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

/* Warna dasar halaman dan background image placeholder */
body {
  font-family: 'Outfit', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #e5edff;
  line-height: 1;
  background: #060c1e url('assets/bonfire.jpg') 
              center/cover no-repeat fixed;
}


/* Lapisan efek blur transparan di atas background */
.bg-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(rgba(1, 6, 20, 0.2), rgba(6, 12, 30, 0.2));
  backdrop-filter: blur(3px);
  z-index: -1;
}


/* ====== KONTAINER UTAMA ====== */
.container {
  max-width: 720px;
  margin: 3rem auto;
  padding: 1rem;
  width: 100%;
}

/* Header berisi tombol kembali dan judul */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Tombol Toggle Tema (pojok kanan atas) */
.theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(180, 200, 255, 0.25);
  color: #fff;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: 0.3s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1);
}

.theme-toggle:active {
  transform: scale(1);
}

/* ===== LIGHT MODE ===== */
body.light {
  background: #f4f6fc url('assets/bonfire.jpg') 
              center/cover no-repeat fixed;
  color: #1b263b;
}

body.light .card {
  background: rgba(255, 255, 255, 0.2);
  color: #1b263b;
  border-color: rgba(100, 130, 180, 0.3);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

body.light thead th {
  background: rgba(230, 240, 255, 1);
  color: #112a46;
}

body.light .section-title td {
  background: rgba(230, 240, 255, 1);
  color: #1b263b;
}

body.light .total-pill {
  background: rgba(230, 240, 255, 0.9);
  border-color: rgba(90, 130, 255, 0.3);
}

body.light .reset-btn {
  background: rgba(255, 120, 120, 0.2);
  color: #222;
}

body.light .theme-toggle {
  color: #111;
  border-color: rgba(80, 100, 150, 0.4);
  background: rgba(255, 255, 255, 0.6);
}

/* Tombol kembali (✖) di pojok kiri */
.back-btn {
  background: rgba(255, 80, 80, 0.18);
  color: #ffd7d7;
  border: 1px solid rgba(255, 80, 80, 0.28);
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  text-decoration: none;
  transition: 0.25s;
}

.back-btn:hover {
  background: rgba(255, 80, 80, 0.3);
}

/* Judul di tengah header */
.title {
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  flex: 1;
}


/* ====== KARTU UTAMA (BLOK KALKULATOR) ====== */
.card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 180, 255, 0.6);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 0px 16px rgba(0, 150, 255, 0.4);
}

/* Bungkus tabel agar bisa discroll secara horizontal di layar kecil */
.table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: 12px;
}


/* ====== TABEL ====== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

/* Header tabel (judul kolom) */
thead th {
  position: sticky;
  top: 0;
  background: rgba(10, 40, 80, 1);
  backdrop-filter: blur(2px);
  padding: 0.9rem 0.6rem;
  text-align: center;
  font-weight: 600;
  color: #d8e6ff;
  letter-spacing: 1px;
}

/* Sel tubuh tabel */
tbody td {
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Kolom pertama (nama item) di-align kiri */
td:first-child {
  text-align: left;
  padding-left: 1rem;
}

/* Baris pemisah antar bagian tabel (section-title) */
.section-title td {
  background: rgba(10, 40, 80, 1);
  padding: 0.5rem;
  border-radius: 10px;
  color: #dff0ff;
  font-weight: 700;
  text-align: center;
  letter-spacing: 1px;
}


/* ====== INPUT & SELECT ====== */
input[type="number"],
select {
  background: rgba(255, 255, 255, 0.02);
  border: 1.3px solid rgba(250, 250, 255, 0.3);
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  color: inherit;
  text-align: center;
  min-width: 64px;
  font-size: 14px;
}

/* Fokus visual saat user memilih input */
input:focus,
select:focus {
  outline: 1.8px solid rgba(130, 155, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
}

/* Lebar tetap untuk input */
input[type="number"] {
  width: 84px;
}

/* Bagian promosi (select from → to) */
.promotion-select {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}


/* ====== TOTAL ====== */
.total-row td {
  padding: 1rem;
  text-align: center;
}

/* Bentuk kapsul untuk total keseluruhan */
.total-pill {
  display: inline-block;
  background: rgba(10, 20, 40, 0.5);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(90, 150, 255, 0.08);
  box-shadow: 0 0 10px rgba(60, 140, 255, 0.06);
}

/* Angka total besar */
.total-amount {
  font-weight: 800;
  color: #cfff6b;
  margin-left: 0.6rem;
}


/* ====== TOMBOL RESET ====== */
.reset-btn {
  display: block;
  margin: 1rem auto 0;
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  background: rgba(255, 90, 90, 0.4);
  border: 1px solid rgba(255, 90, 90, 0.3);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.25s;
}

.reset-btn:hover {
  background: rgba(255, 90, 90, 0.4);
  transform: scale(1.03);
}

.reset-btn:active {
  background: rgba(255, 80, 80, 0.55);
  transform: scale(0.98);
}


/* ====== FOOTER ====== */
footer {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.85rem;
  padding: 0.4rem;
  color: rgba(235, 245, 255, 0.7);
}


/* ====== ANIMASI HALUS ====== */
.flash {
  animation: flash 900ms ease;
}

@keyframes flash {
  0%   { transform: scale(0); opacity: 1; }
  50%  { transform: scale(0); opacity: 1; }
  100% { transform: scale(0); opacity: 1; }
}


/* ====== RESPONSIF (UNTUK MOBILE & TABLET) ====== */

/* Tablet (≤ 820px) */
@media (max-width: 820px) {
  .container {
    margin-top: 2rem;
  }

  table {
    min-width: 640px;
  }

  input[type="number"] {
    width: 70px;
  }

  .title {
    font-size: 1.1rem;
  }

/* Ponsel (≤ 480px) */
@media (max-width: 480px) {
  .container {
    margin-top: 1rem;
  }

  table {
    min-width: 520px;
  }

  thead th {
    font-size: 0.9rem;
    padding: 0.6rem;
  }

  tbody td {
    padding: 0.5rem;
  }

  input[type="number"], select {
    min-width: 56px;
    font-size: 14px;
  }

  .reset-btn {
    font-size: 0.9rem;
  }
