/* ==============================================================
   ANJUNGAN PELAYANAN MANDIRI (APM) - KALURAHAN GILANGHARJO
   Custom Kiosk Stylesheet: Emerald Green, Gold, Cream & White
   ============================================================== */

:root {
  --primary-dark: #064e3b;      /* Hijau Tua */
  --primary-deep: #065f46;
  --primary-emerald: #059669;   /* Hijau Zamrud */
  --primary-light: #10b981;
  --primary-subtle: #ecfdf5;

  --accent-gold: #b45309;       /* Emas Antik */
  --accent-gold-mid: #d97706;   /* Emas Murni */
  --accent-gold-light: #f59e0b; /* Emas Terang */
  --accent-gold-soft: #fef3c7;

  --bg-cream: #faf7f2;          /* Krem Elegan */
  --bg-cream-dark: #f3ede2;
  --text-dark: #1f2937;
  --text-muted: #4b5563;
  --border-color: #e5e7eb;
  
  --shadow-kiosk: 0 10px 25px -5px rgba(6, 78, 59, 0.12), 0 8px 10px -6px rgba(6, 78, 59, 0.08);
  --shadow-kiosk-hover: 0 20px 35px -10px rgba(6, 78, 59, 0.22), 0 10px 15px -5px rgba(217, 119, 6, 0.15);
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-jawa: 'Noto Sans Javanese', 'Segoe UI Historic', 'Tuladha Jejeg', sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background-color: var(--bg-cream);
  background-image: url('../img/javanese-pattern.svg');
  background-repeat: repeat;
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  user-select: none; /* Kiosk mode safety */
}

/* Aksara Jawa Styling */
.aksara-jawa {
  font-family: var(--font-jawa);
  letter-spacing: 0.15em;
  font-weight: 500;
  color: var(--accent-gold-mid);
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Kiosk Top Bar */
.kiosk-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-deep) 60%, #043e2f 100%);
  color: #ffffff;
  border-bottom: 4px solid var(--accent-gold-mid);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 1rem 2rem;
  position: relative;
  z-index: 50;
}

.kiosk-header::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #fbbf24, #d97706, transparent);
}

.header-clock {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  backdrop-filter: blur(8px);
  border-radius: 1rem;
  padding: 0.6rem 1.4rem;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* Big Kiosk Action Cards */
.kiosk-card-action {
  background: #ffffff;
  border-radius: 1.75rem;
  border: 2px solid #f1ece1;
  box-shadow: var(--shadow-kiosk);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
}

.kiosk-card-action:hover, .kiosk-card-action:active {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-kiosk-hover);
  border-color: var(--accent-gold-mid);
  text-decoration: none;
  color: inherit;
}

.kiosk-card-action::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--primary-emerald), var(--accent-gold-mid));
}

.kiosk-icon-badge {
  width: 100px;
  height: 100px;
  border-radius: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin: 0 auto 1.5rem auto;
  box-shadow: 0 8px 16px rgba(0,0,0,0.06);
  transition: transform 0.25s ease;
}

.kiosk-card-action:hover .kiosk-icon-badge {
  transform: scale(1.1) rotate(2deg);
}

.badge-green {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: var(--primary-emerald);
  border: 2px solid #a7f3d0;
}

.badge-gold {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: var(--accent-gold-mid);
  border: 2px solid #fde68a;
}

/* Touch Numeric Keypad */
.kiosk-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 380px;
  margin: 1.25rem auto 0 auto;
}

.keypad-btn {
  height: 70px;
  border-radius: 1rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: #ffffff;
  border: 2px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.keypad-btn:active {
  background: var(--primary-subtle);
  border-color: var(--primary-emerald);
  transform: scale(0.95);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.keypad-btn-special {
  background: #f8fafc;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.keypad-btn-delete {
  color: #dc2626;
  background: #fef2f2;
}

.keypad-btn-delete:active {
  background: #fee2e2;
}

/* Large Kiosk Inputs */
.kiosk-input {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 1.1rem 1.5rem;
  border-radius: 1.25rem;
  border: 3px solid #cbd5e1;
  background: #ffffff;
  color: var(--primary-dark);
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.kiosk-input:focus {
  border-color: var(--primary-emerald);
  box-shadow: 0 0 0 6px rgba(5, 150, 105, 0.2);
  outline: none;
}

/* Letter Type Grid Cards */
.letter-type-card {
  background: #ffffff;
  border-radius: 1.25rem;
  border: 2px solid #e5e7eb;
  padding: 1.5rem;
  box-shadow: var(--shadow-kiosk);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  text-decoration: none;
  color: inherit;
}

.letter-type-card:hover, .letter-type-card:active {
  border-color: var(--primary-emerald);
  background: #f0fdf4;
  transform: translateX(4px);
  box-shadow: var(--shadow-kiosk-hover);
  text-decoration: none;
  color: inherit;
}

.letter-icon {
  width: 60px;
  height: 60px;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--primary-emerald), var(--primary-dark));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.3);
}

/* Step Wizard Progress */
.step-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.step-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  z-index: 2;
  transition: all 0.3s ease;
}

.step-item.active .step-circle {
  background: var(--primary-emerald);
  color: #ffffff;
  box-shadow: 0 0 0 5px rgba(5, 150, 105, 0.25);
}

.step-item.completed .step-circle {
  background: var(--accent-gold-mid);
  color: #ffffff;
}

.step-line {
  position: absolute;
  top: 24px;
  left: 50%;
  right: -50%;
  height: 4px;
  background: #e2e8f0;
  z-index: 1;
}

.step-item.completed .step-line {
  background: var(--accent-gold-mid);
}

/* Kiosk Buttons */
.btn-kiosk-primary {
  background: linear-gradient(135deg, var(--primary-emerald) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  border: 2px solid #064e3b;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.9rem 2rem;
  border-radius: 1.25rem;
  box-shadow: 0 8px 16px rgba(6, 78, 59, 0.25);
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-decoration: none;
}

.btn-kiosk-primary:hover, .btn-kiosk-primary:active {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-emerald) 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(6, 78, 59, 0.35);
  color: #ffffff;
  text-decoration: none;
}

.btn-kiosk-gold {
  background: linear-gradient(135deg, var(--accent-gold-light) 0%, var(--accent-gold) 100%);
  color: #ffffff;
  border: 2px solid #92400e;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.9rem 2rem;
  border-radius: 1.25rem;
  box-shadow: 0 8px 16px rgba(180, 83, 9, 0.25);
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-decoration: none;
}

.btn-kiosk-gold:hover, .btn-kiosk-gold:active {
  transform: translateY(-2px);
  color: #ffffff;
  box-shadow: 0 12px 20px rgba(180, 83, 9, 0.35);
  text-decoration: none;
}

.btn-kiosk-secondary {
  background: #ffffff;
  color: var(--primary-dark);
  border: 2px solid #cbd5e1;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.9rem 2rem;
  border-radius: 1.25rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-decoration: none;
}

.btn-kiosk-secondary:hover, .btn-kiosk-secondary:active {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: var(--primary-dark);
  text-decoration: none;
}

/* Floating Return Button */
.btn-floating-home {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 100;
  background: #ffffff;
  color: var(--primary-dark);
  border: 2px solid var(--primary-emerald);
  padding: 0.8rem 1.6rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-floating-home:hover {
  background: var(--primary-subtle);
  transform: translateY(-3px);
  color: var(--primary-dark);
  text-decoration: none;
}

/* Kiosk Footer */
.kiosk-footer {
  margin-top: auto;
  background: #ffffff;
  border-top: 2px solid var(--accent-gold-soft);
  padding: 1.2rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Admin Dashboard Specifics */
.admin-sidebar {
  background: linear-gradient(180deg, var(--primary-dark) 0%, #043528 100%);
  color: #ffffff;
  min-height: 100vh;
  box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}

.admin-nav-link {
  color: #e2e8f0;
  padding: 0.85rem 1.25rem;
  border-radius: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: all 0.2s ease;
  text-decoration: none;
  margin-bottom: 0.4rem;
}

.admin-nav-link:hover, .admin-nav-link.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fef08a;
  border-left: 4px solid var(--accent-gold-mid);
  text-decoration: none;
}

.stat-card {
  background: #ffffff;
  border-radius: 1.25rem;
  border: 1px solid #e2e8f0;
  padding: 1.5rem;
  box-shadow: var(--shadow-kiosk);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
}

.stat-card-green::before { background: var(--primary-emerald); }
.stat-card-gold::before { background: var(--accent-gold-mid); }
.stat-card-blue::before { background: #3b82f6; }
.stat-card-purple::before { background: #8b5cf6; }

/* Kop Surat Gambar Statis */
.kop-surat-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: contain;
  display: block;
  margin: 0 auto 10px auto;
}

/* Inactivity Modal Countdown */
#idleModal {
  backdrop-filter: blur(5px);
  background: rgba(6, 78, 59, 0.45);
}

/* ==============================================================
   PRINT STYLESHEET (SURAT RESMI KALURAHAN GILANGHARJO)
   ============================================================== */
@media print {
  /* Sembunyikan elemen non-cetak */
  .no-print,
  .kiosk-header,
  .kiosk-footer,
  .btn-floating-home,
  #idleModal,
  .btn,
  button,
  .card-print-actions {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
    font-family: 'Times New Roman', Times, serif !important;
    font-size: 12pt !important;
    line-height: 1.5 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .print-page {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 1.2cm 1.8cm !important;
    box-shadow: none !important;
    border: none !important;
  }

  .kop-surat-wrapper {
    margin-bottom: 12px !important;
    padding: 0 !important;
  }

  .kop-surat-img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 145px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto 10px auto !important;
  }

  .kop-surat {
    border-bottom: 3px double #000000 !important;
    padding-bottom: 8px !important;
    margin-bottom: 18px !important;
    text-align: center !important;
  }

  .kop-logo {
    width: 75px !important;
    height: auto !important;
  }

  .table-biodata td {
    padding: 2px 4px !important;
    font-size: 11pt !important;
    vertical-align: top !important;
  }

  .ttd-block {
    page-break-inside: avoid;
    margin-top: 30px !important;
  }
}
