/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* flyPIREP - Aviation-Inspired Design System with Light/Dark Themes */

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

/* Light Theme (Default) */
:root {
  /* Background colors - light theme with subtle blue tint */
  --bg-primary: #fafbfc;
  --bg-secondary: #f5f7fa;
  --bg-tertiary: #eef2f7;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;

  /* Text colors - light theme */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-muted: #94a3b8;

  /* Border colors - light theme with subtle borders */
  --border-primary: #e2e8f0;
  --border-secondary: #cbd5e1;
  --border-focus: rgba(14, 165, 233, 0.4);

  /* Aviation blue accents */
  --color-sky-600: #0284c7;
  --color-sky-500: #0ea5e9;
  --color-sky-400: #38bdf8;
  --color-sky-300: #7dd3fc;
  --color-sky-200: #bae6fd;

  /* Instrument amber/gold */
  --color-amber-600: #d97706;
  --color-amber-500: #f59e0b;
  --color-amber-400: #fbbf24;
  --color-amber-300: #fcd34d;

  /* Neutral grays */
  --color-slate-900: #0f172a;
  --color-slate-800: #1e293b;
  --color-slate-700: #334155;
  --color-slate-600: #475569;
  --color-slate-500: #64748b;
  --color-slate-400: #94a3b8;
  --color-slate-300: #cbd5e1;
  --color-slate-200: #e2e8f0;
  --color-slate-100: #f1f5f9;
  --color-slate-50: #f8fafc;

  /* Status colors */
  --color-success: #10b981;
  --color-success-light: #d1fae5;
  --color-warning: #f59e0b;
  --color-warning-light: #fef3c7;
  --color-error: #ef4444;
  --color-error-light: #fee2e2;

  /* Component-specific variables */
  --glass-header-bg: rgba(255, 255, 255, 0.95);
  --glass-header-border: rgba(14, 165, 233, 0.08);
  --hero-gradient-1: rgba(14, 165, 233, 0.06);
  --hero-gradient-2: rgba(245, 158, 11, 0.03);
  --hero-gradient-base: linear-gradient(180deg, #fafbfc, #f5f7fa);
  --grid-pattern-color: rgba(14, 165, 233, 0.02);
  --scrollbar-track: #f5f7fa;
  --scrollbar-thumb: #cbd5e1;
  --scrollbar-thumb-hover: #94a3b8;

  /* Typography */
  --font-display: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Spacing rhythm */
  --space-unit: 0.25rem;
}

/* Dark Theme */
.dark {
  /* Background colors - dark theme */
  --bg-primary: #0a0f1a;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;

  /* Text colors - dark theme */
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-muted: #64748b;

  /* Border colors - dark theme */
  --border-primary: rgba(255, 255, 255, 0.05);
  --border-secondary: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(14, 165, 233, 0.4);

  /* Component-specific variables - dark theme */
  --glass-header-bg: rgba(15, 23, 42, 0.85);
  --glass-header-border: rgba(255, 255, 255, 0.05);
  --hero-gradient-1: rgba(14, 165, 233, 0.12);
  --hero-gradient-2: rgba(245, 158, 11, 0.06);
  --hero-gradient-base: linear-gradient(180deg, #0a0f1a, #0f172a);
  --grid-pattern-color: rgba(51, 65, 85, 0.03);
  --scrollbar-track: #0f172a;
  --scrollbar-thumb: #475569;
  --scrollbar-thumb-hover: #64748b;

  /* Status colors get slightly brighter in dark mode */
  --color-success-light: rgba(16, 185, 129, 0.1);
  --color-warning-light: rgba(245, 158, 11, 0.1);
  --color-error-light: rgba(239, 68, 68, 0.1);
}

/* Base typography */
body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Override Tailwind text colors to use theme variables */
.text-white {
  color: var(--text-primary) !important;
}

/* Text on colored button/badge backgrounds must remain white regardless of theme.
   These cover: active sort pills (bg-blue-500), primary action buttons and nav
   monogram (bg-sky-500/600/700), notification count badges (bg-sky-600),
   gradient primary buttons (.btn-primary), and destructive/delete badges (bg-red-600). */
.bg-blue-500.text-white,
.bg-sky-500.text-white,
.bg-sky-600.text-white,
.bg-sky-700.text-white,
.bg-red-600.text-white,
.btn-primary.text-white {
  color: #ffffff !important;
}

.text-slate-50,
.text-slate-100 {
  color: var(--text-primary) !important;
}

.text-slate-200,
.text-slate-300 {
  color: var(--text-secondary) !important;
}

.text-slate-400 {
  color: var(--text-tertiary) !important;
}

.text-slate-500 {
  color: var(--text-muted) !important;
}

/* Emerald/green text — use a darker shade in light mode for readability.
   Follows the same theme-aware remapping pattern used for slate utilities above. */
.text-emerald-400 {
  color: #059669 !important; /* emerald-600 */
}
.dark .text-emerald-400 {
  color: #34d399 !important; /* emerald-400 original */
}

/* Override Tailwind background colors to use theme variables */
.bg-slate-800,
.bg-slate-900,
.bg-slate-950 {
  background-color: var(--bg-card) !important;
}

.bg-slate-800\/50 {
  background-color: var(--bg-card) !important;
  opacity: 0.9;
}

.bg-slate-800\/40,
.bg-slate-900\/50,
.bg-slate-900\/40 {
  background-color: var(--bg-card) !important;
  opacity: 0.85;
}

.bg-slate-800\/30,
.bg-slate-900\/30 {
  background-color: var(--bg-card) !important;
  opacity: 0.7;
}

.bg-slate-800\/20 {
  background-color: var(--bg-card) !important;
  opacity: 0.6;
}

.bg-slate-950\/50 {
  background-color: var(--bg-tertiary) !important;
  opacity: 0.9;
}

.bg-slate-700,
.bg-slate-600 {
  background-color: var(--bg-tertiary) !important;
}

.bg-slate-700\/50,
.bg-slate-700\/40,
.bg-slate-600\/60,
.bg-slate-600\/40 {
  background-color: var(--bg-tertiary) !important;
  opacity: 0.8;
}

.bg-slate-500,
.bg-slate-50 {
  background-color: var(--bg-secondary) !important;
}

/* Override border colors */
.border-slate-700,
.border-slate-600 {
  border-color: var(--border-primary) !important;
}

.border-slate-700\/50,
.border-slate-700\/30 {
  border-color: var(--border-primary) !important;
  opacity: 0.8;
}

.border-slate-500 {
  border-color: var(--border-secondary) !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
  50% { box-shadow: 0 0 20px 4px rgba(245, 158, 11, 0.15); }
}

@keyframes radar-sweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

.animate-slide-in {
  animation: slideIn 0.3s ease-out forwards;
}

/* Staggered animation delays for cards */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* Search input glow effect */
.search-input-glow:focus {
  box-shadow:
    0 0 0 3px rgba(14, 165, 233, 0.15),
    0 0 30px rgba(14, 165, 233, 0.1),
    0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Card hover effect */
.examiner-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.examiner-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow:
    0 20px 40px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px var(--border-secondary);
}

/* Rating stars */
.rating-star {
  color: var(--color-amber-400);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

/* Designation badges */
.badge-designation {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(14, 165, 233, 0.05));
  border: 1px solid rgba(14, 165, 233, 0.25);
  color: #0369a1;
}

.dark .badge-designation {
  color: var(--color-sky-300);
}

/* CSS tooltip for [data-tooltip] elements */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  font-size: 11px;
  font-family: ui-monospace, monospace;
  white-space: nowrap;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease;
  z-index: 50;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

[data-tooltip].tooltip-multiline::after {
  white-space: pre-line;
  text-align: left;
}

.badge-aircraft {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.12), rgba(148, 163, 184, 0.05));
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text-secondary);
}

/* Radar loader */
.radar-loader {
  width: 48px;
  height: 48px;
  position: relative;
}

.radar-loader::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--border-secondary);
  border-radius: 50%;
}

.radar-loader::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg, var(--color-amber-400), transparent);
  transform-origin: left center;
  animation: radar-sweep 1.5s linear infinite;
}

/* Background pattern - subtle grid */
.bg-aviation-grid {
  background-image:
    linear-gradient(var(--grid-pattern-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-pattern-color) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Hero gradient */
.hero-gradient {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--hero-gradient-1), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, var(--hero-gradient-2), transparent),
    var(--hero-gradient-base);
}

/* Glass effect for header */
.glass-header {
  background: var(--glass-header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-header-border);
}

/* Button styles */
.btn-primary {
  background: linear-gradient(135deg, var(--color-sky-500), var(--color-sky-600));
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-sky-400), var(--color-sky-500));
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* Notice/Alert refinements */
.notice-success {
  background: var(--color-success-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--text-primary);
}

.dark .notice-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
  color: #6ee7b7;
}

.notice-error {
  background: var(--color-error-light);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--text-primary);
}

.dark .notice-error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
  color: #fca5a5;
}

/* Filter tabs */
.filter-tab {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  transition: all 0.2s ease;
  cursor: pointer;
}

.filter-tab:hover {
  color: var(--text-secondary);
  background: var(--bg-card-hover);
  border-color: var(--border-secondary);
}

.filter-tab.active {
  color: var(--color-sky-400);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(14, 165, 233, 0.1));
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.15);
}

/* Modal scrolling - Safari fix */
.overflow-y-auto {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Scroll indicator fade at bottom of modal */
.modal-scroll-container {
  position: relative;
}

.modal-scroll-container::after {
  content: '';
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to top, var(--bg-card), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-scroll-container.has-overflow::after {
  opacity: 1;
}

/* Review highlight animation for deep-linking */
@keyframes review-flash {
  0%, 100% {
    background-color: var(--bg-tertiary);
  }
  50% {
    background-color: rgba(14, 165, 233, 0.3);
  }
}

.review-highlight {
  animation: review-flash 2s ease-in-out 3;
  scroll-margin-top: 100px;
}

/* Range input styling for Safari */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

/* Track styling */
input[type="range"]::-webkit-slider-runnable-track {
  height: 0.5rem;
  border-radius: 9999px;
  background: linear-gradient(to right, var(--color-sky-500) 0%, var(--color-sky-500) var(--range-progress, 50%), var(--border-secondary) var(--range-progress, 50%), var(--border-secondary) 100%);
}

input[type="range"]::-moz-range-track {
  height: 0.5rem;
  border-radius: 9999px;
  background: var(--border-secondary);
}

input[type="range"]::-moz-range-progress {
  height: 0.5rem;
  border-radius: 9999px;
  background: var(--color-sky-500);
}

/* Thumb styling */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--color-sky-500);
  border: 2px solid white;
  margin-top: -0.375rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--color-sky-500);
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

input[type="range"]:focus {
  outline: none;
}

input[type="range"]:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.3), 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Category badges for search results */
.badge-category-name {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #059669;
}
.dark .badge-category-name {
  color: rgb(110, 231, 183);
}

.badge-category-airport_code {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #d97706;
}
.dark .badge-category-airport_code {
  color: rgb(251, 191, 36);
}

.badge-category-city {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(14, 165, 233, 0.05));
  border: 1px solid rgba(14, 165, 233, 0.25);
  color: #0284c7;
}
.dark .badge-category-city {
  color: rgb(125, 211, 252);
}

.badge-category-fsdo {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: #7c3aed;
}
.dark .badge-category-fsdo {
  color: rgb(196, 181, 253);
}

.badge-category-designation {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #1d4ed8;
}
.dark .badge-category-designation {
  color: rgb(147, 197, 253);
}

.badge-category-aircraft {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.15), rgba(148, 163, 184, 0.05));
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #475569;
}
.dark .badge-category-aircraft {
  color: rgb(203, 213, 225);
}

.badge-category-state {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #4338ca;
}
.dark .badge-category-state {
  color: rgb(165, 180, 252);
}

.badge-category-general {
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.15), rgba(100, 116, 139, 0.05));
  border: 1px solid rgba(100, 116, 139, 0.25);
  color: #475569;
}
.dark .badge-category-general {
  color: rgb(148, 163, 184);
}

/* Modal backdrop - fixed positioning with solid background */
.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: rgba(2, 6, 23, 0.95);
  z-index: 99999;
  isolation: isolate;
  pointer-events: auto;
}

.modal-backdrop.hidden {
  display: none;
}

/* Modal content - ensure it's on top within the backdrop */
.modal-content {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  max-width: 42rem; /* max-w-2xl */
  max-height: 90vh;
}

/* Modal body should allow interaction */
.modal-scroll-container {
  overflow-y: auto;
  pointer-events: auto;
}

/* Ensure all buttons and interactive elements in modal are clickable */
.modal-content button,
.modal-content input,
.modal-content select,
.modal-content textarea,
.modal-content a,
.modal-content label {
  pointer-events: auto;
  position: relative;
  z-index: 1;
  cursor: pointer;
}

.modal-content button:disabled {
  cursor: not-allowed;
}

/* ============================================================
   Article Content — styles for Redcarpet-rendered markdown
   Needed because @tailwindcss/typography is not installed and
   Tailwind Preflight resets headings, lists, blockquotes, etc.
   ============================================================ */

.article-content { line-height: 1.75; }

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.75em;
  color: #0f172a; /* slate-900 */
}

.dark .article-content h1,
.dark .article-content h2,
.dark .article-content h3,
.dark .article-content h4,
.dark .article-content h5,
.dark .article-content h6 {
  color: #ffffff;
}

.article-content h1 { font-size: 2rem; }
.article-content h2 { font-size: 1.5rem; margin-top: 2.5em; }
.article-content h3 { font-size: 1.25rem; margin-top: 2em; }
.article-content h4 { font-size: 1.1rem; }

.article-content p {
  margin-bottom: 1.25em;
  color: #334155; /* slate-700 */
}

.dark .article-content p {
  color: #cbd5e1; /* slate-300 */
}

.article-content strong {
  font-weight: 600;
  color: #0f172a;
}

.dark .article-content strong {
  color: #ffffff;
}

.article-content em {
  font-style: italic;
}

.article-content a {
  color: #0284c7; /* sky-600 */
  text-decoration: underline;
}

.article-content a:hover {
  color: #0369a1; /* sky-700 */
}

.dark .article-content a {
  color: #38bdf8; /* sky-400 */
}

.dark .article-content a:hover {
  color: #7dd3fc; /* sky-300 */
}

.article-content blockquote {
  border-left: 4px solid #0ea5e9; /* sky-500 */
  padding: 0.5em 0 0.5em 1.25em;
  margin: 1.5em 0;
  color: #475569; /* slate-600 */
  font-style: italic;
}

.dark .article-content blockquote {
  color: #94a3b8; /* slate-400 */
}

.article-content ul {
  list-style-type: disc;
  padding-left: 1.75em;
  margin-bottom: 1.25em;
}

.article-content ol {
  list-style-type: decimal;
  padding-left: 1.75em;
  margin-bottom: 1.25em;
}

.article-content li {
  margin-bottom: 0.4em;
  color: #334155;
}

.dark .article-content li {
  color: #cbd5e1;
}

.article-content code {
  background: #f1f5f9; /* slate-100 */
  border-radius: 0.25rem;
  padding: 0.1em 0.4em;
  font-size: 0.875em;
  font-family: ui-monospace, monospace;
  color: #0f172a;
}

.dark .article-content code {
  background: #1e293b; /* slate-800 */
  color: #e2e8f0; /* slate-200 */
}

.article-content pre {
  background: #f8fafc; /* slate-50 */
  border: 1px solid #e2e8f0; /* slate-200 */
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5em;
}

.dark .article-content pre {
  background: #0f172a; /* slate-900 */
  border-color: #334155; /* slate-700 */
}

.article-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.article-content hr {
  border: none;
  border-top: 1px solid #e2e8f0; /* slate-200 */
  margin: 2.5em 0;
}

.dark .article-content hr {
  border-color: #334155; /* slate-700 */
}
