/* ===================================================
   1. RESET & DASAR RESPONSIVE & ELDERLY-FRIENDLY
   =================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: #f1f5f9; /* Latar belakang neutral lembut */
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* CONTAINER UTAMA: Fleksibel ikut skrin */
.mobile-frame {
  width: 100%;
  max-width: 1100px; /* Di PC akan center kemas, di phone akan jadi 100% */
  margin: 0 auto;
  background-color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* ===================================================
   2. HEADER & NAVIGASI
   =================================================== */
.app-header {
  background-color: #1e40af; /* Biru terang berkontras tinggi */
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-text {
  font-size: 20px;
  font-weight: 800;
}

.back-btn {
  background-color: #ffffff;
  color: #1e40af;
  border: none;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.back-btn:hover { background-color: #e2e8f0; }

.header-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-lang-btn {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
}
.header-lang-btn:hover { background-color: rgba(255, 255, 255, 0.35); }

.logout-btn {
  background-color: #ef4444;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
}
.logout-btn:hover { background-color: #dc2626; }

.header-spacer { width: 40px; }

/* ===================================================
   3. SKRIN & LAYOUT KANDUNGAN
   =================================================== */
.screen {
  display: none;
  padding: 20px;
  flex: 1;
}
.screen.active {
  display: block;
}

/* ===================================================
   4. LANDING PAGE
   =================================================== */
.landing-top-bar {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 10px;
}

.lang-switch-btn {
  background-color: #ffffff;
  color: #1e40af;
  border: 2px solid #cbd5e1;
  padding: 8px 18px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 20px;
  cursor: pointer;
}

.hero-header {
  text-align: center;
  padding: 40px 10px 30px;
}
.app-icon { font-size: 64px; margin-bottom: 12px; }
.app-title { font-size: 28px; font-weight: 900; color: #0f172a; }
.app-desc { font-size: 17px; color: #475569; margin-top: 8px; }

/* Di PC: Butang pilihan role bersebelahan, di phone: atas bawah */
.btn-group {
  margin: 30px auto 0 auto;
  max-width: 600px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .btn-group {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===================================================
   5. BUTANG BESAR MESRA WARGA EMAS (TAP-FRIENDLY)
   =================================================== */
.big-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 18px 24px;
  font-size: 19px;
  font-weight: 800;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.1s, opacity 0.15s;
}
.big-btn:hover { opacity: 0.95; }
.big-btn:active { transform: scale(0.98); }

.btn-driver { background-color: #0284c7; color: #ffffff; }
.btn-admin { background-color: #334155; color: #ffffff; }
.btn-camera { background-color: #059669; color: #ffffff; }
.btn-dropoff { background-color: #d97706; color: #ffffff; }

/* ===================================================
   6. BORANG LOGIN (RESPONSIVE CARD)
   =================================================== */
.login-card {
  max-width: 480px;
  margin: 20px auto;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 20px;
  padding: 30px 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.login-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 16px auto;
}

.login-title { font-size: 24px; font-weight: 800; text-align: center; color: #0f172a; }
.login-sub { font-size: 15px; color: #64748b; text-align: center; margin: 6px 0 24px; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.form-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  border: 2px solid #94a3b8;
  border-radius: 12px;
  background-color: #f8fafc;
}
.proto-hint { text-align: center; color: #64748b; font-size: 13px; margin-top: 12px; }

/* ===================================================
   7. DRIVER: SENARAI MURID (GRID DI LAPTOP/TABLET)
   =================================================== */
.info-banner {
  background-color: #e0f2fe;
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 700;
  color: #0369a1;
}

/* Di Phone susun 1 kolum, di PC susun 2-3 kolum */
#screen-driver-list {
  display: none;
}
#screen-driver-list.active {
  display: block;
}

.kid-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .kid-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

.kid-card {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  transition: border-color 0.15s, transform 0.1s;
}
.kid-card:hover {
  border-color: #0284c7;
  transform: translateY(-2px);
}
.kid-name { font-size: 20px; font-weight: 800; color: #0f172a; margin-bottom: 6px; }
.kid-detail { font-size: 15px; color: #334155; font-weight: 600; line-height: 1.5; }

.badge-status {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}
.badge-pending { background-color: #fef3c7; color: #92400e; }
.badge-success { background-color: #dcfce7; color: #166534; }
.badge-danger { background-color: #fee2e2; color: #991b1b; }

/* ===================================================
   8. DRIVER: DETAIL & KAMERA
   =================================================== */
.detail-summary-card {
  background: white;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}
.detail-name { font-size: 26px; font-weight: 900; }
.detail-route { font-size: 16px; color: #475569; font-weight: 600; margin-top: 6px; }

.action-block {
  max-width: 600px;
  margin: 0 auto 24px auto;
}
.action-label { font-size: 16px; font-weight: 800; display: block; margin-bottom: 8px; }

.photo-preview-box {
  display: none;
  margin-top: 12px;
  padding: 14px;
  background-color: #f8fafc;
  border: 2px dashed #94a3b8;
  border-radius: 16px;
  text-align: center;
}
.photo-preview-box img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 12px;
}
.timestamp-text { font-size: 16px; font-weight: 800; color: #047857; margin-top: 10px; }
.btn-toggle-hide {
  margin-top: 10px;
  background-color: #e2e8f0;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
}

/* SKRIN KAMERA DUMMY */
.camera-frame {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 380px;
  margin: 0 auto 20px auto;
  background-color: #000000;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}
.camera-frame img { width: 100%; height: 100%; object-fit: cover; }
.camera-overlay-top {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
}
.camera-focus-bracket {
  position: absolute;
  width: 180px;
  height: 180px;
  border: 2px dashed rgba(255, 255, 255, 0.8);
  border-radius: 14px;
}
.camera-action-footer {
  max-width: 500px;
  margin: 0 auto;
}
.btn-confirm-camera { background-color: #059669; color: #ffffff; }
.btn-retake {
  width: 100%;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 16px;
  font-weight: 800;
  padding: 12px;
  cursor: pointer;
  text-decoration: underline;
}

/* ===================================================
   9. ADMIN DASHBOARD & DETAIL DRIVERS
   =================================================== */
.admin-welcome-card {
  background: #ffffff;
  padding: 18px 20px;
  border-radius: 14px;
  border-left: 6px solid #1e40af;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* 4 Statistik: 2 kolum di phone, 4 kolum di PC/tablet */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
}

.stat-box {
  background: #ffffff;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.stat-number { font-size: 32px; font-weight: 900; display: block; }
.stat-title { font-size: 14px; font-weight: 700; color: #64748b; margin-top: 4px; }
.text-success { color: #059669; }
.text-danger { color: #dc2626; }

.notice-box-cancel {
  background-color: #fee2e2;
  color: #991b1b;
  font-size: 15px;
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid #fecaca;
}

.subsection-title { font-size: 18px; font-weight: 800; margin-bottom: 14px; }

/* Senarai Kad Pemandu di Admin (Grid di PC) */
.admin-list-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) {
  .admin-list-container {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  }
}

.driver-card-admin {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}
.driver-header-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.driver-name-text { font-size: 18px; font-weight: 800; color: #0f172a; }
.driver-sub-text { font-size: 14px; color: #64748b; margin-top: 2px; }

.proof-label { font-size: 14px; font-weight: 700; color: #475569; margin-bottom: 8px; }
.proof-row { display: flex; gap: 12px; }
.proof-item {
  flex: 1;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #cbd5e1;
}
.proof-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}
.proof-badge-pickup {
  background: #0284c7;
  color: white;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  padding: 4px;
}
.proof-badge-dropoff {
  background: #d97706;
  color: white;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  padding: 4px;
}
.proof-item-empty {
  flex: 1;
  height: 100px;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 700;
  text-align: center;
  padding: 8px;
}

/* ===================================================
   10. POPUP MODAL GAMBAR BESAR
   =================================================== */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.75);
  z-index: 100;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.modal-card {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  padding: 20px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

/* SUSUNAN BERBILANG GAMBAR DALAM SATU PEMANDU */
.proof-trip-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}

.trip-row-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
}

.trip-student-tag {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #1e293b;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #cbd5e1;
}

.trip-status-done {
  font-size: 12px;
  font-weight: 800;
  color: #059669;
}

/* STATUS BADGE UNTUK DALAM PERJALANAN / DROP-OFF */
.badge-transit {
  background-color: #ffedd5;
  color: #c2410c;
}

/* BUTANG KAMERA YANG DISABLED (UNTUK STATUS BATAL) */
.big-btn:disabled,
.big-btn.btn-disabled {
  background-color: #cbd5e1 !important;
  color: #64748b !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  opacity: 0.7;
  transform: none !important;
}

/* KOTAK AMARAN MURID BATAL */
.cancel-alert-box {
  background-color: #fef2f2;
  border: 2px solid #f87171;
  color: #991b1b;
  padding: 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 20px;
}