/* ==========================================================================
   FLYBATT.COM - Official Design System & Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600;700;800;900&display=swap');

:root {
  /* 4-Color Traffic Light Status Tokens */
  --theme-standby: #0A0A0A;  /* Deep Matte Black */
  --theme-pass:    #009245;  /* Aero Emerald Green */
  --theme-caution: #D97706;  /* Safety Golden Amber */
  --theme-reject:  #B91C1C;  /* Airport Crimson Red */

  /* Neutral Tokens */
  --color-white: #FFFFFF;
  --color-gray-100: #F3F4F6;
  --color-gray-300: #D1D5DB;
  --color-gray-400: #9CA3AF;
  --color-gray-500: #6B7280;
  --color-gray-700: #374151;
  --color-gray-800: #1F2937;
  --color-gray-900: #111827;

  /* Current Active Theme Background */
  --bg-current: var(--theme-standby);
  --text-current: var(--color-white);

  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Transitions */
  --transition-theme: background-color 0.45s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Global Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  font-family: var(--font-main);
  background-color: var(--bg-current);
  color: var(--text-current);
  transition: var(--transition-theme);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Status Classes for Body */
body.status-standby { --bg-current: var(--theme-standby); }
body.status-pass    { --bg-current: var(--theme-pass); }
body.status-caution { --bg-current: var(--theme-caution); }
body.status-reject  { --bg-current: var(--theme-reject); }

/* Background Subtle Grid Texture (Matching Illustrator Artboard with 5-cell major grid) */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  background-size: 160px 160px, 160px 160px, 32px 32px, 32px 32px;
  background-image: 
    /* 5칸마다 굵기 50% 증가한 라인 (1.5px) */
    linear-gradient(to right, rgba(255, 255, 255, 0.07) 1.5px, transparent 1.5px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.07) 1.5px, transparent 1.5px),
    /* 기본 1칸 단위 격자 라인 (1px) */
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  z-index: 0;
}

/* ==========================================================================
   Navigation Bar (GNB)
   ========================================================================== */
.gnb {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.gnb-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.gnb-logo-img {
  height: 44px;
  width: auto;
  display: block;
}

.gnb-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  transition: all var(--transition-fast);
}

.btn-nav:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

/* ==========================================================================
   Main App Container
   ========================================================================== */
.app-container {
  flex: 1;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 20px 40px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* Mode Views: Standby vs Result */
.view-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.view-section.hidden {
  display: none !important;
}

/* ==========================================================================
   Standby Mode (HUD Viewfinder & Camera)
   ========================================================================== */
.standby-header {
  text-align: center;
  margin-bottom: 24px;
}

/* Official Brand Title Header (Matching Reticle Width 1:1) */
.brand-header-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 20px;
}

.brand-title-header {
  width: 340px;
  max-width: 100%;
  height: auto;
  display: block;
}

/* Viewfinder Frame (HUD Scanner Box) */
.viewfinder-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1;
  background: rgba(20, 20, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.viewfinder-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  transform: translateY(-2px);
}

/* Center Logo in Viewfinder (Incorporating Built-in HUD Reticle) */
.viewfinder-logo {
  width: 340px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  margin-bottom: 0;
  transition: transform 0.3s ease;
}

.viewfinder-card:hover .viewfinder-logo {
  transform: scale(1.05);
}

.viewfinder-prompt {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-white);
  text-align: center;
  line-height: 1.4;
  margin-top: 20px;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.standby-disclaimer {
  font-size: 0.76rem;
  color: var(--color-gray-400);
  text-align: center;
  line-height: 1.5;
  margin-top: 0;
  opacity: 0.85;
}

/* Hidden File Input */
.hidden-file-input {
  display: none;
}

/* Action Controls (Shutter & Upload) */
.controls-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 24px;
  gap: 14px;
}

.btn-shutter-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 380px;
  padding: 18px 24px;
  background: #FFFFFF;
  color: #0A0A0A;
  border: none;
  border-radius: 20px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.15);
  transition: all var(--transition-fast);
}

.btn-shutter-main:hover {
  background: #F3F4F6;
  transform: scale(1.02);
  box-shadow: 0 12px 30px rgba(255, 255, 255, 0.25);
}

.btn-shutter-main:active {
  transform: scale(0.98);
}

.btn-shutter-main svg {
  width: 24px;
  height: 24px;
}

.quick-demo-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--color-gray-400);
}

.btn-demo-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-demo-pill:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Google AdSense Reserved Banner Slots
   ========================================================================== */
.adsense-slot-container {
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 16px;
  text-align: center;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin: 0 auto;
}

.adsense-slot-container.top-ad {
  margin-bottom: 24px;
}

.adsense-slot-container.bottom-ad {
  margin-top: 32px;
}

.adsense-slot-label {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gray-500);
  margin-bottom: 6px;
  font-weight: 600;
}

/* ==========================================================================
   Scanning Animation Overlay
   ========================================================================== */
.scanning-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  background: rgba(10, 10, 10, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.scan-laser {
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #10B981, transparent);
  box-shadow: 0 0 15px #10B981;
  animation: laserScan 1.6s ease-in-out infinite alternate;
}

@keyframes laserScan {
  0% { top: 10%; opacity: 0.4; }
  100% { top: 90%; opacity: 1; }
}

.scanning-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

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

.scanning-text {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.scanning-subtext {
  font-size: 0.8rem;
  color: var(--color-gray-400);
  margin-top: 4px;
}

/* ==========================================================================
   Result View (Fullscreen Traffic Light)
   ========================================================================== */
.result-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeInScale 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Massive Verdict Icon & Title */
.verdict-symbol {
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 8px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.verdict-title {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 6px;
}

.verdict-instruction {
  font-size: 1.15rem;
  font-weight: 700;
  opacity: 0.95;
  margin-bottom: 24px;
  padding: 6px 18px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 9999px;
  display: inline-block;
}

/* Result Specs Card (Glassmorphism) */
.specs-card {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.spec-value {
  font-size: 1.3rem;
  font-weight: 800;
  margin-top: 4px;
}

.specs-notice {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.85rem;
  line-height: 1.45;
  opacity: 0.9;
  text-align: left;
}

/* Result Button Actions */
.result-actions {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 12px;
}

.btn-pass-cert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  background: #FFFFFF;
  color: #0A0A0A;
  border: none;
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  transition: all var(--transition-fast);
}

.btn-pass-cert:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.btn-rescan {
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-rescan:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   IATA Airport Officer Security Pass Modal
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.pass-card {
  width: 100%;
  max-width: 420px;
  background: #0A0A0A;
  color: #FFFFFF;
  border: 2px solid #009245;
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: 0 25px 60px rgba(0, 146, 69, 0.35);
  display: flex;
  flex-direction: column;
  position: relative;
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.pass-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.pass-logo {
  height: 28px;
  width: auto;
}

.pass-badge {
  background: #009245;
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.pass-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pass-stamp {
  border: 2px solid #009245;
  padding: 14px;
  border-radius: 12px;
  background: rgba(0, 146, 69, 0.08);
  text-align: center;
}

.stamp-verdict {
  font-size: 1.25rem;
  font-weight: 900;
  color: #009245;
  letter-spacing: 0.5px;
}

.stamp-rule {
  font-size: 0.8rem;
  color: #9CA3AF;
  margin-top: 4px;
}

.pass-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pass-row-label {
  color: #9CA3AF;
}

.pass-row-val {
  font-weight: 700;
}

.btn-close-modal {
  margin-top: 20px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 20px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: auto;
}

.footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  margin: 0 8px;
}

.footer a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Mobile Responsiveness
   ========================================================================== */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.5rem;
  }
  .verdict-title {
    font-size: 1.85rem;
  }
  .viewfinder-card {
    max-width: 320px;
  }
}
