/* ====================================================================
 * CUSTOM STYLESHEET (styles.css) - RUKUN KEMATIAN DIGITAL
 * ====================================================================
 */

html, body {
  height: 100% !important;
  height: 100dvh !important;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #f8fafc; /* Slate 50 - clean desktop background */
}

/* Smartphone Container - Behaves as a full screen responsive wrapper */
.smartphone-container {
  width: 100%;
  height: 100%;
  height: 100dvh;
  background-color: #f8fafc;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Switch Mode Button styles */
.switch-mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #f0fdfa; /* Teal 50 */
  border: 1px solid #ccfbf1; /* Teal 100 */
  color: #0d9488; /* Teal 600 */
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}

.switch-mode-btn:active {
  transform: scale(0.95);
}

/* Scroll area without scrollbar */
.scroll-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 100px; /* Space for bottom nav padding */
  width: 100%;
  scrollbar-width: none; /* Firefox */
}

@media (min-width: 768px) {
  .scroll-viewport {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px 110px 24px;
  }
}

.scroll-viewport::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

/* Bottom Nav bar locked inside smartphone container */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(229, 231, 235, 0.8);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  padding: 10px 16px 22px 16px;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Default 3 items */
  box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.08);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #6b7280; /* Gray 500 */
  font-size: 10px;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
  padding: 4px 0;
  border-radius: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.bottom-nav-item i {
  font-size: 22px;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.bottom-nav-item.active {
  color: #0d9488; /* Teal 600 */
}

.bottom-nav-item:active i {
  transform: scale(0.85);
}

/* Smooth Transitions for SPA views */
.page-view {
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
  opacity: 0;
  transform: translateY(8px);
  display: none; /* Hidden by default */
}

.page-view.active {
  display: block; /* Show if active */
  opacity: 1;
  transform: translateY(0);
}

/* Premium gradient elements */
.gradient-card {
  background: linear-gradient(135deg, #0d9488 0%, #115e59 100%);
  color: white;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 25px -5px rgba(13, 148, 136, 0.25);
}

.premium-card {
  background: white;
  border-radius: 18px;
  box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.03), 0 2px 6px -2px rgba(0, 0, 0, 0.01);
  border: 1px solid #f3f4f6;
  transition: all 0.2s ease-in-out;
}

/* Global Reusable Modal styles (Bottom Sheet style) */
.global-modal-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5); /* Slate 900 overlay */
  backdrop-filter: blur(3px);
  z-index: 50;
  display: flex;
  align-items: flex-end; /* Bottom sheet style */
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
}

.global-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.global-modal-content {
  width: 100%;
  background-color: white;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  padding: 24px 24px 32px 24px;
  max-height: 85%;
  overflow-y: auto;
  box-shadow: 0 -20px 25px -5px rgba(0, 0, 0, 0.12);
  transform: translateY(100%);
  transition: transform 0.25s ease-out;
  display: flex;
  flex-direction: column;
}

.global-modal-overlay.active .global-modal-content {
  transform: translateY(0);
}

/* Button primary styles */
.btn-primary {
  background-color: #0d9488;
  color: white;
  font-weight: 700;
  transition: all 0.15s ease-in-out;
  border-radius: 14px;
}

.btn-primary:active {
  transform: scale(0.97);
  background-color: #0f766e;
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Prevents SweetAlert2 from collapsing body/html height ever */
html.swal2-height-auto, body.swal2-height-auto {
  height: 100% !important;
  height: 100dvh !important;
  overflow: hidden !important;
}

/* Override tiny font sizes & weight globally for better readability */
.text-\[8px\] {
  font-size: 11px !important;
  font-weight: 600 !important;
}
.text-\[9px\] {
  font-size: 12px !important;
  font-weight: 600 !important;
}
.text-\[10px\] {
  font-size: 13px !important;
  font-weight: 600 !important;
}
.text-xs {
  font-size: 14px !important;
  font-weight: 600 !important;
}
.text-sm {
  font-size: 15px !important;
}
.text-base {
  font-size: 17px !important;
}

/* ====================================================================
   HIGH CONTRAST & ACCESSIBILITY OVERRIDES (THEME IMPROVEMENT)
   ==================================================================== */

/* Darken supplementary gray texts for WCAG AA readability compliance */
.text-gray-400 {
  color: #475569 !important; /* Slate 600 instead of Gray 400 */
}
.text-gray-500 {
  color: #334155 !important; /* Slate 700 instead of Gray 500 */
}
.text-gray-650, .text-gray-600 {
  color: #1e293b !important; /* Slate 800 instead of Gray 650/600 */
}
.text-gray-750, .text-gray-700 {
  color: #0f172a !important; /* Slate 900 instead of Gray 700 */
}
.text-gray-800, .text-gray-900 {
  color: #020617 !important; /* Slate 950 instead of Gray 800/900 */
}

/* Strengthen status badges and label text colors on light backgrounds */
.text-brand-600, .text-brand-650, .text-brand-700 {
  color: #0d9488 !important; /* Bold Brand Teal */
}
.text-indigo-600, .text-indigo-700 {
  color: #3730a3 !important; /* Indigo 800 */
}
.text-emerald-600, .text-emerald-700 {
  color: #065f46 !important; /* Emerald 800 */
}
.text-red-600, .text-red-650, .text-red-700 {
  color: #991b1b !important; /* Red 800 */
}
.text-orange-600, .text-orange-700 {
  color: #9a3412 !important; /* Orange 800 */
}
.text-teal-600, .text-teal-700 {
  color: #115e59 !important; /* Teal 800 */
}

/* Sharp container borders for clear block separation */
.premium-card {
  border: 1.5px solid #cbd5e1 !important; /* Slate 300 instead of Gray 100 */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}

/* Form input borders */
input, select, textarea {
  border: 1.5px solid #cbd5e1 !important; /* Slate 300 borders */
  color: #0f172a !important; /* Slate 900 text value */
}

/* Gradient card shadow styling */
.gradient-card {
  box-shadow: 0 12px 28px -4px rgba(13, 148, 136, 0.3) !important;
}

/* Force perfect square shapes for grid menus */
.aspect-square {
  aspect-ratio: 1 / 1 !important;
}
