:root {
  --purple: #673ab7;
  --light-gray: #f7f7f7;
  --text-dark: #333;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background: white;
  color: var(--text-dark);
  overflow-x: hidden;
}

/* ========================= */
/* HEADER */
/* ========================= */
.header {
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid var(--purple);
  padding: 4px 0;
}

.header .logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.header .logo img {
  width: 90px;
  height: auto;
  margin: 0;
  padding: 0;
  display: block;
}

/* ========================= */
/* PROFILE CARD */
/* ========================= */
.profile-card {
  background: var(--purple);
  color: white;
  margin: 15px 16px;
  padding: 20px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 3px 6px rgba(103, 58, 183, 0.25);
  animation: slideIn 1s ease forwards;
}

.profile-avatar {
  width: 65px;
  height: 65px;
  background: white;
  color: var(--purple);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.profile-info {
  flex: 1;
  margin-left: 14px;
}

.profile-info h2 {
  font-size: 17px;
  margin-bottom: 4px;
}

.profile-info p {
  font-size: 13px;
  opacity: 0.9;
  line-height: 1.3;
}

.clock {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 500;
  color: #673ab7; /* ungu HRIVE */
  letter-spacing: 1px;
  background: rgba(103, 58, 183, 0.08);
  padding: 6px 14px;
  border-radius: 10px;
  display: inline-block;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* ========================= */
/* SIGN-IN BUTTON */
/* ========================= */
.signin-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.signin-btn {
  background-color: white;
  border: none;
  color: var(--purple);
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: background 0.3s ease;
}

.signin-btn:hover {
  background-color: #eee;
}

.signin-text {
  margin-top: 4px;
  font-size: 12px;
  color: white;
  text-align: center;
}

/* ========================= */
/* MENU GRID */
/* ========================= */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 10px 16px 80px;
  animation: fadeUp 1.2s ease forwards;
}

.menu-item {
  background: white;
  text-align: center;
  padding: 18px 0;
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, background 0.3s;
  opacity: 0;
  transform: translateY(25px);
  color: var(--text-dark);
  text-decoration: none;
}

.menu-item i {
  font-size: 28px;
  color: var(--purple);
  margin-bottom: 6px;
}

.menu-item p {
  font-size: 13px;
  font-weight: 500;
}

.menu-item:hover {
  transform: translateY(-4px);
  background: var(--light-gray);
}

/* ========================= */
/* MAP PAGE STYLING */
/* ========================= */
.map-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 120px); /* sisakan header & bottom nav */
  z-index: 1;
  animation: fadeUp 1s ease forwards;
}

#map {
  width: 100%;
  height: 100%;
  border: none;
}

.map-controls {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 999;
}

.masuk-btn {
  background: white;
  color: var(--purple);
  border: 2px solid var(--purple);
  padding: 10px 40px;
  border-radius: 40px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: all 0.3s ease;
}

.masuk-btn:hover {
  background: var(--purple);
  color: white;
}

.masuk-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.refresh-area {
  display: none;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
}

.refresh-area p {
  font-size: 13px;
  color: red;
  margin-bottom: 6px;
}

.refresh-btn {
  background: var(--purple);
  color: white;
  border: none;
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.refresh-btn:hover {
  background: #5a2ea6;
}

/* ========================= */
/* BOTTOM NAVIGATION */
/* ========================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  border-top: 2px solid var(--purple);
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.05);
  /* === BARU / PENTING === */
  height: 60px; /* Tetapkan tinggi pasti */
  z-index: 1000; /* Pastikan selalu di atas elemen lain */
}

.bottom-nav a {
  color: #777;
  text-decoration: none;
  text-align: center;
  font-size: 12px;
  transition: all 0.3s ease;
}

.bottom-nav a.active {
  color: var(--purple);
}

.bottom-nav i {
  font-size: 20px;
  display: block;
  margin-bottom: 3px;
  transition: transform 0.3s ease;
}

.bottom-nav a:hover i {
  transform: scale(1.15);
}

/* ========================= */
/* ANIMATIONS */
/* ========================= */
@keyframes slideIn {
  from {transform: translateY(25px); opacity: 0;}
  to {transform: translateY(0); opacity: 1;}
}

@keyframes fadeUp {
  from {opacity: 0; transform: translateY(20px);}
  to {opacity: 1; transform: translateY(0);}
}

/* ========================= */
/* FAKE GPS WARNING */
/* ========================= */
.fakegps-warning {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  height: calc(100vh - 120px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.fakegps-warning.show {
  opacity: 1;
  visibility: visible;
}

.fakegps-warning .warning-content h3 {
  font-size: 18px;
  margin-top: 14px;
  color: #333;
}

.fakegps-warning .warning-content p {
  font-size: 14px;
  color: #666;
  margin: 10px 0 18px;
}

.fakegps-warning .masuk-btn {
  background-color: #673ab7;
  color: white;
  border: none;
  border-radius: 24px;
  padding: 10px 22px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: background 0.3s ease;
}

.fakegps-warning .masuk-btn:hover {
  background-color: #5e35b1;
}

/* ========================= */
/* HALAMAN CAMERA */
/* ========================= */
.absen-page {
  background: #f3e9ff;
}

.absen-page .header {
  background: #ffffff;
  border-bottom: 2px solid #673ab7;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.absen-page .header .logo img {
  width: 110px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.absen-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px 100px;
  text-align: center;
}

.camera-container {
  position: relative;
  margin-bottom: 50px;
}

.camera-circle {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #673ab7;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.camera-circle video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.switch-btn {
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  width: 65px;
  height: 65px;
  border-radius: 50%;
  border: 3px solid #673ab7;
  background: white;
  font-size: 24px;
  cursor: pointer;
  color: #673ab7;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease-in-out;
  box-shadow: 0 6px 14px rgba(0,0,0,0.2);
}

.switch-btn:hover {
  background: #673ab7;
  color: white;
  transform: translateX(-50%) scale(1.1);
}

.absen-status {
  margin-top: 20px;
  font-size: 16px;
  color: #444;
}

/* ========================= */
/* HALAMAN ABSENSI (MENU) */
/* ========================= */
.absen-menu {
  background: #ffffff;
}

.absen-menu .header {
  background: #ffffff;
  border-bottom: 2px solid #673ab7;
}

.absen-section {
  padding: 20px;
}

.absen-section h2 {
  color: #4b2e83;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 15px;
  padding-left: 8px;
}

.absen-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.absen-item {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid #673ab7;
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  opacity: 0;
  transform: translateY(25px);
}

.absen-item.show {
  opacity: 1;
  transform: translateY(0);
}

.absen-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.absen-icon {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: #673ab7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  margin-right: 18px;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

.absen-item span {
  font-size: 18px;
  font-weight: 600;
  color: #452b7f;
  letter-spacing: 0.3px;
}

/* animasi pulse sidik jari */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(103, 58, 183, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(103, 58, 183, 0); }
  100% { box-shadow: 0 0 0 0 rgba(103, 58, 183, 0); }
}
