/* Skyward Bound / Winged Era - Clean Modern Light Theme */
:root {
  --bg-primary: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-hover: #E2E8F0;
  
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;

  --accent-sky: #0284C7;
  --accent-sky-light: #E0F2FE;
  --accent-sky-dark: #0369A1;

  --accent-mint: #10B981;
  --accent-mint-light: #ECFDF5;
  --accent-mint-dark: #047857;

  --accent-amber: #F59E0B;
  --accent-amber-light: #FFFBEB;
  
  --accent-rose: #EF4444;
  --accent-rose-light: #FEF2F2;

  --border-light: #E2E8F0;
  --border-subtle: #CBD5E1;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* App Container */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* Top Navigation Bar */
header.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 8px 18px;
  height: 56px;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-sky);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.airline-badge {
  background: var(--accent-sky-light);
  color: var(--accent-sky-dark);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid #BAE6FD;
}

.partner-badge {
  background: var(--accent-mint-light);
  color: var(--accent-mint-dark);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid #A7F3D0;
}

.stats-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.stat-value.money {
  color: var(--accent-mint-dark);
}

.stat-value.negative {
  color: var(--accent-rose);
}

.controls-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn:hover {
  background: var(--bg-subtle);
  border-color: var(--border-subtle);
}

.btn-primary {
  background: var(--accent-sky);
  color: white;
  border-color: var(--accent-sky-dark);
}

.btn-primary:hover {
  background: var(--accent-sky-dark);
}

.btn-mint {
  background: var(--accent-mint);
  color: white;
  border-color: var(--accent-mint-dark);
}

.btn-mint:hover {
  background: var(--accent-mint-dark);
}

.speed-group {
  display: flex;
  background: var(--bg-subtle);
  border-radius: 6px;
  padding: 2px;
  border: 1px solid var(--border-light);
}

.speed-btn {
  background: transparent;
  border: none;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
}

.speed-btn.active {
  background: var(--bg-surface);
  color: var(--accent-sky-dark);
  box-shadow: var(--shadow-sm);
}

/* Main Workspace Viewport */
.main-viewport {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Canvas Map Area */
.map-container {
  flex: 1;
  height: 100%;
  position: relative;
  background: #EFF6FF;
}

#worldMapCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.map-floating-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

.map-control-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  color: var(--text-main);
  font-size: 1rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-control-btn:hover {
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

/* Bottom / Docked Tycoon Drawer */
.tycoon-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 15;
  transition: height 0.25s ease;
  height: 340px;
}

.tycoon-drawer.collapsed {
  height: 44px;
}

.drawer-tabs {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  padding: 0 16px;
  gap: 4px;
  height: 44px;
}

.drawer-tab {
  background: transparent;
  border: none;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-tab:hover {
  color: var(--text-main);
}

.drawer-tab.active {
  color: var(--accent-sky);
  border-bottom-color: var(--accent-sky);
  background: var(--bg-surface);
}

.drawer-toggle-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  background: var(--bg-surface);
}

/* Panel Layouts */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card:hover {
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-md);
}

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

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meter-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.meter-fill {
  height: 100%;
  background: var(--accent-mint);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.meter-fill.warning {
  background: var(--accent-amber);
}

.meter-fill.danger {
  background: var(--accent-rose);
}

/* Modal Overlay & Dialogs */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: var(--bg-surface);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
}

.modal-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.modal-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-subtle);
}

/* Era Newspaper Chronicle Styling */
.newspaper-banner {
  background: #FFFBEB;
  border: 2px solid #FDE68A;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.newspaper-headline {
  font-family: Georgia, serif;
  font-size: 1.25rem;
  font-weight: bold;
  color: #78350F;
  margin-bottom: 6px;
}

.newspaper-sub {
  font-size: 0.85rem;
  color: #92400E;
}

/* Livery Preview Card Grid */
.livery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.livery-option-card {
  border: 2px solid var(--border-light);
  border-radius: 8px;
  padding: 12px;
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.livery-option-card:hover {
  border-color: var(--accent-sky);
  box-shadow: var(--shadow-md);
}

.livery-option-card.selected {
  border-color: var(--accent-sky);
  background: var(--accent-sky-light);
}

/* Start Game Screen */
#startScreen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 50%, #ECFDF5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.start-dialog {
  background: var(--bg-surface);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  max-width: 680px;
  width: 100%;
  max-height: 94vh;
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.start-header {
  text-align: center;
}

.start-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent-sky-dark);
  letter-spacing: -0.5px;
}

.start-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .form-select {
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text-main);
  background: var(--bg-surface);
  outline: none;
  transition: border-color 0.15s ease;
  cursor: pointer;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-sky);
}

.suggested-names-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.name-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.name-pill:hover {
  background: var(--accent-sky-light);
  color: var(--accent-sky-dark);
  border-color: var(--accent-sky);
}

.startup-livery-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-subtle);
}

/* News Notification Toast */
.news-toast {
  position: absolute;
  top: 70px;
  left: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent-sky);
  box-shadow: var(--shadow-lg);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  max-width: 380px;
  z-index: 50;
  animation: fadeInToast 0.3s ease;
  pointer-events: none;
}

@keyframes fadeInToast {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* New Aircraft Available Toast - Bottom Left Corner above Dashboard */
.new-aircraft-toast {
  position: absolute;
  bottom: 355px;
  left: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent-mint);
  box-shadow: var(--shadow-xl);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  max-width: 360px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: slideUpToast 0.3s ease;
  transition: bottom 0.25s ease;
}

.new-aircraft-toast.drawer-collapsed {
  bottom: 58px;
}

@keyframes slideUpToast {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Unassigned Plane Card Highlight */
.card.unassigned-plane {
  border: 2px solid var(--accent-amber);
  background: #FFFDF7;
}

/* ========================================== */
/* HOMEPAGE VIEW STYLING                      */
/* ========================================== */
.homepage-view {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #F0F4F8 0%, #E2E8F0 100%);
  z-index: 100;
  overflow-y: auto;
}

.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-brand-icon {
  font-size: 1.8rem;
}

.home-brand-text {
  display: flex;
  flex-direction: column;
}

.home-brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-sky);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.home-brand-tagline {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}

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

.user-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: var(--accent-sky-light);
  color: var(--accent-sky-dark);
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.86rem;
  border: 1px solid #BAE6FD;
}

.dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.btn-icon-dots {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 4px 10px;
  border-radius: 6px;
  line-height: 1;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  min-width: 190px;
  padding: 6px 0;
  z-index: 250;
  display: flex;
  flex-direction: column;
  animation: fadeInToast 0.15s ease;
}

.dropdown-item {
  background: none;
  border: none;
  padding: 10px 16px;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background: var(--bg-subtle);
  color: var(--accent-sky);
}

.dropdown-item.dropdown-danger:hover {
  background: var(--accent-rose-light);
  color: var(--accent-rose);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

.home-hero-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

.hero-inner-card {
  max-width: 860px;
  width: 100%;
  background: var(--bg-surface);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-banner-wrapper {
  position: relative;
  width: 100%;
  max-height: 380px;
  overflow: hidden;
  background: #0F172A;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-banner-img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.4s ease;
}

.hero-banner-wrapper:hover .hero-banner-img {
  transform: scale(1.02);
}

.hero-banner-badge {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background: rgba(15, 23, 42, 0.75);
  color: #F8FAFC;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
  letter-spacing: 0.5px;
}

.hero-actions {
  padding: 26px 24px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 580px;
}

.hero-game-title {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--text-main);
  line-height: 1.1;
}

.hero-description {
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.btn-hero-play {
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
  color: white;
  border: none;
  font-size: 1.35rem;
  font-weight: 800;
  padding: 13px 48px;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.35);
  transition: all 0.2s ease;
  margin: 6px 0;
}

.btn-hero-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(2, 132, 199, 0.45);
  background: linear-gradient(135deg, #0369A1 0%, #075985 100%);
}

.btn-hero-play:active {
  transform: translateY(0);
}

.play-icon {
  font-size: 1.1rem;
}

.hero-status-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ========================================== */
/* AUTH & SAVES MODAL STYLING                 */
/* ========================================== */
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 12px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-tab:hover {
  color: var(--accent-sky);
}

.auth-tab.active {
  color: var(--accent-sky);
  border-bottom-color: var(--accent-sky);
}

.form-feedback {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  margin-top: 10px;
  font-weight: 600;
}

.form-feedback.error {
  background: var(--accent-rose-light);
  color: var(--accent-rose);
  border: 1px solid #FECACA;
}

.form-feedback.success {
  background: var(--accent-mint-light);
  color: var(--accent-mint-dark);
  border: 1px solid #A7F3D0;
}

/* Saved Worlds Slots */
.saved-worlds-slots {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.world-slot-card {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 18px;
  background: var(--bg-surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: all 0.15s ease;
}

.world-slot-card:hover {
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.world-slot-card.empty-slot {
  border: 1.5px dashed var(--border-subtle);
  background: var(--bg-subtle);
}

.slot-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slot-airline-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.slot-date-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-sky);
}

.slot-metrics {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.slot-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

