/* ============================================
   UX ENHANCEMENTS — Accessibility, Polish, Performance
   Layered on top of existing styles
   ============================================ */

/* ===== 1. ACCESSIBILITY: Focus States ===== */
*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Remove outline for mouse clicks, keep for keyboard */
*:focus:not(:focus-visible) {
  outline: none;
}

/* Specific focus overrides for inputs */
#sinp:focus-visible,
#em-email:focus-visible {
  outline: none; /* Already has border-color change */
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

/* Focus for buttons */
.cb:focus-visible,
.nav-link:focus-visible,
.st-btn:focus-visible,
.fw-tab:focus-visible,
.tl-filter-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

/* ===== 2. ACCESSIBILITY: Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .conflict-pulse { animation: none; }
  .lp { animation: none; opacity: 0.5; }
}

/* ===== 3. TOUCH TARGETS: Minimum 44px ===== */
#hbtn {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.ph-x {
  width: 32px;
  height: 32px;
  min-width: 32px;
  font-size: 16px;
}

.ph-back {
  min-height: 32px;
  padding: 4px 10px;
}

/* Expand click area on nav links */
.nav-link {
  padding: 6px 12px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

/* Ensure slider thumb is large enough */
.rf-slider-wrap input[type="range"]::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
}
.rf-slider-wrap input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
}

/* Sector range thumb */
.sector-range::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
}
.sector-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
}

/* Timeline filter buttons */
.tl-filter-btn {
  padding: 5px 10px;
  min-height: 28px;
}

/* Framework tabs */
.fw-tab {
  padding: 5px 10px;
  min-height: 28px;
}

/* ===== 4. DARK MODE GLOW & DEPTH ===== */

/* Subtle glow on primary text elements */
.logo {
  text-shadow: 0 0 20px rgba(245, 166, 35, 0.15);
}

/* Card depth with subtle border glow on hover */
.sc:hover,
.ov-card:hover,
.cii-comp:hover {
  border-color: rgba(245, 166, 35, 0.2);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.04);
}

/* NPS score glow */
.ns-nps,
.cii-score {
  text-shadow: 0 0 30px currentColor;
}

.nps-big {
  text-shadow: 0 0 40px currentColor;
}

/* Conflict list items - improved hover */
.conflict-item:hover {
  border-color: rgba(245, 166, 35, 0.25);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  transform: translateX(2px);
}
.conflict-item {
  transition: all 0.2s ease;
}

/* Panel header subtle depth */
.ph {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* Submit button glow */
.rf-submit:hover:not(:disabled),
.em-submit:hover,
.sector-btn:hover:not(:disabled),
.deep-dive-btn:hover {
  box-shadow: 0 4px 20px rgba(245, 166, 35, 0.25), 0 0 40px rgba(245, 166, 35, 0.08);
}

/* Global bar subtle top-border glow */
#gbar {
  box-shadow: 0 1px 0 rgba(245, 166, 35, 0.05);
}

/* ===== 5. IMPROVED CARD TRANSITIONS ===== */

.sc,
.ov-card,
.cii-comp,
.sector-inline,
.ss-sector,
.cn-item {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Actor group header accent */
.tac-actor-header {
  transition: background 0.2s ease;
}
.tac-actor-header:hover {
  background: var(--hover);
}

/* News item hover refinement */
.cn-item {
  border-radius: 4px;
}
.cn-item:hover {
  margin: 0 -8px;
  padding: 6px 8px;
  border-radius: 4px;
}

/* Key insight box glow */
.fw-key-insight {
  box-shadow: inset 0 0 16px rgba(245, 166, 35, 0.03);
}

/* ===== 6. TYPOGRAPHY REFINEMENTS ===== */

/* Minimum readable size: bump 7px labels to 8px */
.ns-lbl,
.sector-range-labels,
.ss-source {
  font-size: 8px;
}

/* Improve body text line-height */
.fw-body,
.ov-desc,
.tac-action-desc {
  line-height: 1.6;
}

/* Panel section labels - slightly more visible */
.psl {
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--t3);
}

/* ===== 7. SMOOTH SCROLL IN PANELS ===== */
#panel {
  scroll-behavior: smooth;
}

/* ===== 8. SELECTION STYLE ===== */
::selection {
  background: rgba(245, 166, 35, 0.25);
  color: var(--t1);
}

/* ===== 9. SCROLLBAR STYLING (unified) ===== */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--t3);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ===== 10. LOADING SKELETON ===== */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--card) 25%, var(--hover) 50%, var(--card) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

/* ===== 11. CURSOR POINTER on all clickable elements ===== */
.conflict-item,
.ri,
.ss-sector-header,
.cn-item,
.tac-actor-header,
.si,
#nps-toggle,
#legend,
.ov-party {
  cursor: pointer;
}

/* ===== 12. TIER DISCLAIMER ANIMATION ===== */
.tier-disclaimer {
  animation: fadeSlideIn 0.3s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
