/* =========================================================
   SISWA.CSS — Tema Futuristik untuk Portal Presensi
   ========================================================= */

:root {
  --bg: #070b14;
  --bg-soft: #0d1424;
  --card: rgba(15, 23, 42, 0.72);
  --card-border: rgba(0, 240, 255, 0.18);
  --card-hover: rgba(0, 240, 255, 0.42);
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --neon: #00f0ff;
  --neon-soft: rgba(0, 240, 255, 0.12);
  --purple: #a855f7;
  --purple-soft: rgba(168, 85, 247, 0.14);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.14);
  --amber: #f59e0b;
  --red: #ef4444;
  --radius: 16px;
  --radius-sm: 12px;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-head: 'Orbitron', sans-serif;
}

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

body {
  background:
    radial-gradient(circle at 15% 10%, rgba(0, 240, 255, 0.08), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(168, 85, 247, 0.10), transparent 45%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  padding-bottom: 96px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- HEADER ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 11, 20, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
}
.header-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--neon);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
}
.brand-text h1 {
  font-family: var(--font-head);
  font-size: 14px;
  letter-spacing: 1.5px;
  color: #fff;
}
.brand-text p { font-size: 10px; color: var(--neon); letter-spacing: 1px; }

.btn-logout {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  transition: all .2s;
}
.btn-logout:hover { background: rgba(239, 68, 68, 0.3); box-shadow: 0 0 12px rgba(239, 68, 68, 0.4); }

/* ---------- MAIN ---------- */
.app-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 16px;
}
.page { display: none; }
.page.active { display: block; animation: fadeUp .35s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- CARD ---------- */
.card {
  background: var(--card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  transition: border-color .25s, box-shadow .25s;
}
.card:hover {
  border-color: var(--card-hover);
  box-shadow: 0 0 28px rgba(0, 240, 255, 0.08);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.card-title {
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: .8px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title i { color: var(--neon); }

.label-xs { font-size: 11px; color: var(--text-dim); letter-spacing: .4px; }

/* ---------- PROFIL ---------- */
.card-profile {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.10), rgba(168, 85, 247, 0.10));
  border-color: rgba(0, 240, 255, 0.3);
}
.profile-name {
  font-family: var(--font-head);
  font-size: 20px;
  color: #fff;
  margin: 4px 0 12px;
  text-shadow: 0 0 18px rgba(0, 240, 255, 0.35);
}
.profile-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  display: inline-flex;
  gap: 6px;
}
.chip-label { color: var(--neon); font-weight: 500; }
.chip strong { font-family: monospace; color: #fff; }

/* ---------- STAT GRID ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: left;
}
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); }
.stat-value {
  display: block;
  font-family: monospace;
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
}
.stat-masuk .stat-value { color: var(--green); text-shadow: 0 0 12px rgba(16, 185, 129, .4); }
.stat-pulang .stat-value { color: var(--neon); text-shadow: 0 0 12px rgba(0, 240, 255, .4); }

.badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-dim);
  border: 1px solid rgba(148, 163, 184, 0.3);
  white-space: nowrap;
}
.badge-warn { background: rgba(245, 158, 11, 0.15); color: var(--amber); border-color: rgba(245, 158, 11, 0.4); }
.badge-purple { background: var(--purple-soft); color: var(--purple); border-color: rgba(168, 85, 247, 0.4); }

.hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 12px;
  padding: 8px 10px;
  background: rgba(0, 240, 255, 0.05);
  border-left: 2px solid var(--neon);
  border-radius: 6px;
}
.hint-warn { background: rgba(245, 158, 11, 0.08); border-left-color: var(--amber); color: #fcd34d; }

/* ---------- GPS CARD ---------- */
.card-dark { background: rgba(5, 8, 16, 0.85); border-color: rgba(0, 240, 255, 0.25); }

.gps-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  transition: all .3s;
}
.gps-wait  { background: rgba(245, 158, 11, 0.12); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.35); }
.gps-ok    { background: var(--green-soft); color: var(--green); border: 1px solid rgba(16, 185, 129, 0.4); }
.gps-fail  { background: rgba(239, 68, 68, 0.12); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.4); }

.pulse { position: relative; display: inline-flex; width: 10px; height: 10px; }
.pulse-ping {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: currentColor;
  opacity: .75;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.pulse-dot { position: relative; border-radius: 50%; width: 10px; height: 10px; background: currentColor; }
@keyframes ping {
  75%, 100% { transform: scale(2.2); opacity: 0; }
}

.gps-info { margin-bottom: 14px; }
.gps-status-text {
  font-family: var(--font-head);
  font-size: 15px;
  margin: 4px 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.gps-wait-text { color: var(--amber); }
.gps-ok-text   { color: var(--green); text-shadow: 0 0 14px rgba(16, 185, 129, .35); }
.gps-fail-text { color: var(--red);   text-shadow: 0 0 14px rgba(239, 68, 68, .35); }

.gps-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.gps-meta strong { color: var(--neon); font-family: monospace; }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

/* ---------- BUTTONS ---------- */
.btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(168, 85, 247, 0.2));
  border-color: rgba(0, 240, 255, 0.45);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.35);
  border-color: var(--neon);
}
.btn-masuk {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.15));
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}
.btn-masuk:hover:not(:disabled) { box-shadow: 0 0 20px rgba(16, 185, 129, 0.35); }
.btn-pulang {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(59, 130, 246, 0.15));
  border-color: rgba(0, 240, 255, 0.45);
  color: #7dd3fc;
}
.btn-pulang:hover:not(:disabled) { box-shadow: 0 0 20px rgba(0, 240, 255, 0.3); }
.btn-warn {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  margin-top: 12px;
}
.btn-warn:hover { box-shadow: 0 0 18px rgba(245, 158, 11, 0.3); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--neon); }
.btn-izin {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(99, 102, 241, 0.2));
  border-color: rgba(168, 85, 247, 0.5);
  color: #d8b4fe;
  margin-top: 12px;
}
.btn-izin:hover { box-shadow: 0 0 22px rgba(168, 85, 247, 0.35); }

/* ---------- IZIN CARD ---------- */
.card-izin { border-color: rgba(168, 85, 247, 0.3); }
.izin-flex { display: flex; align-items: center; gap: 12px; }
.izin-icon {
  width: 46px; height: 46px;
  background: var(--purple-soft);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple);
  font-size: 18px;
  flex-shrink: 0;
}

/* ---------- GRID 2 ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-2-tight { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1.6fr 1fr; }
}

/* ---------- INPUT ---------- */
.field-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--neon);
  font-weight: 700;
  margin: 10px 0 4px;
}
.input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.12);
}
textarea.input { resize: vertical; min-height: 60px; }

/* ---------- BOTTOM NAV ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  background: rgba(7, 11, 20, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--card-border);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}
.nav-item {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color .2s, transform .2s;
  border-radius: 10px;
  text-decoration: none;
}
.nav-item i { font-size: 18px; transition: transform .2s; }
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--neon); }
.nav-item.active i { transform: translateY(-2px); filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.6)); }

/* ---------- MODAL ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 12, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal.hidden { display: none; }
.modal-box {
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 22px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 240, 255, 0.08);
  animation: modalIn .3s ease;
}
.modal-sm { max-width: 400px; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text-dim);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: all .2s;
}
.modal-close:hover { background: rgba(239, 68, 68, 0.2); color: var(--red); }
.modal-head { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.modal-title {
  font-family: var(--font-head);
  font-size: 14px;
  color: #fff;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- ANNOUNCEMENT ---------- */
.modal-announce { max-width: 420px; }
.announce-icon {
  width: 44px; height: 44px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
  font-size: 18px;
  flex-shrink: 0;
}
.announce-body {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 16px;
}

/* ---------- TAB SWITCH ---------- */
.tab-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 5px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.tab-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  padding: 9px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(168, 85, 247, 0.2));
  color: #fff;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.2);
}
.tab-content.hidden { display: none; }

/* ---------- INFO BOX ---------- */
.info-box {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11px;
  margin-bottom: 12px;
  border-left: 3px solid;
}
.info-box strong { display: block; margin-bottom: 4px; font-size: 11px; }
.info-box p, .info-box ul { font-size: 11px; line-height: 1.5; }
.info-box ul { padding-left: 16px; margin-top: 4px; }
.info-purple { background: var(--purple-soft); border-color: var(--purple); color: #d8b4fe; }
.info-blue   { background: rgba(0, 240, 255, 0.06); border-color: var(--neon); color: #a5f3fc; }
.info-danger { background: rgba(239, 68, 68, 0.1); border-color: var(--red); color: #fca5a5; }

/* ---------- UPLOAD ---------- */
.upload-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed rgba(0, 240, 255, 0.3);
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
  text-align: center;
}
.preview { margin-top: 10px; }
.preview.hidden { display: none; }
.preview-ok { display: block; font-size: 10px; color: var(--green); font-weight: 700; margin-bottom: 6px; }
.preview img {
  max-height: 120px;
  border-radius: 10px;
  border: 2px solid var(--neon);
  object-fit: cover;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
}
.preview-name { font-size: 11px; color: var(--neon); margin-bottom: 6px; }
.hidden { display: none !important; }

/* ---------- CAMERA ---------- */
.camera-frame {
  position: relative;
  width: 100%;
  height: 240px;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--neon);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.25);
  margin-bottom: 12px;
}
.camera-frame video {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.scan-frame {
  position: absolute;
  inset: 20px;
  border: 2px dashed rgba(0, 240, 255, 0.5);
  border-radius: 12px;
  pointer-events: none;
  animation: scanPulse 2s ease-in-out infinite;
}
@keyframes scanPulse {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}

/* ---------- PLACEHOLDER ---------- */
.placeholder-card { text-align: center; padding: 40px 20px; }
.placeholder-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid var(--card-border);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--neon);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.15);
}
.placeholder-card .card-title { justify-content: center; margin-bottom: 8px; }
.placeholder-card .label-xs { max-width: 360px; margin: 0 auto; line-height: 1.6; }

/* ---------- FOOTER ---------- */
.app-footer {
  text-align: center;
  font-size: 10px;
  color: var(--text-dim);
  padding: 16px;
  letter-spacing: .5px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 480px) {
  .brand-text h1 { font-size: 12px; }
  .card { padding: 14px; }
  .profile-name { font-size: 17px; }
  .stat-value { font-size: 16px; }
  .action-grid { grid-template-columns: 1fr; }
}

/* ---------- CONTRIBUTION GRAPH ---------- */
.graph-container {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin-bottom: 16px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.graph-box {
  aspect-ratio: 1;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.graph-box:hover {
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  z-index: 10;
}

.bg-hadir { background-color: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.bg-terlambat { background-color: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.bg-izin { background-color: #a855f7; box-shadow: 0 0 8px rgba(168, 85, 247, 0.4); }
.bg-alpa { background-color: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
.bg-empty { background-color: rgba(255, 255, 255, 0.05); }

.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: var(--text-dim);
}
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-item .box { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- FUTURISTIC PASSWORD CARD ---------- */
.card-password {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.8), rgba(0, 0, 0, 0.6));
  border-color: rgba(245, 158, 11, 0.3); /* Aksen amber */
}
.card-password .card-title i {
  color: var(--amber);
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

.password-group {
  margin-bottom: 12px;
}

.input-icon-wrap {
  position: relative;
}
.input-icon-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 12px;
}
.input-icon-wrap .input {
  padding-left: 34px; /* Ruang untuk ikon */
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(245, 158, 11, 0.2);
}
.input-icon-wrap .input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.btn-password {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(234, 88, 12, 0.15));
  border-color: rgba(245, 158, 11, 0.5);
  color: #fcd34d;
  margin-top: 16px;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.1);
}
.btn-password:hover {
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.4);
  border-color: var(--amber);
}
