/* css/style.css - MSFS 2024 Aviation Flight Manual Styles */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "Courier New", monospace;
  
  /* Glass Cockpit Dark Mode (Default) */
  --bg-primary: #0b0f17;
  --bg-secondary: #121824;
  --bg-card: rgba(22, 30, 46, 0.75);
  --bg-card-hover: rgba(30, 41, 64, 0.85);
  --border-color: rgba(56, 189, 248, 0.15);
  --border-focus: #38bdf8;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Aviation Instrument Colors */
  --accent-cyan: #38bdf8;      /* Garmin / Glass PFD */
  --accent-blue: #3b82f6;      /* Mode / Standard */
  --accent-amber: #f59e0b;     /* Boeing Warning / Caution */
  --accent-magenta: #ec4899;   /* Airbus Constraint / FMS */
  --accent-green: #10b981;     /* Ready / Active / Engaged */
  --accent-purple: #8b5cf6;    /* Navigation / NAVAID */
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --border-color: rgba(203, 213, 225, 0.8);
  --border-focus: #0284c7;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  
  --accent-cyan: #0284c7;
  --accent-blue: #2563eb;
  --accent-amber: #d97706;
  --accent-magenta: #db2777;
  --accent-green: #059669;
  --accent-purple: #7c3aed;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header & Top Bar */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(11, 15, 23, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

[data-theme="light"] .top-header {
  background-color: rgba(248, 250, 252, 0.94);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.brand-titles h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-source {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background-color: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Search Bar in Header - Cleaned without overlapping badges */
.search-container {
  flex: 1;
  max-width: 440px;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-dim);
  font-size: 0.95rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.55rem 2.2rem 0.55rem 2.4rem;
  border-radius: 9999px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.clear-search-btn {
  position: absolute;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.clear-search-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-main);
  transition: all 0.2s ease;
  user-select: none;
}

.btn-header:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #0284c7);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #0284c7);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4);
}

.btn-accent {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
}

.btn-accent:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

.btn-edit-active {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
  border: 1px solid #f59e0b !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35) !important;
}

/* Edit Mode Banner */
.edit-mode-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  animation: fadeIn 0.25s ease;
}

.edit-mode-banner-text {
  font-size: 0.85rem;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* App Main Layout */
.app-container {
  display: flex;
  flex: 1;
  max-width: 1720px;
  margin: 0 auto;
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: 275px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 61px;
  height: calc(100vh - 61px);
  overflow-y: auto;
}

.nav-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  padding: 0 0.5rem 0.4rem;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  font-weight: 600;
  border-left: 3px solid var(--accent-cyan);
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nav-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}

.nav-item.active .nav-badge {
  background-color: var(--accent-cyan);
  color: #0b0f17;
  font-weight: 700;
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 1.5rem 2rem 3rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Category Filter Bar / Tabs */
.subnav-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  scrollbar-width: thin;
}

/* Aircraft filter: wrap buttons instead of horizontal scrolling */
.subnav-tabs.aircraft-wrap {
  flex-wrap: wrap;
  overflow-x: visible;
  overflow-y: visible;
  scrollbar-width: none;
}

.subnav-tabs.aircraft-wrap .tab-btn {
  flex: 0 0 auto;
}

.tab-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tab-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--text-main);
  background-color: var(--bg-card-hover);
}

.tab-btn.active {
  background-color: var(--accent-cyan);
  color: #0b0f17;
  border-color: var(--accent-cyan);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

/* Stats / Status Banner */
.status-banner {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.status-left h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.status-left p {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.status-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.stat-item {
  text-align: right;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}

.cards-grid.single-col {
  grid-template-columns: 1fr;
}

/* Standard Aviation Card */
.aviation-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.aviation-card:hover {
  background-color: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Card Badges */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-title-code {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-size: 1.15rem;
  font-weight: 700;
}

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

.card-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-airbus {
  background-color: rgba(236, 72, 153, 0.15);
  color: var(--accent-magenta);
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.badge-boeing {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-ga {
  background-color: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-procedure {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-custom {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Card Body & Content */
.card-body {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.65;
  white-space: pre-line;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.card-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-item {
  font-size: 0.72rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
}

/* Action Buttons on Card */
.card-actions-wrapper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--accent-cyan);
}

.edit-btn {
  color: #fbbf24 !important;
}

.edit-btn:hover {
  background-color: rgba(245, 158, 11, 0.15) !important;
  color: #f59e0b !important;
}

.delete-btn {
  color: #f87171 !important;
}

.delete-btn:hover {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
}

/* Image preview in cards */
.card-image-box {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin-top: 0.5rem;
  position: relative;
  cursor: zoom-in;
  background-color: #000;
}

.card-image-box img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.25s ease;
}

.card-image-box:hover img {
  transform: scale(1.02);
}

.card-image-caption {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.4rem 0.6rem;
  background-color: rgba(0, 0, 0, 0.75);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

/* Code & Keybinding styling */
kbd {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  color: var(--accent-cyan);
  white-space: nowrap;
}

.path-box {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  word-break: break-all;
}

/* Highlighting Search Matches */
mark.search-highlight {
  background-color: rgba(245, 158, 11, 0.35);
  color: #fff;
  border-radius: 2px;
  padding: 0 0.15rem;
}

/* Modal Dialogs */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal-container {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-body {
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: rgba(0, 0, 0, 0.15);
}

/* Forms in Modal */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.form-textarea {
  min-height: 110px;
  resize: vertical;
}

/* Converter Widget Grid */
.converter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.converter-box {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.converter-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
}

.converter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.converter-row label {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  width: 45px;
  color: var(--text-dim);
}

.converter-row input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* Image Lightbox Modal */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: var(--radius-md);
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.lightbox-caption {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: #fff;
  text-align: center;
}

.lightbox-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background-color: var(--bg-secondary);
  border: 1px solid var(--accent-cyan);
  color: var(--text-main);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideIn 0.25s ease forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

/* Responsive adjustments */
@media (max-width: 1024px) {
  .sidebar {
    width: 240px;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .top-header {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }
  .search-container {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .main-content {
    padding: 1rem;
  }
  .converter-grid {
    grid-template-columns: 1fr;
  }
}

/* MSFS2024_LAST_EDITED_LAYOUT_FIX */
/* MSFS2024_LAST_EDITED_LAYOUT_FIX */
.last-edited-time {
    display: block !important;
    flex: 0 0 100% !important;
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 0.55rem !important;
    padding-top: 0.45rem !important;
    border-top: 1px solid var(--border-color, rgba(128,128,128,0.22));
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
    font-weight: 400 !important;
    color: var(--text-dim) !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}
*:has(> .last-edited-time) {
    flex-wrap: wrap !important;
}



/* MSFS2024_EDITED_LABEL_STYLE */
.last-edited-label {
    color: var(--accent-color, #3b82f6) !important;
    font-weight: 700 !important;
    margin-right: 0.2rem;
}


/* Cross-browser aircraft filter wrapping fix */
.subnav-tabs.aircraft-wrap {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  align-content: flex-start;
  white-space: normal !important;
}

.subnav-tabs.aircraft-wrap .tab-btn {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  max-width: 100%;
  box-sizing: border-box;
}
/* End cross-browser aircraft filter wrapping fix */


/* MSFS2024_MOBILE_AIRCRAFT_WRAP_FIX_V2 */
#subnavTabs.aircraft-wrap {
    display: flex !important;
    flex-flow: row wrap !important;
    align-items: flex-start !important;
    align-content: flex-start !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: normal !important;
    box-sizing: border-box !important;
}

#subnavTabs.aircraft-wrap > .tab-btn {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

/* 手机端再次明确允许筛选按钮分行 */
@media (max-width: 768px) {
    #subnavTabs.aircraft-wrap {
        width: 100% !important;
        min-width: 0 !important;
        flex-wrap: wrap !important;
        overflow: visible !important;
    }

    #subnavTabs.aircraft-wrap > .tab-btn {
        flex-shrink: 0 !important;
    }
}
/* END MSFS2024_MOBILE_AIRCRAFT_WRAP_FIX_V2 */
