/*
 * 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.
 */

/* Bite Compass custom polish */
.now-pulse {
  animation: bitecastPulseOpacity 2.2s ease-in-out infinite;
}

@keyframes bitecastPulseOpacity {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.6; }
}

@media (prefers-reduced-motion: reduce) {
  .now-pulse { animation: none; opacity: 0.45; }
}

/* Share sheet */
.share-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0);
  transition: background 200ms ease;
  pointer-events: none;
}

.share-sheet-backdrop.open {
  background: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.share-sheet-panel {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 51;
  transition: transform 200ms ease;
  pointer-events: none;
  /* Mobile: slide up from bottom */
  bottom: 0;
  transform: translateY(100%);
}

.share-sheet-panel.open {
  transform: translateY(0);
  pointer-events: auto;
}

/* Desktop: center vertically instead of anchoring to bottom */
@media (min-width: 768px) {
  .share-sheet-panel {
    bottom: auto;
    top: 50%;
    transform: translateY(-50%) scale(0.95);
    opacity: 0;
    transition: transform 200ms ease, opacity 200ms ease;
  }

  .share-sheet-panel.open {
    transform: translateY(-50%) scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .share-sheet-backdrop,
  .share-sheet-panel {
    transition: none;
  }
}

/* Article body — rendered markdown */
.article-body h1 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  color: #e8e5df;
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.article-body h2 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: #e8e5df;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-body h3 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #e8e5df;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.article-body p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #c4a57b;
  margin-bottom: 1rem;
}

.article-body a {
  color: #ff5722;
  text-decoration: none;
}

.article-body a:hover {
  text-decoration: underline;
}

.article-body ul,
.article-body ol {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #c4a57b;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.25rem;
}

.article-body hr {
  border: none;
  border-top: 1px solid rgba(196, 165, 123, 0.12);
  margin: 2rem 0;
}

.article-body strong {
  color: #e8e5df;
  font-weight: 600;
}

/* Rig builder scene */
.rig-scene { display: inline-block; width: 100%; max-width: 440px; }
.rig-scene > svg { display: block; width: 100%; height: auto; }

/* Rig card thumbnails — small (cross-link cards) and large (/rigs index). */
.rig-card-preview { width: 72px; }
.rig-card-preview > svg { display: block; width: 100%; height: auto; }
.rig-index-preview { width: 110px; }
.rig-index-preview > svg { display: block; width: 100%; height: auto; }

.rig-scene [data-component-type="hook"],
.rig-scene [data-component-type="bait"],
.rig-scene [data-component-type="leader"] {
  transform-origin: 50% 0%;
  animation: rig-sway 4s ease-in-out infinite;
}

@keyframes rig-sway {
  0%, 100% { transform: rotate(-0.5deg) translateX(-1px); }
  50%      { transform: rotate(0.5deg)  translateX(1px); }
}

.rig-scene [data-component-index][role="button"] { cursor: pointer; }

.rig-scene [data-component-index][role="button"]:hover {
  filter: drop-shadow(0 0 4px rgba(255, 200, 80, 0.45));
}

.rig-scene [data-component-index][tabindex]:focus,
.rig-scene [data-component-index][data-active="true"] {
  outline: none;
  filter: drop-shadow(0 0 6px rgba(255, 200, 80, 0.85));
}

.rig-scene [data-component-index][data-active="true"]:not([data-component-type="hook"]):not([data-component-type="bait"]):not([data-component-type="leader"]) {
  transform: scale(1.08);
  transform-origin: 50% 50%;
  transition: transform 180ms ease-out;
}

.rig-scene[data-tap-hint="true"] [data-component-index][role="button"]:not([data-component-type="hook"]):not([data-component-type="bait"]):not([data-component-type="leader"]) {
  animation: rig-tap-hint 2.4s ease-in-out 3;
}

.rig-scene .rig-slot { cursor: pointer; opacity: 0.55; transition: opacity 160ms ease-out; }
.rig-scene .rig-slot:hover,
.rig-scene .rig-slot:focus { opacity: 1; outline: none; }

[data-rig-builder-target="anatomyItem"] { transition: background 200ms ease-out, border-color 200ms ease-out; }
[data-rig-builder-target="anatomyItem"][data-active="true"] {
  border-left-color: rgba(255, 200, 80, 0.75) !important;
  background: rgba(255, 200, 80, 0.06);
}

@keyframes rig-tap-hint {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 200, 80, 0)); }
  50%      { filter: drop-shadow(0 0 5px rgba(255, 200, 80, 0.55)); }
}

@media (prefers-reduced-motion: reduce) {
  .rig-scene [data-component-type] { animation: none !important; }
  .rig-scene[data-tap-hint="true"] [data-component-index][role="button"] { animation: none !important; }
  .rig-scene [data-component-index][data-active="true"] { transition: none !important; }
}
