/* ==========================================================================
   SMK NEGERI 1 PUNGGELAN - COMPONENTS CSS
   Cards, Forms, Camera, Map, Tables, Badges, Modals, Auth
   ========================================================================== */

/* Typography & General */
h2.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

p.section-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  margin-bottom: 1.5rem;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-focus);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.2;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--secondary);
  color: #ffffff;
}

.btn-secondary:hover {
  background: var(--secondary-hover);
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: var(--primary-border);
  color: var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}

.btn-success:hover {
  background: #059669;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-label .required {
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-size: 0.875rem;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control[readonly],
.form-control:disabled {
  background: var(--bg-subtle);
  color: var(--text-muted);
  cursor: not-allowed;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* Radio Group / Toggle Chips */
.toggle-chips {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.toggle-chip {
  flex: 1;
  position: relative;
}

.toggle-chip input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-chip label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-subtle);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.toggle-chip input[type="radio"]:checked + label {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 4px 10px rgba(30, 64, 175, 0.15);
}

/* Real-Time Clock & Date Display */
.clock-widget {
  background: linear-gradient(135deg, var(--primary), #1e3a8a);
  color: #ffffff;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-blue);
}

.clock-time {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.clock-date {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-top: 0.3rem;
}

.clock-badge {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Statistics Counter Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.amber { background: var(--warning-light); color: var(--warning); }
.stat-icon.cyan { background: var(--secondary-light); color: var(--secondary); }

.stat-info .stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-info .stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Camera & GPS Pointing Module */
.media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 860px) {
  .media-grid {
    grid-template-columns: 1fr;
  }
}

/* Media Column & Headers (Ensures Selfie & Maps are strictly aligned) */
.media-column {
  display: flex;
  flex-direction: column;
}

.media-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  height: 32px;
}

/* Symmetrical Selfie Card Box matching Map Box */
.selfie-card-box {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.selfie-header,
.map-header {
  padding: 0.65rem 0.9rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  height: 38px;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
}

.selfie-prompt-inner {
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.02) 0%, rgba(37, 99, 235, 0.07) 100%);
  box-sizing: border-box;
}

.selfie-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light, #e0f2fe);
  color: var(--primary, #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.6rem auto;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.14);
  flex-shrink: 0;
}

.selfie-icon-circle i,
.selfie-icon-circle svg {
  width: 24px;
  height: 24px;
  display: block;
}

.selfie-prompt-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem 0;
  color: var(--text-main);
  text-align: center;
  width: 100%;
  line-height: 1.3;
}

.selfie-prompt-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 auto 0.95rem auto;
  max-width: 290px;
  line-height: 1.45;
  text-align: center;
  width: 100%;
}

.btn-selfie-trigger {
  width: 100%;
  max-width: 260px;
  padding: 0.65rem 1.15rem;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.22);
  margin: 0 auto;
  flex-shrink: 0;
  transition: var(--transition);
}

.btn-selfie-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(37, 99, 235, 0.3);
}

.btn-selfie-trigger i,
.btn-selfie-trigger svg {
  width: 16px;
  height: 16px;
}

.selfie-result-inner {
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.selfie-result-media {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
}

.selfie-result-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.selfie-result-overlay {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 5;
}

.media-sub-action {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  padding: 0 2px;
}

#photo-status-badge,
#gps-status-badge {
  width: 100%;
  justify-content: center;
  padding: 0.55rem 0.75rem;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  border-radius: var(--radius-md);
  min-height: 36px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 6px;
}

.jurnal-photo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.camera-box {
  background: #0f172a;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
}

.camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror selfie view */
}

.camera-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.85rem;
}

.camera-watermark {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  align-self: flex-start;
  border-left: 3px solid var(--accent);
}

.camera-controls {
  position: absolute;
  bottom: 0.75rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  pointer-events: auto;
  z-index: 10;
}

/* Map Container (Ukuran disamakan persis dengan Camera Box: aspect-ratio 4 / 3) */
.map-box {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  aspect-ratio: 4 / 3;
  width: 100%;
  background: var(--bg-surface);
}

.selfie-header,
.map-header {
  padding: 0.65rem 0.9rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  height: 38px;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
}

.map-container {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--bg-subtle);
  z-index: 1;
}

/* Animasi Pengingat Wajib Selfie */
.camera-box.highlight-required,
.selfie-card-box.highlight-required,
.selfie-prompt-inner.highlight-required {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.35) !important;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

@keyframes highlightSectionGlow {
  0% {
    outline: 3px solid rgba(14, 165, 233, 0.8);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.35);
  }
  50% {
    outline: 3px solid rgba(14, 165, 233, 0.4);
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.2);
  }
  100% {
    outline: 3px solid transparent;
    box-shadow: none;
  }
}

.highlight-section {
  animation: highlightSectionGlow 1.5s ease-out;
  border-radius: var(--radius-lg);
}

.coordinates-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-family: monospace;
  background: var(--bg-subtle);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  border: 1px solid var(--border);
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.data-table thead th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  font-size: 0.725rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.data-table tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: middle;
}

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

.data-table tbody tr:hover {
  background: #f8fafc;
}

/* Thumbnail */
.table-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.table-thumb:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.725rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--primary-light); color: var(--primary); }
.badge-secondary { background: var(--bg-subtle); color: var(--text-muted); }

/* Login Portal Page */
.auth-container {
  max-width: 460px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* 1. Theme Kotakan Login Siswa: Ocean Blue (#0284c7) */
.auth-card.role-siswa {
  border-top: 5px solid #0284c7;
  box-shadow: 0 16px 36px -8px rgba(2, 132, 199, 0.22), 0 0 0 1px rgba(2, 132, 199, 0.12);
}
.auth-card.role-siswa .auth-title {
  color: #0284c7;
}
.auth-card.role-siswa .auth-role-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}
.auth-card.role-siswa button[type="submit"] {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

/* 2. Theme Kotakan Login Guru: Emerald Green (#059669) */
.auth-card.role-guru {
  border-top: 5px solid #059669;
  box-shadow: 0 16px 36px -8px rgba(5, 150, 105, 0.22), 0 0 0 1px rgba(5, 150, 105, 0.12);
}
.auth-card.role-guru .auth-title {
  color: #059669;
}
.auth-card.role-guru .auth-role-btn.active {
  background: #059669;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}
.auth-card.role-guru button[type="submit"] {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  border-color: #059669 !important;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

/* 3. Theme Kotakan Login Administrator: Royal Purple / Indigo (#7c3aed) */
.auth-card.role-admin {
  border-top: 5px solid #7c3aed;
  box-shadow: 0 16px 36px -8px rgba(124, 58, 237, 0.22), 0 0 0 1px rgba(124, 58, 237, 0.12);
}
.auth-card.role-admin .auth-title {
  color: #7c3aed;
}
.auth-card.role-admin .auth-role-btn.active {
  background: #7c3aed;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}
.auth-card.role-admin button[type="submit"] {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
  border-color: #7c3aed !important;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.auth-logo {
  width: 90px;
  height: 90px;
  margin: 0 auto 1rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.auth-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.12));
}

.auth-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.auth-role-tabs {
  display: flex;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 0.3rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.auth-role-btn {
  flex: 1;
  padding: 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.auth-role-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.demo-pills {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border);
  text-align: left;
}

.demo-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.demo-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.demo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.demo-item:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
}

/* Lightbox preview foto - selalu berada di lapisan paling depan di atas modal rekap presensi */
#modal-lightbox {
  z-index: 9999;
}

/* Modal Detail Rekap Presensi Siswa - selalu berada di depan modal daftar status */
#modal-siswa-rekap {
  z-index: 2500;
}

.modal-dialog {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--danger);
  background: var(--danger-light);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-surface);
  color: var(--text-main);
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  max-width: 400px;
  animation: slideIn 0.3s ease;
}

.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Accordion for Dudika list in Guru view */
.dudika-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  background: var(--bg-surface);
  overflow: hidden;
  transition: var(--transition);
}

.dudika-card:hover {
  border-color: var(--primary-border);
}

.dudika-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: var(--bg-surface);
  user-select: none;
}

.dudika-header:hover {
  background: var(--bg-subtle);
}

.dudika-body {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
  background: #fdfdfd;
  display: none;
}

.dudika-card.open .dudika-body {
  display: block;
}

.student-badge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  background: var(--bg-surface);
  cursor: pointer;
  transition: var(--transition);
}

.student-badge-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateX(4px);
}

/* ==========================================================================
   PORTAL ADMINISTRATOR COMPONENTS
   ========================================================================== */

/* Admin Jurusan Breakdown Cards */
.jurusan-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 1024px) {
  .jurusan-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .jurusan-grid {
    grid-template-columns: 1fr;
  }
}

.jurusan-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.jurusan-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

/* Admin Analytics Charts Grid (Tren Kehadiran & Zonasi Wilayah) */
.admin-charts-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 992px) {
  .admin-charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Admin Large Map Persebaran */
.admin-map-box {
  width: 100%;
  height: 440px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  margin-bottom: 1.5rem;
}

.admin-map-container {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Custom Marker Leaflet */
.custom-map-pin {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  background-size: cover;
  background-position: center;
  background-color: var(--primary);
}

/* Gallery Photo Collage */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.gallery-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-border);
}

.gallery-img-wrapper {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0f172a;
  position: relative;
}

.gallery-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-img-wrapper img {
  transform: scale(1.08);
}

.gallery-content {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gallery-student-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
}

.gallery-dudika-name {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.gallery-kegiatan-text {
  font-size: 0.8rem;
  color: var(--text-main);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* User Management Sub-tabs and Toolbar */
.user-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.table-action-btns {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* =============================================================
   STARTUP CLOUD DATABASE LOADER OVERLAY
   ============================================================= */
.startup-loader-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-main);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.startup-loader-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.startup-loader-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.startup-logo-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.startup-logo-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  z-index: 2;
}

.startup-spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.startup-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.startup-subtitle {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.startup-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.85rem;
  border: 1px solid var(--border);
}

.startup-progress-fill {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.startup-status-msg {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

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

.spin-icon {
  animation: spin 0.9s linear infinite;
}

/* =============================================================
   LOGIN DATABASE CONNECTED STATUS BADGE (MINIMALIST & MODERN)
   ============================================================= */
.login-db-connected-wrapper {
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: center;
  align-items: center;
}

.db-connected-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: default;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.db-connected-pill .db-icon-mini {
  width: 14px;
  height: 14px;
  color: var(--primary);
  flex-shrink: 0;
}

.db-connected-label {
  letter-spacing: 0.2px;
}

.pulse-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pulse-indicator-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(46, 158, 123, 0.25);
  animation: pulseDot 2s infinite;
}

.pulse-indicator-dot.syncing {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(217, 130, 43, 0.25);
  animation: pulseDot 1s infinite;
}

.pulse-indicator-dot.offline {
  background: #94a3b8;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-refresh-db {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-refresh-db:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
}

/* =============================================================
   MOBILE RESPONSIVENESS OVERRIDES (< 768px & < 480px)
   ============================================================= */
@media (max-width: 768px) {
  /* Cards & General spacing */
  .card {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
  }
  .card-header {
    margin-bottom: 1rem;
    padding-bottom: 0.65rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .card-title {
    font-size: 1rem;
  }

  /* Auth / Login on Mobile */
  .auth-container {
    max-width: 100%;
    margin: 1rem auto;
    padding: 0 0.5rem;
  }
  .auth-card {
    padding: 1.5rem 1.15rem;
    border-radius: var(--radius-lg);
  }
  .auth-logo {
    width: 72px;
    height: 72px;
    margin-bottom: 0.75rem;
  }
  .auth-title {
    font-size: 1.25rem;
  }
  .auth-subtitle {
    font-size: 0.8rem;
    margin-bottom: 1.25rem;
  }
  .auth-role-tabs {
    padding: 0.25rem;
    margin-bottom: 1.25rem;
  }
  .auth-role-btn {
    padding: 0.55rem 0.35rem;
    font-size: 0.78rem;
  }

  /* Clock Widget */
  .clock-widget {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }
  .clock-time {
    font-size: 1.75rem;
  }

  /* Statistics Cards 2-column on mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
  }
  .stat-card {
    padding: 0.85rem 0.75rem;
    gap: 0.65rem;
    border-radius: var(--radius-md);
  }
  .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }
  .stat-info .stat-value {
    font-size: 1.2rem;
  }
  .stat-info .stat-label {
    font-size: 0.65rem;
  }

  /* Toggle Chips: Stack vertically on mobile for easier thumb tapping */
  .toggle-chips {
    flex-direction: column;
    gap: 0.5rem;
  }
  .toggle-chip label {
    padding: 0.7rem 0.85rem;
    font-size: 0.85rem;
    justify-content: flex-start;
    text-align: left;
  }

  /* Camera & Map layout on smartphone */
  .media-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .camera-box, .map-box, .selfie-card-box {
    aspect-ratio: 16 / 11;
    max-height: 270px;
    border-radius: var(--radius-md);
  }
  .camera-controls .btn {
    padding: 0.6rem 1rem;
    font-size: 0.825rem;
  }

  /* Admin Charts & Analytics */
  .admin-charts-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .chart-canvas-container {
    height: 230px !important;
  }
  .admin-map-box {
    height: 300px;
  }

  /* Jurusan Cards (2 Columns) */
  .jurusan-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }
  .jurusan-card {
    padding: 0.85rem 0.75rem;
  }

  /* Teacher Accordion on mobile */
  .dudika-header {
    padding: 0.85rem 1rem;
  }
  .dudika-body {
    padding: 0.75rem;
  }
  .student-badge-item {
    padding: 0.75rem 0.85rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .student-badge-item > div:last-child {
    text-align: left !important;
    width: 100%;
  }

  /* Modals on mobile */
  .modal-dialog {
    width: 95vw;
    max-width: 95vw;
    margin: 0.5rem auto;
    max-height: 90vh;
  }
  .modal-header {
    padding: 1rem;
  }
  .modal-body {
    padding: 1rem 0.85rem;
  }
  .modal-footer {
    padding: 0.85rem 1rem;
    flex-wrap: wrap;
  }

  /* Tables: responsive scroll */
  .table-responsive {
    border-radius: var(--radius-sm);
  }
  .data-table thead th, .data-table tbody td {
    padding: 0.65rem 0.75rem;
    font-size: 0.8rem;
  }

  /* Gallery Grid */
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.85rem;
  }

  /* User Toolbar in Admin */
  .user-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .user-toolbar .search-box, 
  .user-toolbar select,
  .user-toolbar button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  /* Extra compact for screens < 480px */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .stat-card {
    padding: 0.75rem 0.6rem;
  }
  .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  .stat-info .stat-value {
    font-size: 1.1rem;
  }
  .jurusan-grid {
    grid-template-columns: 1fr;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   FITUR 3: VISUAL PROGRESS BAR MASA PKL (16 MINGGU)
   ========================================================================== */
.pkl-progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.pkl-progress-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(59, 108, 185, 0.25);
}

.pkl-progress-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b6cb9, #0ea5e9, #10b981);
}

.pkl-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.pkl-progress-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.pkl-progress-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(59, 108, 185, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.pkl-progress-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.pkl-progress-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.pkl-progress-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pkl-badge-week {
  background: rgba(59, 108, 185, 0.12);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pkl-badge-percent {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
}

/* Progress Track & Animated Fill */
.pkl-progress-track-wrapper {
  margin-bottom: 0.85rem;
}

.pkl-progress-track {
  width: 100%;
  height: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.pkl-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b6cb9 0%, #0ea5e9 60%, #10b981 100%);
  border-radius: 9999px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Jurusan theme borders & badges */
.pkl-progress-card.jurusan-tbkr::before { background: linear-gradient(90deg, #d97706, #f59e0b, #fbbf24); }
.pkl-progress-card.jurusan-tkr::before { background: linear-gradient(90deg, #1e40af, #2563eb, #38bdf8); }
.pkl-progress-card.jurusan-akl::before { background: linear-gradient(90deg, #db2777, #ec4899, #f472b6); }
.pkl-progress-card.jurusan-sija::before { background: linear-gradient(90deg, #059669, #10b981, #34d399); }

/* Jurusan Tabs Selector on Admin Dashboard */
.pkl-jurusan-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.pkl-jurusan-tab-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.pkl-jurusan-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-card);
  border-color: var(--primary);
}

.pkl-jurusan-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Admin Timeline Editor Card & Grid */
.admin-timeline-editor-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.admin-timeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.15rem;
  margin-top: 1rem;
}

.timeline-jurusan-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.timeline-jurusan-box:hover {
  border-color: rgba(59, 108, 185, 0.35);
  box-shadow: var(--shadow-sm);
}

.timeline-jurusan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  gap: 0.75rem;
}

.timeline-jurusan-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

.timeline-jurusan-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.timeline-jurusan-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Progress Footer Details */
.pkl-progress-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
  margin-top: 0.75rem;
}

.pkl-detail-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pkl-detail-icon {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.pkl-detail-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
}

.pkl-detail-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

/* ==========================================================================
   FITUR 4: PWA (PROGRESSIVE WEB APP) INSTALL ELEMENTS
   ========================================================================== */
/* Header PWA Install Button */
.btn-pwa-header {
  background: linear-gradient(135deg, rgba(59, 108, 185, 0.12), rgba(14, 165, 233, 0.12));
  color: var(--primary);
  border: 1px solid rgba(59, 108, 185, 0.3);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-pwa-header:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(59, 108, 185, 0.25);
}

/* Login Page PWA Install Banner Card */
.pwa-install-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  text-align: left;
}

.pwa-install-banner:hover {
  border-color: rgba(59, 108, 185, 0.3);
  box-shadow: var(--shadow-md);
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.pwa-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.pwa-banner-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 2px 0;
}

.pwa-banner-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.3;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-pwa-install {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-pwa-install:hover {
  background: var(--primary-hover);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.3);
}

.btn-pwa-dismiss {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 0.35rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-pwa-dismiss:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

@media (max-width: 600px) {
  .pwa-install-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .pwa-banner-actions {
    justify-content: flex-end;
  }
  .pkl-progress-card {
    padding: 1rem;
  }
  .pkl-milestones {
    display: none; /* Hide minute milestones on very small screen for cleanliness */
  }
}

/* ==========================================================================
   MODAL SELFIE KAMERA (RASIO 3:4, RESPONSIF SETIAP PERANGKAT HP / TABLET / PC)
   ========================================================================== */
#modal-selfie-camera.modal-backdrop {
  padding: 1rem !important;
  background: rgba(15, 23, 42, 0.78) !important;
  backdrop-filter: blur(8px) !important;
  z-index: 9999 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  position: fixed !important;
  inset: 0 !important;
  overflow-y: auto !important;
  margin: 0 !important;
  display: none;
  align-items: center;
  justify-content: center;
}

#modal-selfie-camera.modal-backdrop.active {
  display: flex !important;
}

#modal-selfie-camera .modal-dialog.modal-selfie-dialog {
  width: min(92vw, calc(86vh * 3 / 4), 460px) !important;
  max-width: 460px !important;
  aspect-ratio: 3 / 4 !important;
  height: auto !important;
  max-height: min(86vh, 86dvh, 620px) !important;
  margin: auto !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: var(--radius-xl, 20px) !important;
  background: #000000 !important;
  position: relative !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8) !important;
  animation: modalIn 0.25s ease !important;
}

/* Video viewport taking full 3:4 space */
.selfie-fullscreen-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  overflow: hidden;
  z-index: 1;
}

.selfie-fullscreen-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Header Floating Overlay */
.selfie-overlay-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 1rem 1.25rem 1.5rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 65%, rgba(0, 0, 0, 0) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
  pointer-events: auto;
}

.selfie-overlay-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.selfie-overlay-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.85);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.selfie-overlay-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  line-height: 1.2;
}

.selfie-overlay-subtitle {
  font-size: 0.74rem;
  color: #cbd5e1;
  margin: 2px 0 0 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.selfie-overlay-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.selfie-overlay-close:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: rgba(239, 68, 68, 0.9);
  transform: scale(1.05);
}

/* Floating HUD Live GPS & Time Badge */
.selfie-hud-badge {
  position: absolute;
  top: 60px;
  left: 1.25rem;
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  z-index: 15;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.selfie-hud-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 6px #22c55e;
  animation: pulse-green 1.5s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Bottom Floating Controls Overlay: Tombol Take Foto Rata Tengah & Icon Ganti Kamera di Sebelah Kanan */
.selfie-overlay-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 1.25rem 1.75rem 1.5rem;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 65%, rgba(0, 0, 0, 0) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
}

/* Authentic Circular Camera Shutter Button (Center) */
.selfie-btn-shutter {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: transparent;
  border: 4px solid #ffffff;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  margin: 0 auto;
}

.selfie-btn-shutter-inner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.35);
}

.selfie-btn-shutter:hover {
  transform: scale(1.06);
}

.selfie-btn-shutter:active .selfie-btn-shutter-inner {
  transform: scale(0.92);
  background: #1d4ed8;
}

/* Icon Ganti Kamera Bulat di Sebelah Kanan */
.selfie-btn-icon-switch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.selfie-btn-icon-switch:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.08) rotate(45deg);
}

.selfie-btn-icon-switch:active {
  transform: scale(0.92) rotate(90deg);
}
