/* Ghost Palace Airways - Styling */
:root {
  --ua-navy: #002244;
  --ua-dark: #00172e;
  --ua-blue: #005daa;
  --ua-sky: #00a3e0;
  --ua-gold: #d4af37;
  --ua-gold-bright: #f4d03f;
  --bg-light: #f1f5f9;
  --card-bg: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --success-green: #10b981;
  --warning-amber: #f59e0b;
  --danger-red: #ef4444;
}

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

.hidden {
  display: none !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--ua-dark);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
}

/* App Header */
header.app-header {
  background: linear-gradient(135deg, var(--ua-navy), #003366);
  color: white;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 44px;
  height: 28px;
}

.airline-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: white;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flight-pill {
  font-size: 0.75rem;
  font-weight: 700;
  background-color: rgba(255, 255, 255, 0.15);
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-help {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.btn-help:hover, .btn-help:focus {
  background: rgba(255, 255, 255, 0.35);
  border-color: #ffffff;
  transform: scale(1.08);
}

.help-question-mark {
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success-green);
  box-shadow: 0 0 6px var(--success-green);
}

.status-dot.offline {
  background-color: var(--warning-amber);
  box-shadow: 0 0 6px var(--warning-amber);
}

/* Navigation Tabs */
nav.app-nav {
  display: flex;
  background-color: #001a35;
  border-bottom: 2px solid var(--ua-blue);
  overflow-x: auto;
  scrollbar-width: none;
}

nav.app-nav::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  flex: 1;
  min-width: 72px;
  padding: 10px 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  color: #94a3b8;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.2s;
}

.nav-tab.active {
  color: white;
  background-color: rgba(0, 93, 170, 0.3);
  border-bottom: 3px solid var(--ua-sky);
}

.nav-tab svg {
  width: 20px;
  height: 20px;
}

/* Main Container */
main.app-main {
  flex: 1;
  padding: 16px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  overflow-x: hidden;
  touch-action: pan-y;
}

/* Offline Banner */
.offline-banner {
  background-color: #78350f;
  color: #fef3c7;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #d97706;
}

.offline-banner.hidden {
  display: none;
}

.sync-badge {
  background-color: #b45309;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
}

/* Tabs Slider & Track (Interactive Swipe Carousel) */
.tabs-slider {
  width: 100%;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
}

.tabs-track {
  display: flex;
  width: 100%;
  align-items: flex-start;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
  touch-action: pan-y;
}

.tab-view {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
}

/* Boarding Pass Card */
.boarding-pass-card {
  background-color: var(--card-bg);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  position: relative;
}

.pass-header {
  background: linear-gradient(135deg, var(--ua-navy), var(--ua-blue));
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pass-airline {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.pass-class-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-standby {
  background-color: #64748b;
  color: white;
}

.badge-y {
  background-color: #0284c7;
  color: white;
}

.badge-eplus {
  background-color: #0d9488;
  color: white;
}

.badge-pp {
  background-color: #7c3aed;
  color: white;
}

.badge-polaris {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: var(--ua-gold-bright);
  border: 1px solid var(--ua-gold);
}

.pass-route {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.airport-block {
  display: flex;
  flex-direction: column;
}

.airport-code {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--ua-navy);
  line-height: 1;
}

.airport-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.flight-plane-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--ua-blue);
}

.plane-route-line {
  width: 60px;
  height: 2px;
  background: dashed 2px var(--border-color);
  margin-top: 4px;
}

/* Pass Details Grid */
.pass-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 16px;
}

.pass-field {
  display: flex;
  flex-direction: column;
}

.field-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark);
}

.field-value.highlight-seat {
  font-size: 2rem;
  color: var(--ua-blue);
  line-height: 1;
}

.field-value.standby-seat {
  font-size: 1.3rem;
  color: #ea580c;
}

/* Tear Line */
.pass-tear {
  position: relative;
  border-top: 2px dashed #cbd5e1;
  margin: 8px 0;
}

.pass-tear::before,
.pass-tear::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 20px;
  height: 20px;
  background-color: var(--ua-dark);
  border-radius: 50%;
}

.pass-tear::before {
  left: -10px;
}

.pass-tear::after {
  right: -10px;
}

/* Barcode section */
.pass-barcode-section {
  padding: 16px;
  text-align: center;
  background-color: white;
}

.barcode-sim {
  height: 48px;
  margin: 0 auto;
  background: repeating-linear-gradient(
    90deg,
    #000 0px,
    #000 2px,
    #fff 2px,
    #fff 4px,
    #000 4px,
    #000 7px,
    #fff 7px,
    #fff 9px,
    #000 9px,
    #000 12px,
    #fff 12px,
    #fff 14px,
    #000 14px,
    #000 18px,
    #fff 18px,
    #fff 20px
  );
  width: 85%;
  max-width: 320px;
  border-radius: 4px;
}

.barcode-code {
  font-family: monospace;
  font-size: 0.95rem;
  letter-spacing: 3px;
  color: #334155;
  margin-top: 6px;
  font-weight: 700;
}

/* Manage Trip Accordion */
.manage-trip-section {
  margin-top: 16px;
  background-color: #1e293b;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #334155;
}

.manage-trip-header {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
}

.manage-trip-body {
  padding: 16px;
  display: none;
  background-color: #0f172a;
  color: white;
  font-size: 0.85rem;
}

.manage-trip-body.open {
  display: block;
}

.trip-option-group {
  margin-bottom: 14px;
}

.trip-option-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: #93c5fd;
}

.powder-joke-box {
  background-color: #1e1b4b;
  border: 1px solid #4338ca;
  padding: 10px;
  border-radius: 8px;
  margin-top: 8px;
}

.disclaimer-text {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 4px;
  font-style: italic;
}

/* Seat Map Container & Realistic 787 Fuselage */
.seat-map-container {
  background-color: #0f172a;
  border-radius: 20px;
  padding: 16px 8px 80px 8px; /* extra bottom padding for floating confirm bar */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.plane-fuselage {
  border: 4px solid #334155;
  border-radius: 40px 40px 24px 24px;
  padding: 16px 8px 24px 8px;
  background-color: #ffffff;
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
}

.exit-marker {
  color: #dc2626;
  font-weight: 800;
}

.service-icons {
  display: flex;
  gap: 12px;
}

/* Column Header Row */
.cabin-columns-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  padding-left: 24px; /* match row-number offset */
  font-size: 0.7rem;
  font-weight: 800;
  color: #0284c7;
}

.cabin-col-letter {
  width: 28px;
  text-align: center;
}

/* Cabin Section */
.cabin-section {
  margin-bottom: 20px;
}

.cabin-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: #f8fafc;
  border-left: 4px solid var(--ua-blue);
  border-radius: 0 6px 6px 0;
  margin-bottom: 10px;
}

.cabin-title {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--ua-navy);
}

.seat-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  margin-bottom: 5px;
}

.row-number {
  font-size: 0.7rem;
  font-weight: 800;
  color: #64748b;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.aisle-space {
  width: 12px;
  flex-shrink: 0;
}

/* Individual Seat Styling */
.seat-item {
  width: 28px;
  height: 30px;
  border-radius: 5px 5px 3px 3px;
  border: 1.5px solid #94a3b8;
  background-color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 0.6rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.seat-item.available {
  border-color: #0284c7;
  color: #0284c7;
  background-color: #f0f9ff;
}

.seat-item.available:hover {
  background-color: #bae6fd;
  transform: scale(1.08);
  z-index: 5;
}

.seat-item.selected {
  border-color: #10b981 !important;
  background-color: #d1fae5 !important;
  color: #065f46 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6) !important;
  transform: scale(1.12);
  z-index: 10;
}

.seat-item.occupied {
  background-color: #e2e8f0;
  border-color: #cbd5e1;
  color: #475569;
  cursor: not-allowed;
  font-size: 0.52rem;
  line-height: 1;
  text-align: center;
  padding: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-item.my-seat {
  background-color: var(--ua-blue);
  border-color: var(--ua-navy);
  color: white;
  box-shadow: 0 0 8px rgba(0, 93, 170, 0.8);
  font-weight: 900;
}

.seat-item.locked {
  background-color: #f8fafc;
  border-color: #e2e8f0;
  color: #cbd5e1;
  cursor: not-allowed;
}

/* Floating Seat Confirmation Bar */
.seat-confirm-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 480px;
  background: #1e293b;
  border: 2px solid #38bdf8;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  z-index: 80;
  color: white;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translate(-50%, 40px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.seat-confirm-info {
  display: flex;
  flex-direction: column;
}

.seat-confirm-title {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
}

.seat-confirm-code {
  font-size: 1.25rem;
  font-weight: 900;
  color: #38bdf8;
}

.seat-confirm-actions {
  display: flex;
  gap: 8px;
}


/* Standby Board */
.standby-board {
  background-color: #0b1329;
  border-radius: 16px;
  padding: 16px;
  color: white;
  border: 1px solid #1e293b;
}

.board-header {
  border-bottom: 2px solid #334155;
  padding-bottom: 10px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.board-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #f8fafc;
}

.standby-table {
  width: 100%;
  border-collapse: collapse;
}

.standby-table th {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #1e293b;
}

.standby-table td {
  padding: 10px 6px;
  font-size: 0.9rem;
  font-weight: 700;
  border-bottom: 1px solid #1e293b;
}

.status-cleared {
  color: var(--success-green);
}

.status-waiting {
  color: var(--warning-amber);
}

/* Scanner View */
.scanner-card {
  background-color: #0f172a;
  border-radius: 18px;
  padding: 20px;
  color: white;
  text-align: center;
  border: 1px solid #334155;
}

.camera-preview-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 260px;
  margin: 16px auto;
  border-radius: 14px;
  overflow: hidden;
  background-color: #000;
  border: 2px solid var(--ua-blue);
}

#camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-crosshairs {
  position: absolute;
  top: 15%;
  left: 15%;
  width: 70%;
  height: 70%;
  border: 2px solid var(--ua-sky);
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0, 163, 224, 0.4);
  pointer-events: none;
}

.scan-laser {
  width: 100%;
  height: 2px;
  background-color: var(--danger-red);
  box-shadow: 0 0 8px var(--danger-red);
  position: absolute;
  top: 0;
  animation: laserScan 2s infinite ease-in-out;
}

@keyframes laserScan {
  0% { top: 5%; }
  50% { top: 95%; }
  100% { top: 5%; }
}

.manual-scan-box {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #334155;
}

/* Crew Profiles */
.crew-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.crew-card {
  background-color: white;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.crew-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--ua-blue);
}

.crew-info h3 {
  font-size: 1rem;
  color: var(--ua-navy);
}

.crew-role {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ua-blue);
  margin-bottom: 4px;
}

.crew-bio {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.transit-banner {
  background: linear-gradient(135deg, #4a154b, #2b0a3d);
  color: white;
  padding: 16px;
  border-radius: 14px;
  margin-bottom: 16px;
  border: 1px solid #a855f7;
}

/* Modals & Check-in Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  z-index: 1000;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-card {
  background-color: white;
  border-radius: 18px;
  padding: 20px;
  width: 100%;
  max-width: 440px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-sizing: border-box;
  margin: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--ua-blue);
  color: white;
}

.btn-primary:hover {
  background-color: #004d8c;
}

.btn-secondary {
  background-color: #e2e8f0;
  color: #334155;
  margin-top: 8px;
}

.input-field {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  margin-top: 6px;
  margin-bottom: 14px;
}

.input-field:focus {
  outline: none;
  border-color: var(--ua-blue);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal-close-btn:hover {
  color: var(--text-dark);
}

.btn-link {
  background: none;
  border: none;
  color: var(--ua-blue);
  font-weight: 700;
  cursor: pointer;
  padding: 6px;
  font-size: 0.85rem;
  text-decoration: underline;
}

.btn-link:hover {
  color: #003366;
}

#modal-scanner,
#modal-help {
  z-index: 1100;
}

/* Floating Confirm Seat Change Button (Above Scan Crew FAB) */
.fab-confirm-seat {
  position: fixed;
  bottom: 86px;
  right: 20px;
  z-index: 1050;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 20px;
  border-radius: 26px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.fab-confirm-seat:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.6), 0 6px 14px rgba(0, 0, 0, 0.35);
}

.fab-confirm-seat:active {
  transform: translateY(0) scale(0.97);
}

/* Persistent Floating Action Button (FAB) */
.fab-scan {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 1050;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 20px;
  border-radius: 26px;
  background: linear-gradient(135deg, #0284c7 0%, #005da4 100%);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 24px rgba(0, 93, 164, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.fab-scan:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 28px rgba(0, 93, 164, 0.6), 0 6px 14px rgba(0, 0, 0, 0.35);
}

.fab-scan:active {
  transform: translateY(0) scale(0.97);
}

.fab-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.fab-label {
  white-space: nowrap;
}

/* Help Modal Styles */
.help-modal-card {
  max-width: 380px;
  width: 92%;
}

.help-summary-box {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 6px;
}

.help-summary-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: #1e293b;
  line-height: 1.4;
}

.help-step-icon {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}

/* Scanner Modal Specifics */
.scanner-modal-card {
  max-width: 440px;
  width: 100%;
}
