/* ═══════════════════════════════════════════════════════════════
   Intel HQ — Design Overhaul v2 (21st.dev-inspired)
   Layered on top of existing styles. Enhances:
   - Loading skeletons with shimmer
   - Signal card lift + depth on hover
   - Tab system with animated indicator
   - Stat cards with number animation
   - Empty states with character
   - Navigation polish (active glow, kbd hints)
   - Chart cards (gradient fills via JS hooks)
   - Signal pulse bar animation
   - Confidence meters
   - Transition timing consistency
   ═══════════════════════════════════════════════════════════════ */

/* ── SKELETON / LOADING SHIMMER ── */
@keyframes shimmer {
  0% { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card) 0px,
    rgba(255,255,255,0.04) 200px,
    var(--bg-card) 400px
  );
  background-size: 600px 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: 6px;
}

.skeleton-block {
  display: block;
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
}
.skeleton-block.wide { width: 85%; }
.skeleton-block.mid { width: 55%; }
.skeleton-block.short { width: 30%; }
.skeleton-block.tall { height: 80px; }

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 8px;
}

.skeleton-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.skeleton-stat .skeleton-num {
  width: 48px;
  height: 28px;
  border-radius: 4px;
}
.skeleton-stat .skeleton-lbl {
  width: 64px;
  height: 10px;
  border-radius: 3px;
}

/* ── ENHANCED LOADING SCREEN ── */
.hq-loading {
  flex-direction: column;
  gap: 0;
}

.loading-brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
  opacity: 0.8;
}

.loading-bar-track {
  width: 160px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 16px;
}

@keyframes loading-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

.loading-bar-fill {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: loading-sweep 1.4s ease-in-out infinite;
}

.loading-text {
  margin-top: 12px;
  animation: text-pulse 2s ease-in-out infinite;
}

@keyframes text-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ── TABS: ANIMATED INDICATOR ── */
.hq-tabs {
  position: relative;
  overflow: visible;
}

/* Smooth tab hover fill */
.hq-tab {
  position: relative;
  overflow: hidden;
}

.hq-tab::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-card2);
  border-radius: 7px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.hq-tab:hover::after {
  opacity: 1;
}

/* Active tab: stronger glow + top accent line */
.hq-tab.active {
  position: relative;
}

.hq-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 2px 2px;
  box-shadow: 0 0 8px rgba(57,255,20,0.5);
}

/* ── SIGNAL CARDS: DEPTH + GLOW ── */
.signal-card {
  position: relative;
  overflow: hidden;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.signal-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--border);
  transition: background 0.2s;
}

.signal-card:hover {
  transform: translateY(-2px) !important;
  border-color: rgba(57,255,20,0.2) !important;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25), 0 0 0 1px rgba(57,255,20,0.06) !important;
}

.signal-card:hover::before {
  background: var(--accent);
}

/* ── BRIEF CARDS: RICHER HOVER ── */
.brief-card {
  position: relative;
  overflow: hidden;
}

.brief-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.2s;
}

.brief-card:hover::after {
  background: rgba(57,255,20,0.4);
}

.brief-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2), 0 0 0 1px rgba(57,255,20,0.05) !important;
}

/* ── STAT CARDS: HOVER DEPTH ── */
.stat-card {
  position: relative;
  overflow: hidden;
  transition: all 0.2s !important;
  cursor: default;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(57,255,20,0.2), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.stat-card:hover {
  border-color: rgba(57,255,20,0.2) !important;
  box-shadow: 0 4px 16px rgba(57,255,20,0.04) !important;
  transform: translateY(-1px);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-value {
  transition: transform 0.3s;
}

.stat-card:hover .stat-value {
  transform: scale(1.05);
}

/* ── SIDEBAR CARDS: ENHANCED ── */
.sidebar-card {
  transition: border-color 0.2s;
}

.sidebar-card:hover {
  border-color: rgba(57,255,20,0.12);
}

/* Competitor sidebar items — stronger hover */
.hq-comp-sub-item {
  transition: all 0.18s !important;
}

.hq-comp-sub-item:hover {
  background: rgba(57,255,20,0.04) !important;
  border-color: rgba(57,255,20,0.12) !important;
  transform: translateX(2px);
}

/* ── SIGNAL PULSE BAR: ANIMATED SWEEP ── */
.signal-pulse-bar {
  position: relative;
  overflow: hidden;
}

@keyframes pulse-sweep {
  0% { transform: translateX(-100%); opacity: 0; }
  30% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateX(400%); opacity: 0; }
}

.signal-pulse-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(57,255,20,0.03) 50%, transparent 100%);
  animation: pulse-sweep 4s ease-in-out infinite;
  pointer-events: none;
}

.pulse-stat {
  transition: all 0.2s !important;
}

.pulse-stat:hover {
  background: rgba(57,255,20,0.04) !important;
  transform: translateY(-1px);
}

/* ── THE PLAY CARD: EXTRA DEPTH ── */
.sidebar-the-play {
  transition: all 0.22s !important;
}

.sidebar-the-play:hover {
  border-color: rgba(57,255,20,0.45) !important;
  box-shadow: 0 4px 24px rgba(57,255,20,0.08) !important;
  transform: translateY(-1px);
}

.demo-play-card {
  transition: all 0.22s !important;
}

/* ── CHART CARDS: POLISH ── */
.chart-card {
  transition: border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.chart-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  opacity: 0.4;
}

.chart-card:hover {
  border-color: rgba(57,255,20,0.15);
}

/* ── EMPTY STATES: MORE CHARACTER ── */
.empty-state {
  position: relative;
}

.empty-state .icon {
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ── FILTER PILLS: SMOOTHER ACTIVE ── */
.filter-pill {
  transition: all 0.15s !important;
  position: relative;
  overflow: hidden;
}

.filter-pill:hover {
  transform: translateY(-1px);
}

.filter-pill.active {
  box-shadow: 0 0 12px rgba(57,255,20,0.08) !important;
}

/* ── SEARCH INPUT: ENHANCED FOCUS ── */
.search-input:focus {
  box-shadow: 0 0 0 3px rgba(57,255,20,0.06) !important;
}

/* ── NAV ITEMS: ACTIVE LEFT INDICATOR ── */
.hq-nav-item.active {
  box-shadow: inset 0 0 12px rgba(57,255,20,0.04);
}

/* ── NAV BADGES: PULSE ON UNREAD ── */
.hq-nav-unread-dot {
  animation: pulse-dot 1.5s ease-in-out infinite !important;
}

/* ── SIDEBAR STATUS LIVE DOT: ENHANCED ── */
.sidebar-live-dot {
  box-shadow: 0 0 10px rgba(57,255,20,0.7), 0 0 20px rgba(57,255,20,0.3) !important;
}

/* ── PAGINATION: HOVER LIFT ── */
.page-btn {
  transition: all 0.15s !important;
}

.page-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ── LOAD MORE BTN: ANIMATED ARROW ── */
.load-more-btn {
  transition: all 0.2s !important;
  position: relative;
  overflow: hidden;
}

.load-more-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(57,255,20,0.03), transparent);
  transform: translateX(-100%);
  transition: transform 0.4s;
}

.load-more-btn:hover::after {
  transform: translateX(100%);
}

.load-more-btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* ── CONFIDENCE BARS: ANIMATED ON LOAD ── */
.source-bar-fill {
  width: 0 !important; /* override inline, set via JS */
  animation: bar-fill 1s ease forwards;
}

@keyframes bar-fill {
  to { width: var(--target-width, 100%); }
}

/* ── BRIEF ITEMS: SUBTLE LIFT ── */
.brief-item {
  transition: all 0.18s !important;
}

.brief-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
}

/* ── SAVE INTEL BTN: ENHANCED ── */
.save-intel-btn {
  transition: all 0.15s !important;
}

.save-intel-btn:hover {
  transform: scale(1.2) !important;
}

/* ── ACCOUNT CARDS: HOVER GLOW ── */
.account-card {
  transition: border-color 0.2s;
}

.account-card:hover {
  border-color: rgba(57,255,20,0.1);
}

/* ── COMPETITOR ITEMS IN ACCOUNT: HOVER ── */
.comp-item {
  transition: all 0.18s !important;
}

.comp-item:hover {
  transform: translateX(2px);
  border-color: rgba(57,255,20,0.2) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ── GENERATE CARD: ENHANCED ── */
.generate-card {
  transition: all 0.2s !important;
}

.generate-card:hover {
  border-color: rgba(57,255,20,0.35) !important;
  box-shadow: 0 4px 20px rgba(57,255,20,0.06) !important;
}

/* ── TOAST: ENHANCED ANIMATION ── */
.toast {
  transition: opacity 0.25s, transform 0.25s !important;
  transform: translateX(-50%) translateY(8px);
}

.toast.show {
  transform: translateX(-50%) translateY(0) !important;
}

/* ── LOCKED SECTION: DIMMER STYLING ── */
.locked-section {
  position: relative;
  overflow: hidden;
}

.locked-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0,
    transparent 10px,
    rgba(255,255,255,0.01) 10px,
    rgba(255,255,255,0.01) 20px
  );
  pointer-events: none;
}

/* ── SECTION HEADERS: UNDERLINE ACCENT ── */
.section-title {
  position: relative;
}

/* ── BRIEF FIELDNOTES: ENHANCED GLOW ── */
.brief-fieldnotes {
  transition: border-color 0.2s, box-shadow 0.2s !important;
}

.brief-fieldnotes:hover {
  border-color: rgba(57,255,20,0.4) !important;
  box-shadow: 0 4px 20px rgba(57,255,20,0.06) !important;
}

/* ── BACK BUTTON: HOVER ARROW SLIDE ── */
.brief-back-btn {
  transition: all 0.18s !important;
  position: relative;
}

.brief-back-btn:hover {
  transform: translateX(-2px) !important;
  color: var(--accent) !important;
  border-color: var(--accent) !important;
}

/* ── NAV LOGO: SUBTLE GLOW ON HOVER ── */
.nav-logo:hover span {
  text-shadow: 0 0 12px rgba(57,255,20,0.5);
  transition: text-shadow 0.2s;
}

/* ── TIER CHIP: PULSE ANIMATION ── */
.tier-founding {
  animation: chip-pulse 3s ease-in-out infinite;
}

@keyframes chip-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74,125,255,0.2); }
  50% { box-shadow: 0 0 0 4px rgba(74,125,255,0.06); }
}

/* ── AUTH CARD: ENHANCED DEPTH ── */
.auth-card {
  box-shadow: 0 24px 64px rgba(0,0,0,0.4), 0 0 0 1px rgba(57,255,20,0.04) !important;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}

/* ── FREQ BUTTONS: ACTIVE PULSE ── */
.freq-btn.active {
  animation: freq-active-pulse 2.5s ease-in-out infinite;
}

@keyframes freq-active-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(57,255,20,0.15); }
  50% { box-shadow: 0 0 0 4px rgba(57,255,20,0.05); }
}

/* ── APPLY FILTER BTN: PULSE ── */
.apply-filter-btn:not(:disabled) {
  transition: all 0.15s !important;
}

.apply-filter-btn:hover:not(:disabled) {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 16px rgba(57,255,20,0.2) !important;
}

/* ── BRIEF ACTION BUTTONS: HOVER LIFT ── */
.brief-action-btn {
  transition: all 0.18s !important;
}

.brief-action-btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 8px rgba(57,255,20,0.1) !important;
}

/* ── DEMO SIGNAL CARDS: CONTEXT REVEAL SMOOTHER ── */
.demo-signal-card {
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.demo-signal-context {
  transition: opacity 0.2s !important;
  opacity: 0;
  display: block !important; /* override existing hide */
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s !important;
}

.demo-signal-card:hover .demo-signal-context {
  max-height: 100px;
  opacity: 1;
}

/* ── RE BRIEF CARDS: HOVER DEPTH ── */
.re-brief-card {
  transition: all 0.18s !important;
}

.re-brief-card:hover {
  transform: translateX(2px) !important;
  border-color: rgba(57,255,20,0.25) !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15) !important;
}

/* ── SIDEBAR NAV LINKS: ENHANCED ── */
.sidebar-nav-link {
  transition: all 0.15s !important;
}

.sidebar-nav-link.active {
  box-shadow: inset 0 0 12px rgba(57,255,20,0.04);
}

/* ── MOBILE NAV: SMOOTH OPEN ── */
.mobile-nav-menu {
  transition: opacity 0.2s !important;
}

/* ── SCROLLBAR ACROSS ALL PANELS ── */
.tab-panel {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.06) transparent;
}

/* ── ACTIVITY ITEMS: HOVER REFINEMENT ── */
.sidebar-activity-item {
  padding: 4px 6px;
  border-radius: 5px;
  margin-right: -6px;
  transition: background 0.15s !important;
}

.sidebar-activity-item:hover {
  background: rgba(255,255,255,0.02);
}

/* ── SIGNAL TYPE ICONS: HOVER SCALE ── */
.signal-type-icon {
  transition: transform 0.2s !important;
}

.signal-card:hover .signal-type-icon {
  transform: scale(1.1);
}

/* ── SECTION COUNT BADGE: SUBTLE ── */
.section-count {
  font-variant-numeric: tabular-nums;
}

/* ── DATE INPUTS: STYLED ── */
.date-input, .sidebar-date-input {
  transition: border-color 0.15s, box-shadow 0.15s !important;
}

.date-input:focus, .sidebar-date-input:focus {
  box-shadow: 0 0 0 3px rgba(57,255,20,0.06) !important;
}

/* ── COMPETITOR AVATAR: HOVER GLOW ── */
.hq-comp-sub-avatar,
.comp-sidebar-avatar {
  transition: box-shadow 0.2s !important;
}

.hq-comp-sub-item:hover .hq-comp-sub-avatar,
.comp-sidebar-item:hover .comp-sidebar-avatar {
  box-shadow: 0 0 8px rgba(74,125,255,0.2);
}

/* ── HEADER: SUBTLE GRADIENT ── */
.hq-header {
  background: linear-gradient(180deg, rgba(57,255,20,0.02) 0%, transparent 100%);
  padding: 16px 0 20px;
  margin-bottom: 20px !important;
}

/* ── EYEBROW: ANIMATED DOT ── */
.eyebrow {
  animation: eyebrow-pulse 3s ease-in-out infinite;
}

@keyframes eyebrow-pulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; color: var(--accent); }
}

/* ── SOURCE CONFIDENCE BARS: TRANSITION ── */
.source-bar-fill {
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ── TREND SUMMARY VALUES: GLOW ── */
.trend-summary-value {
  text-shadow: 0 0 12px rgba(57,255,20,0.2);
}

/* ── BOOKMARK BTN: SCALE ── */
.bookmark-btn {
  transition: all 0.15s !important;
}

.bookmark-btn:hover {
  transform: scale(1.2) !important;
}

/* ── SIGNAL SEVERITY DOTS: GLOW ── */
.brief-sev-dot.brief-sev-high {
  animation: dot-pulse-red 2s ease-in-out infinite;
}

.brief-sev-dot.brief-sev-medium {
  animation: dot-pulse-orange 2.5s ease-in-out infinite;
}

@keyframes dot-pulse-red {
  0%, 100% { box-shadow: 0 0 4px rgba(255,68,68,0.4); }
  50% { box-shadow: 0 0 10px rgba(255,68,68,0.7); }
}

@keyframes dot-pulse-orange {
  0%, 100% { box-shadow: 0 0 4px rgba(255,136,0,0.4); }
  50% { box-shadow: 0 0 10px rgba(255,136,0,0.6); }
}

/* ── SIGNAL TYPE TAGS: HOVER ── */
.signal-type-tag, .demo-tag {
  transition: all 0.15s !important;
}

/* ── EXEC BULLETS: HOVER LEFT BORDER ── */
.demo-exec-bullets li {
  transition: border-left-color 0.2s, background 0.15s !important;
}

.demo-exec-bullets li:hover {
  background: rgba(255,255,255,0.02) !important;
}

/* ── CONNECTED ITEMS: HOVER ── */
.brief-connected-item {
  transition: all 0.18s !important;
}

.brief-connected-item:hover {
  border-color: rgba(57,255,20,0.25) !important;
  transform: translateX(2px);
}

/* ── ACTION ITEMS: HOVER ── */
.brief-action-item {
  transition: all 0.18s !important;
}

.brief-action-item:hover {
  transform: translateX(2px) !important;
  box-shadow: 0 2px 8px rgba(57,255,20,0.04) !important;
}

/* ── COMP REMOVE BTN: HOVER ── */
.comp-remove-btn {
  transition: all 0.15s !important;
}

.comp-remove-btn:hover {
  transform: scale(1.05) !important;
}

/* ── MARKET TAG REMOVE: HOVER ── */
.market-tag-remove {
  transition: all 0.15s !important;
}

.market-tag-remove:hover {
  transform: scale(1.2) !important;
}

/* ── BRIEF OVERLAY HEADER: DEPTH ── */
.brief-overlay-header {
  position: sticky;
  top: 56px;
  z-index: 20;
  background: rgba(6,8,16,0.95);
  backdrop-filter: blur(8px);
  border-radius: 0;
  margin: 0 -4px;
  padding: 12px 4px 16px;
}

/* ── FILTER CHECKBOXES: STYLED ── */
.filter-check-item input[type="checkbox"] {
  border-radius: 3px;
  transition: all 0.15s !important;
}

/* ── PULSE STAT ICON: HOVER SPIN (subtle) ── */
.pulse-stat:hover .pulse-stat-icon {
  animation: icon-wobble 0.4s ease;
}

@keyframes icon-wobble {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(6deg); }
  100% { transform: rotate(0deg); }
}

/* ── SIDEBAR CARD TITLE: ICON PULSE ── */
.sidebar-card-title {
  position: relative;
}

/* ── TREND SUMMARY ROW: GAP ADJUST ── */
.trend-summary-row {
  gap: 24px !important;
  padding: 12px 0;
  border-bottom: 1px solid rgba(26,32,53,0.5);
  margin-bottom: 24px;
}

.trend-summary-item {
  position: relative;
}

.trend-summary-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -12px;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: var(--border);
}

/* ── HQ HEADER TITLE: REFINED TYPOGRAPHY ── */
.hq-title {
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary) 60%, rgba(232,240,232,0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── NAV: LIVE INDICATOR ── */
.nav-badge {
  position: relative;
  overflow: hidden;
}

.nav-badge::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: badge-sweep 3s ease-in-out infinite;
}

@keyframes badge-sweep {
  0%, 70% { left: -100%; }
  100% { left: 200%; }
}

/* ── RESPONSIVE ADJUSTMENTS ── */
@media (max-width: 800px) {
  .hq-header {
    padding: 12px 0 16px !important;
  }

  .brief-overlay-header {
    top: 56px;
  }

  .trend-summary-item::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
