/* General Reset and Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #0f172a; /* Slate 900 */
  color: #f8fafc; /* Slate 50 */
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

/* Decorative Background Elements */
.background-decor {
  position: absolute;
  top: -10%;
  left: -10%;
  width: 50%;
  height: 60%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 800px;
  z-index: 1;
}

/* Header Styles */
.header {
  text-align: center;
  margin-bottom: 30px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(51, 65, 85, 0.8);
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #60a5fa; /* Blue 400 */
  margin-bottom: 16px;
}

.header h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header .subtitle {
  font-size: 15px;
  color: #94a3b8; /* Slate 400 */
}

/* Main Card */
.main-card {
  background: rgba(30, 41, 59, 0.7); /* Slate 800 with transparency */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Disclaimer Legal Box */
.disclaimer-box {
  margin-bottom: 35px;
}

.disclaimer-box h2 {
  font-size: 18px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.disclaimer-content {
  background-color: #0b0f19;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 20px;
  height: 240px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  color: #cbd5e1; /* Slate 300 */
  scrollbar-width: thin;
  scrollbar-color: #334155 #0b0f19;
}

/* Custom Scrollbar for disclaimer content */
.disclaimer-content::-webkit-scrollbar {
  width: 6px;
}

.disclaimer-content::-webkit-scrollbar-track {
  background: #0b0f19;
}

.disclaimer-content::-webkit-scrollbar-thumb {
  background-color: #334155;
  border-radius: 3px;
}

.disclaimer-content p {
  margin-bottom: 16px;
}

.disclaimer-content p:last-child {
  margin-bottom: 0;
}

.disclaimer-content strong {
  color: #38bdf8; /* Sky 400 */
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.full-width {
  grid-column: span 2;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
}

.input-group input {
  background-color: #0b0f19;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  color: #f8fafc;
  font-family: inherit;
  transition: all 0.2s ease;
}

.input-group input:focus {
  outline: none;
  border-color: #3b82f6; /* Blue 500 */
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input-group input::placeholder {
  color: #475569;
}

/* Signature Pad Styles */
.signature-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
}

.signature-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.signature-header label {
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
}

.btn-clear {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-clear:hover {
  background-color: rgba(239, 68, 68, 0.1);
}

.signature-pad-container {
  background-color: #ffffff; /* White background for clear contrast of signature */
  border: 2px solid #334155;
  border-radius: 12px;
  overflow: hidden;
  height: 200px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

#signaturePad {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.signature-tip {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
}

/* Submit Button */
.submit-section {
  margin-top: 25px;
}

.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2), 0 2px 4px -1px rgba(37, 99, 235, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3), 0 4px 6px -2px rgba(37, 99, 235, 0.2);
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btn-submit:active {
  transform: translateY(1px);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

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

.hidden {
  display: none !important;
}

/* Overlay & Modals */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 20px;
  width: 90%;
  max-width: 450px;
  padding: 40px 30px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(1);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-icon {
  width: 64px;
  height: 64px;
  background-color: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 32px;
  margin: 0 auto 20px auto;
  border: 2px solid #22c55e;
}

.modal-icon.error {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: #ef4444;
}

.modal-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #ffffff;
}

.modal-card p {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 25px;
}

.btn-modal-close {
  background-color: #334155;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
}

.btn-modal-close:hover {
  background-color: #475569;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 30px;
  font-size: 12px;
  color: #475569;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  body {
    padding: 10px;
  }

  .main-card {
    padding: 24px 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .full-width {
    grid-column: span 1;
  }

  .header h1 {
    font-size: 24px;
  }
}

/* Payment Box styling */
.payment-info-box {
  background-color: rgba(30, 58, 138, 0.25);
  border: 1px dashed rgba(59, 130, 246, 0.5);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.info-badge {
  background-color: #1e3a8a;
  border: 1px solid #3b82f6;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  align-self: flex-start;
  letter-spacing: 0.05em;
}

.payment-info-box p {
  font-size: 14px;
  color: #cbd5e1;
  line-height: 1.5;
}

.payment-info-box strong {
  color: #60a5fa;
  font-size: 16px;
}

.no-refund-alert {
  color: #fca5a5 !important;
  font-weight: 600;
  font-size: 13px !important;
  margin-top: 2px;
}

/* GPS Status Badge */
.gps-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #0b0f19;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: #94a3b8;
  height: 46px;
  width: 100%;
}

.gps-status-badge.success {
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
  background-color: rgba(20, 83, 45, 0.15);
}

.gps-status-badge.error {
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
  background-color: rgba(127, 29, 29, 0.15);
}

.gps-dot {
  width: 8px;
  height: 8px;
  background-color: #f59e0b;
  border-radius: 50%;
  display: inline-block;
}

.gps-status-badge.waiting .gps-dot {
  background-color: #f59e0b;
  animation: pulse 1.5s infinite;
}

.gps-status-badge.success .gps-dot {
  background-color: #22c55e;
}

.gps-status-badge.error .gps-dot {
  background-color: #ef4444;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.5; }
}

/* Camera Section */
.camera-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.camera-section label {
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
}

.camera-container {
  position: relative;
  width: 100%;
  height: 240px;
  background-color: #0b0f19;
  border: 1px solid #334155;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

#webcam {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror camera preview for natural feeling */
}

.photo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #475569;
  padding: 20px;
  text-align: center;
}

.placeholder-icon {
  font-size: 40px;
}

.camera-placeholder p {
  font-size: 13px;
}

.camera-controls {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.btn-capture {
  background-color: #1e293b;
  border: 1px solid #475569;
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: 8px;
  transition: all 0.2s;
}

.btn-capture:hover {
  background-color: #334155;
  border-color: #64748b;
}

.btn-capture.active {
  background-color: #10b981;
  border-color: #059669;
  color: #ffffff;
}

.btn-capture.active:hover {
  background-color: #059669;
}

/* ================================================== */
/*   ADMIN PANEL STYLES                               */
/* ================================================== */

/* Admin Body wrapper overrides */
body.admin-body {
  align-items: flex-start;
  padding-top: 40px;
  padding-bottom: 40px;
}

.admin-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  z-index: 1;
}

/* Login Card Center */
.login-wrapper {
  width: 100%;
  max-width: 420px;
  margin: 80px auto;
  z-index: 1;
}

.login-card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 20px;
  padding: 40px 30px;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.login-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-top: 15px;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 25px;
}

.login-error-msg {
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
  margin-top: 15px;
}

/* Admin Header Layout */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.admin-header h1 {
  font-size: 26px;
  font-weight: 700;
  margin-top: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.3);
  padding: 20px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #f8fafc;
}

.stat-value.online {
  color: #22c55e;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-value.online::before {
  content: '';
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
}

/* Toolbar search */
.admin-toolbar {
  margin-bottom: 20px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #475569;
}

.search-box input {
  width: 100%;
  background-color: #0b0f19;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px 16px 12px 42px;
  font-size: 14px;
  color: #f8fafc;
  font-family: inherit;
  transition: all 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Admin Card layout */
.admin-card {
  padding: 25px;
}

/* Responsive Table layout */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #1e293b;
  scrollbar-width: thin;
  scrollbar-color: #334155 #0b0f19;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #0b0f19;
}

.table-responsive::-webkit-scrollbar-thumb {
  background-color: #334155;
  border-radius: 3px;
}

/* Payments Table styling */
.payments-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background-color: #0b0f19;
  font-size: 13px;
}

.payments-table th {
  background-color: #0f172a;
  color: #94a3b8;
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 2px solid #1e293b;
  white-space: nowrap;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.payments-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #1e293b;
  color: #cbd5e1;
}

.payments-table tbody tr:hover {
  background-color: rgba(30, 41, 59, 0.3);
}

.payments-table th.col-user,
.payments-table td.col-user {
  position: sticky;
  left: 0;
  background-color: #0f172a;
  z-index: 10;
  width: 200px;
  border-right: 1px solid #1e293b;
}

.payments-table td.col-user {
  background-color: #0b0f19;
}

.payments-table tbody tr:hover td.col-user {
  background-color: #172554; /* Slate deep blue on row hover */
  color: #f8fafc;
}

/* Sticky column for contact details on larger layouts */
.payments-table th.col-contact,
.payments-table td.col-contact {
  width: 220px;
}

.user-name-cell {
  font-weight: 600;
  color: #f8fafc;
  display: block;
}

.user-sub-cell {
  font-size: 11px;
  color: #475569;
  display: block;
  margin-top: 2px;
}

.contact-email {
  color: #38bdf8;
  display: block;
}

.contact-phone {
  font-size: 11px;
  color: #64748b;
  display: block;
  margin-top: 2px;
}

.table-loading,
.table-empty {
  text-align: center;
  padding: 30px !important;
  color: #64748b !important;
  font-style: italic;
}

/* Checkbox alignment in cell */
.col-month {
  text-align: center !important;
  padding: 8px !important;
  min-width: 45px;
}

.col-month input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #22c55e; /* Modern browser support for native green checkboxes */
  vertical-align: middle;
  transition: transform 0.1s;
}

.col-month input[type="checkbox"]:active {
  transform: scale(0.85);
}

/* Responsive tweaks for admin */
@media (max-width: 768px) {
  body.admin-body {
    padding: 10px;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .admin-header-actions {
    width: 100%;
  }

  .admin-header-actions button {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}



