/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

.copy-config-button:hover {
  background-color: rgb(237 233 254);
}

.dark .copy-config-button:hover {
  background-color: rgb(34 211 238 / 0.1);
}

.aircraft-artwork-svg-preview {
  background-color: #fff;
}

.artwork-svg-viewport {
  position: relative;
  width: 100%;
  height: 18rem;
  overflow: hidden;
  border-radius: 0.75rem;
}

.artwork-svg-viewport:focus-visible {
  outline: 2px solid #8b5cf6;
  outline-offset: 3px;
}

.artwork-submission-preview {
  height: 14rem;
}

.artwork-svg-can-pan {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.artwork-svg-panning {
  cursor: grabbing;
}

.artwork-svg-image {
  display: block;
  width: 100%;
  height: 100%;
  padding: 1rem;
  object-fit: contain;
  transform-origin: center;
  pointer-events: none;
  user-select: none;
}

.artwork-svg-image[hidden], .artwork-svg-error[hidden] {
  display: none;
}

.artwork-svg-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  font-weight: 600;
}

.artwork-comparison-glb {
  width: 100%;
  max-width: 72rem;
  padding: 1rem clamp(0.75rem, 2vw, 1.5rem);
}

.artwork-comparison-glb > .grid {
  margin-top: 0.75rem;
  gap: 0.75rem;
}

.artwork-comparison-glb article {
  min-width: 0;
  padding: 0.5rem 0.75rem;
  overflow-wrap: anywhere;
}

.artwork-comparison-viewer {
  width: 100%;
  height: var(--artwork-viewer-height, clamp(6rem, 24vh, 16rem));
  height: var(--artwork-viewer-height, clamp(6rem, 24svh, 16rem));
}

.setup-code-box {
  border-color: rgb(15 23 42 / 0.1);
  background-color: rgb(241 245 249);
  color: rgb(21 94 117);
}

.dark .setup-code-box {
  border-color: rgb(255 255 255 / 0.1);
  background-color: rgb(2 6 23);
  color: rgb(165 243 252);
}

/* Keep leaderboard scrolling functional even before Tailwind's dev watcher has
 * rebuilt newly introduced utility classes. Mirrors the SkyStats table shell. */
.leaderboard-table-scroll {
  height: 65vh;
  min-height: 32rem;
  max-height: 720px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.leaderboard-table thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgb(15 23 42 / 0.1);
  background: rgb(248 250 252);
  color: rgb(100 116 139);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1rem;
  text-transform: uppercase;
  user-select: none;
  white-space: nowrap;
}

.dark .leaderboard-table thead th {
  border-color: rgb(255 255 255 / 0.1);
  background: rgb(15 18 25);
  color: rgb(107 114 128);
}

.leaderboard-table thead th.is-active,
.leaderboard-table tbody td.is-active {
  color: rgb(124 58 237);
}

.dark .leaderboard-table thead th.is-active,
.dark .leaderboard-table tbody td.is-active {
  color: rgb(34 211 238);
}

.leaderboard-table th.leaderboard-sort-header {
  padding: 0;
}

.leaderboard-sort-header a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  padding: 0.7rem 1rem;
  color: inherit;
  text-decoration: none;
}

/* Long reference tables scroll inside their frame; the sticky header stays put. */
.catalog-table-scroll {
  max-height: 65vh;
  overflow: auto;
  scrollbar-gutter: stable;
}

.leaderboard-sort-header--start a {
  justify-content: flex-start;
}

.leaderboard-sort-header:hover,
.leaderboard-sort-header.is-active {
  color: rgb(124 58 237);
}

.leaderboard-table thead th.leaderboard-sort-header.is-active {
  background: rgb(237 233 254);
  box-shadow: inset 0 0 0 1px rgb(124 58 237 / 0.25);
}

.dark .leaderboard-table thead th.leaderboard-sort-header:hover,
.dark .leaderboard-table thead th.leaderboard-sort-header.is-active {
  color: rgb(34 211 238);
}

.dark .leaderboard-table thead th.leaderboard-sort-header.is-active {
  /* Sticky headers must be opaque or scrolling rows show through them. */
  background: rgb(17 37 46);
  box-shadow: inset 0 0 0 1px rgb(34 211 238 / 0.3);
}

.leaderboard-sort-header .sort-arrow {
  font-size: 0.65rem;
  opacity: 0.3;
}

.leaderboard-sort-header.is-active .sort-arrow {
  opacity: 1;
}

.leaderboard-table td {
  padding: 0.65rem 1rem;
  vertical-align: middle;
}

.leaderboard-table tbody td:nth-child(n + 3) {
  color: rgb(100 116 139);
  font-size: 0.9375rem;
}

.dark .leaderboard-table tbody td:nth-child(n + 3) {
  color: rgb(156 163 175);
}

.product-map-tooltip .maplibregl-popup-content {
  border: 1px solid rgb(15 23 42 / 0.15);
  border-radius: 0.5rem;
  background: white;
  color: rgb(15 23 42);
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  box-shadow: 0 10px 25px rgb(15 23 42 / 0.2);
}

.dark .product-map-tooltip .maplibregl-popup-content {
  border-color: rgb(255 255 255 / 0.2);
  background: rgb(2 6 23);
  color: white;
  box-shadow: 0 10px 25px rgb(0 0 0 / 0.5);
}

.product-map-tooltip .maplibregl-popup-tip { display: none; }

.leaderboard-table tbody td:nth-child(2) > span:first-child {
  font-size: 1rem;
}

.leaderboard-table tbody td:nth-child(2) > span:not(:first-child) {
  font-size: 0.8125rem;
}

.leaderboard-table tbody td:nth-child(n + 3) > span {
  font-size: 0.8125rem;
}

.leaderboard-table tbody tr:last-child td {
  border-bottom: 0;
}

.leaderboard-table tbody td.is-active {
  color: rgb(109 40 217);
  font-size: 1.125rem;
  font-weight: 900;
}

.dark .leaderboard-table tbody td.is-active {
  color: rgb(103 232 249);
}

.leaderboard-table tbody td.is-active > span {
  color: rgb(100 116 139);
  font-size: 0.75rem;
  font-weight: 400;
}

.leaderboard-history-select {
  height: 2rem;
  min-height: 2rem;
  line-height: 1.25rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.rankings-transition-viewport {
  position: relative;
  overflow-anchor: none;
}
turbo-frame#feeder-rankings { position: relative; z-index: 2; display: block; }

.feeder-podium--outgoing {
  position: absolute;
  z-index: 3;
  margin: 0;
  pointer-events: none;
  opacity: 1;
  transition: opacity 500ms ease;
  will-change: opacity;
}
.feeder-podium--outgoing.is-fading-out { opacity: 0; }
.feeder-podium--outgoing .podium-card__content::after {
  animation: none;
  rotate: var(--podium-radar-rotation, 0deg);
}
.feeder-podium--incoming {
  opacity: 0;
  transition: opacity 500ms ease;
  will-change: opacity;
}
.feeder-podium--incoming.is-fading-in { opacity: 1; }

.podium-card {
  --podium-radar-dot: color-mix(in srgb, var(--podium-color) 72%, #334155);
  position: relative;
  padding: 2px 2px 1.5rem;
  border-radius: 1.65rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--podium-color) 20%, white), color-mix(in srgb, var(--podium-color) 30%, #070b14) 35%, var(--podium-color));
  box-shadow: 0 12px 32px color-mix(in srgb, var(--podium-color) 28%, transparent);
  transform: perspective(900px) rotateX(var(--hover-rotate-x, 0deg)) rotateY(var(--hover-rotate-y, 0deg));
  /* Composite the filtered aircraft with the card before tilting it. */
  transform-style: flat;
  transition: transform 160ms ease-out, box-shadow 200ms ease;
}

.dark .podium-card { --podium-radar-dot: color-mix(in srgb, var(--podium-color) 35%, white); }
.podium-card:hover { box-shadow: 0 22px 44px rgb(2 6 23 / 38%), 0 0 36px color-mix(in srgb, var(--podium-color) 48%, transparent); }

.podium-card__content { position: relative; isolation: isolate; height: 100%; overflow: hidden; border-radius: 1.5rem; padding: 1.5rem 1.5rem 2rem; background: linear-gradient(145deg, color-mix(in srgb, var(--podium-color) 12%, white), white 48%); }
.dark .podium-card__content { background: linear-gradient(145deg, color-mix(in srgb, var(--podium-color) 12%, rgb(15 18 25)), rgb(15 18 25) 55%); }
.podium-card__content::before,
.podium-card__content::after { content: ""; position: absolute; z-index: 0; pointer-events: none; }
.podium-card__content::before { inset: 0; opacity: .54; background-image: repeating-radial-gradient(circle at 78% 28%, transparent 0 24px, color-mix(in srgb, var(--podium-color) 18%, transparent) 25px 26px, transparent 27px 43px), repeating-conic-gradient(from 0deg at 78% 28%, color-mix(in srgb, var(--podium-color) 16%, transparent) 0 1deg, transparent 1deg 28deg), radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--podium-color) 40%, transparent), transparent 32%), radial-gradient(circle, var(--podium-radar-dot) 0 1px, transparent 1.5px); background-size: 100% 100%, 100% 100%, 100% 100%, 43px 47px; }
.podium-card__content::after { top: 28%; left: 78%; width: 720px; height: 720px; translate: -50% -50%; border-radius: 50%; background: conic-gradient(from -35deg, transparent 0 78%, color-mix(in srgb, var(--podium-color) 28%, transparent) 86%, transparent 94%); transform-origin: center; animation: podium-radar-sweep 7s linear infinite; }
.podium-card__content > * { position: relative; z-index: 1; }
.podium-card--1 { --podium-color: #eab308; }
.podium-card--2 { --podium-color: #94a3b8; }
.podium-card--3 { --podium-color: #c26d35; }
.podium-card__art { display: flex; min-height: 6rem; align-items: center; justify-content: center; color: var(--podium-color); }
.podium-card__aircraft { display: block; width: 10rem; height: 8rem; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--podium-color) 60%, transparent)); }
.podium-card--2 .podium-card__aircraft { transform: scaleX(-1) rotate(-45deg); }
.podium-card--3 .podium-card__aircraft { transform: rotate(-45deg); }
.podium-card__aircraft svg { width: 100%; height: 100%; }
.podium-card__rank { position: absolute; z-index: 2; bottom: 4px; left: 50%; min-width: 5rem; transform: translateX(-50%); border: 2px solid var(--podium-color); border-radius: 999px; background: #fff; padding: 0.2rem 0.8rem; box-shadow: inset 0 1px 0 rgb(255 255 255 / 35%), 0 0 10px color-mix(in srgb, var(--podium-color) 45%, transparent); color: var(--podium-color); text-align: center; font-size: 0.75rem; font-weight: 900; }
.dark .podium-card__rank { background: #0c111a; box-shadow: inset 0 1px 0 rgb(255 255 255 / 10%), 0 0 10px color-mix(in srgb, var(--podium-color) 45%, transparent); }

@keyframes podium-radar-sweep { to { rotate: 360deg; } }

@media (max-width: 639px) {
  .podium-slot--1 { order: 1; }
  .podium-slot--2 { order: 2; }
  .podium-slot--3 { order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  .feeder-podium--outgoing,
  .feeder-podium--incoming { transition: none; }
  .podium-card { transform: none; transition: none; }
  .podium-card__content::after { animation: none; }
}
