/* CorpAttendance - Executive QR, Geofence, Field & Two-Tier HR Platform
 * Corporate Executive Navy & Royal Blue Theme
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Kantumruy+Pro:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
  --corp-navy: #182B88;
  --corp-navy-dark: #121F64;
  --corp-navy-light: #253FB5;
  --bg-app: #F4F6FA;
  --card-bg: #FFFFFF;
  --text-main: #0F172A;
  --text-sub: #64748B;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Base resets & iOS touch feel */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  box-sizing: border-box;
}

html, body {
  font-family: 'Inter', 'Kantumruy Pro', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

/* Hide scrollbars cleanly while maintaining scrollability */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Realistic iPhone 15 Pro Frame */
.iphone-frame {
  border-radius: 52px;
  border: 11px solid #0B0F19;
  box-shadow:
    0 0 0 2px #334155,
    0 35px 80px -15px rgba(2, 6, 23, 0.9);
  margin-top: 14px;
  max-height: calc(100vh - 24px);
}

@media (max-width: 639px) {
  .iphone-frame {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    margin-top: 0 !important;
  }
  .iphone-notch {
    display: none !important;
  }
}

/* Fullscreen Mobile Mode when frame toggled off */
.fullscreen-mobile {
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100dvh !important;
  border-radius: 0 !important;
  border: none !important;
  margin-top: 0 !important;
  box-shadow: none !important;
}

/* Dynamic Island Notch */
.iphone-notch {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 108px;
  height: 25px;
  background-color: #030712;
  border-radius: 9999px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  gap: 6px;
  pointer-events: none;
  box-shadow: inset 0 0 2px rgba(255, 255, 255, 0.12);
}

.fullscreen-mobile .iphone-notch {
  display: none;
}

/* iOS Home Bar Indicator */
.ios-home-indicator {
  width: 124px;
  height: 4px;
  background-color: rgba(100, 116, 139, 0.35);
  border-radius: 9999px;
  margin: 6px auto 0;
}

/* Frosted Glass Bottom Navigation & Dock */
.glass-nav,
.glass-dock {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.dark .glass-nav,
.dark .glass-dock {
  background: rgba(15, 23, 42, 0.94);
}

/* Active Bottom Navigation Item & Pill Wrap */
.nav-tab-active {
  color: #1D4ED8 !important;
  position: relative;
}
.nav-tab-active .nav-icon-wrap {
  background-color: #EEF4FF;
  color: #1D4ED8;
  transform: translateY(-1px);
}
.dark .nav-tab-active {
  color: #60A5FA !important;
}
.dark .nav-tab-active .nav-icon-wrap {
  background-color: rgba(37, 99, 235, 0.24);
  color: #60A5FA;
}

/* Tactile Tap Press Animation */
.tap-press {
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.tap-press:active {
  transform: scale(0.965);
  opacity: 0.92;
}

/* Modern Bento Surface & Card Shadows */
.bento-card,
.card-shadow {
  box-shadow: 0 2px 14px -2px rgba(15, 23, 42, 0.06), 0 1px 3px -1px rgba(15, 23, 42, 0.04);
}
.dark .bento-card,
.dark .card-shadow {
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.35);
}

/* Screen & Modal Enter Animation */
.view-enter {
  animation: viewPopIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes viewPopIn {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* QR Scanner Laser Beam Animation */
.laser-line {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #38bdf8, #34d399, #38bdf8, transparent);
  box-shadow: 0 0 14px 2px rgba(56, 189, 248, 0.85);
  border-radius: 9999px;
  animation: laserSweep 2.2s ease-in-out infinite;
  z-index: 20;
}
@keyframes laserSweep {
  0%, 100% { top: 16px; }
  50% { top: calc(100% - 19px); }
}

/* QR Scanner 4 Corner Brackets */
.scanner-corner-tl,
.scanner-corner-tr,
.scanner-corner-bl,
.scanner-corner-br {
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: #34d399;
  border-style: solid;
  z-index: 20;
}
.scanner-corner-tl { top: 12px; left: 12px; border-width: 3px 0 0 3px; border-top-left-radius: 10px; }
.scanner-corner-tr { top: 12px; right: 12px; border-width: 3px 3px 0 0; border-top-right-radius: 10px; }
.scanner-corner-bl { bottom: 12px; left: 12px; border-width: 0 0 3px 3px; border-bottom-left-radius: 10px; }
.scanner-corner-br { bottom: 12px; right: 12px; border-width: 0 3px 3px 0; border-bottom-right-radius: 10px; }

/* Radar Pulse Ring for Location Denied Modal */
.radar-ring {
  animation: radarPulse 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}
@keyframes radarPulse {
  0% { transform: scale(0.85); opacity: 0.75; }
  100% { transform: scale(1.65); opacity: 0; }
}

/* Floating Action Button Glow */
.fab-btn {
  box-shadow: 0 10px 25px -5px rgba(24, 43, 136, 0.55);
}

/* ==========================================
   DATE RANGE PICKER STYLES (Matching Screenshots 1 & 2)
   ========================================== */
.calendar-day-cell {
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.12s ease;
  user-select: none;
}

/* Range Start Cell: Vibrant Blue with Rounded-Left */
.cal-range-start {
  background-color: #0070F3 !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  border-top-left-radius: 8px !important;
  border-bottom-left-radius: 8px !important;
  z-index: 2;
}

/* Single Selected Day */
.cal-range-single {
  background-color: #0070F3 !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  z-index: 2;
}

/* Range Middle Strip: Soft Gray Strip matching Screenshot 2 */
.cal-range-mid {
  background-color: #F1F5F9 !important;
  color: #0F172A !important;
  font-weight: 700 !important;
  border-radius: 0 !important;
}

.dark .cal-range-mid {
  background-color: #1E293B !important;
  color: #F8FAFC !important;
}

/* Range End Cell: Soft Gray with Rounded-Right border matching Screenshot 2 */
.cal-range-end {
  background-color: #F1F5F9 !important;
  color: #0F172A !important;
  font-weight: 700 !important;
  border-top-right-radius: 8px !important;
  border-bottom-right-radius: 8px !important;
  z-index: 2;
}

.dark .cal-range-end {
  background-color: #1E293B !important;
  color: #F8FAFC !important;
}

/* Weekend / Edge Row Wrapping for Range */
.cal-range-row-start {
  border-top-left-radius: 8px !important;
  border-bottom-left-radius: 8px !important;
}
.cal-range-row-end {
  border-top-right-radius: 8px !important;
  border-bottom-right-radius: 8px !important;
}

/* Today indicator */
.cal-today-indicator {
  color: #0070F3 !important;
  font-weight: 800 !important;
}

/* Print Styling for Printable Reports */
@media print {
  body * { visibility: hidden; }
  #printable-report-area, #printable-report-area * { visibility: visible; }
  #printable-report-area {
    position: fixed;
    inset: 0;
    background: white !important;
    color: black !important;
    padding: 20px;
    z-index: 99999;
  }
}

/* ==========================================
   GOOGLE MAP PINPOINT PICKER STYLES
   ========================================== */
#gps-map-canvas .leaflet-container {
  font-family: inherit;
}

#gps-map-canvas .leaflet-control-attribution {
  font-size: 9px !important;
  background: rgba(255, 255, 255, 0.78) !important;
  padding: 1px 5px !important;
}

.google-pin-marker {
  background: transparent;
  border: none;
}

.google-pin-svg {
  filter: drop-shadow(0 4px 6px rgba(15, 23, 42, 0.45));
  transition: transform 0.15s ease;
}

.google-pin-svg:hover {
  transform: translateY(-2px) scale(1.06);
}

/* ==========================================
   LIGHT MODE PORTAL LOGIN (ATtendance)
   ========================================== */
.login-portal-bg {
  background-color: #EFECE6;
  background-image:
    radial-gradient(at 20% 15%, rgba(255, 255, 255, 0.75) 0px, transparent 55%),
    radial-gradient(at 85% 85%, rgba(226, 221, 211, 0.7) 0px, transparent 55%);
  font-family: 'Inter', 'Noto Sans Khmer', 'Kantumruy Pro', sans-serif;
}

.portal-card {
  background: #FFFFFF;
  border-radius: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.brand-icon-glow {
  background-color: #0F766E;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.25);
}

.cta-teal-shadow {
  background-color: #0F766E;
  box-shadow: 0 8px 20px -4px rgba(15, 118, 110, 0.32);
}
.cta-teal-shadow:hover {
  background-color: #0D655E;
}

.clean-input {
  background-color: #FFFFFF;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.clean-input:hover {
  border-color: #D1D5DB;
}
.clean-input:focus-within {
  border-color: #0F766E;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.tab-active {
  background-color: #FFFFFF;
  color: #0F766E;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.tab-inactive {
  background-color: transparent;
  color: #6B7280;
  font-weight: 500;
}
.tab-inactive:hover {
  color: #374151;
}

@keyframes scanLine {
  0%, 100% { transform: translateY(8px); opacity: 0.4; }
  50% { transform: translateY(156px); opacity: 1; }
}
.animate-scan-line {
  animation: scanLine 2.2s ease-in-out infinite;
}
