/* ==========================================================================
   EON Work Intelligence Index Styling
   ========================================================================== */

:root {
  --ink: #1c3763;
  --purple: #8B86F7;
  --line: #DEE7F8;
  --surface: #ffffff;
  --surface-2: #fbfbfe;
  --shadow-hover: 0px 0px 10px 0px rgba(0, 0, 0, 0.2);
  --radius: 10px;
}

.eon-work-intel-index {
  max-width: 1320px !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
  box-sizing: border-box !important;
}

/* Row & Spacing (Aligns with Old Plugin padding: 60px 0 20px) */
.eon-work-intel-index .shelf-row {
  position: relative !important;
  padding: 60px 0 20px !important;
}
.eon-work-intel-index .shelf-row.alt {
  background-color: var(--surface-2) !important;
  border-top: 1px solid var(--line) !important;
  border-bottom: 1px solid var(--line) !important;
  margin-left: calc(-50vw + 50%) !important;
  margin-right: calc(-50vw + 50%) !important;
  padding-left: calc(50vw - 50% + 20px) !important;
  padding-right: calc(50vw - 50% + 20px) !important;
}
.eon-work-intel-index .shelf-container {
  max-width: 1320px !important; /* Aligns with Old Plugin container width */
  margin: 0 auto !important;
}

/* Header (Aligns with Old Plugin margin-bottom: 20px) */
.eon-work-intel-index .shelf-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 20px !important;
}
.eon-work-intel-index .shelf-header h2 {
  font-family: 'Poppins', sans-serif !important;
  font-size: 35px !important;
  font-weight: 600 !important;
  line-height: 52px !important;
  color: var(--ink) !important;
  margin: 0 !important;
  letter-spacing: -.01em !important;
}
.eon-work-intel-index .shelf-header h2 span {
  color: var(--purple) !important;
  margin-left: 10px !important;
}

/* Navigation Arrows (Desktop) */
.eon-work-intel-index .shelf-nav {
  display: flex !important;
  gap: 8px !important;
}
.eon-work-intel-index .shelf-arrow {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  border: 1px solid var(--purple) !important;
  background-color: var(--ink) !important;
  color: #ffffff !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
}
.eon-work-intel-index .shelf-arrow:hover:not([disabled]) {
  background-color: var(--purple) !important;
  border-color: var(--purple) !important;
  color: #ffffff !important;
  transform: scale(1.05) !important;
}
.eon-work-intel-index .shelf-arrow[disabled] {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
}
.eon-work-intel-index .shelf-arrow svg {
  stroke-width: 2.5px !important;
}

/* Slider Track Viewport (Aligns with Old Plugin margin/paddings) */
.eon-work-intel-index .carousel-view {
  position: relative !important;
  width: 100% !important;
  margin: -20px -10px 0 !important;
  padding: 20px 10px 30px !important;
}
.eon-work-intel-index .carousel-track {
  display: flex !important;
  gap: 10px !important;
  overflow-x: auto !important;
  scroll-snap-type: none !important;
  scrollbar-width: none !important; /* Firefox */
  padding: 20px 10px !important;
  margin: -20px -10px !important;
  box-sizing: border-box !important;
}
.eon-work-intel-index .carousel-track::-webkit-scrollbar {
  display: none !important; /* Webkit browsers */
}

/* MOBILE INSET ARROWS Overlay */
.eon-work-intel-index .mobile-arrows {
  display: none !important;
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  left: 10px !important;
  right: 10px !important;
  z-index: 10 !important;
  pointer-events: none !important;
  justify-content: space-between !important;
  width: calc(100% - 20px) !important;
}
.eon-work-intel-index .mobile-arrow {
  pointer-events: auto !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  border: 1px solid var(--purple) !important;
  background-color: var(--ink) !important;
  color: #ffffff !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
}
.eon-work-intel-index .mobile-arrow:hover:not([disabled]) {
  background-color: var(--purple) !important;
  border-color: var(--purple) !important;
  color: #ffffff !important;
}
.eon-work-intel-index .mobile-arrow[disabled] {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
}

/* NEW DESIGN CARD: Full Image Background */
.eon-work-intel-index .index-subject-card {
  flex: 0 0 230px !important;
  width: 230px !important;
  height: 330px !important;
  border-radius: var(--radius) !important; /* Aligns with Old Plugin 10px */
  overflow: hidden !important;
  background: #040f2c !important; /* fallback dark background */
  cursor: pointer !important;
  text-decoration: none !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  border: none !important;
  padding: 0 !important;
  position: relative !important;
  box-shadow: none !important;
  transition: transform .24s cubic-bezier(.2,.75,.25,1), box-shadow .24s ease !important;
}
.eon-work-intel-index .index-subject-card:hover {
  transform: translateY(-4px) !important; /* Aligns with Old Plugin -4px */
  box-shadow: var(--shadow-hover) !important; /* Aligns with Old Plugin 0px 0px 10px 0px rgba(0, 0, 0, 0.2) */
}

.eon-work-intel-index .index-subject-card .card-bg-image {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  z-index: 1 !important;
  transition: transform 0.5s ease !important;
}
.eon-work-intel-index .index-subject-card:hover .card-bg-image {
  transform: scale(1.05) !important;
}

.eon-work-intel-index .index-subject-card .card-overlay {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(to bottom, rgba(4, 15, 44, 0) 30%, rgba(4, 15, 44, 0.4) 60%, rgba(4, 15, 44, 0.95) 100%) !important;
  z-index: 2 !important;
}

/* Card overlaid copy */
.eon-work-intel-index .index-subject-card .card-content {
  position: relative !important;
  z-index: 3 !important;
  padding: 20px !important;
  color: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  pointer-events: none !important;
}
.eon-work-intel-index .index-subject-card .card-content h3 {
  margin: 0 !important;
  font-family: "Poppins", sans-serif !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  color: #ffffff !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}
.eon-work-intel-index .index-subject-card .index-explore-btn {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  color: var(--purple) !important; /* Brand Violet */
  font-family: "Poppins", sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  text-align: left !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
}
.eon-work-intel-index .index-subject-card .index-explore-btn svg {
  width: 14px !important;
  height: 14px !important;
  color: var(--purple) !important;
  stroke: var(--purple) !important;
  transition: transform 0.2s ease !important;
}
.eon-work-intel-index .index-subject-card:hover .index-explore-btn svg {
  transform: translateX(4px) !important;
}

/* Dots Pagination */
.eon-work-intel-index .slider-dots {
  display: flex !important;
  justify-content: center !important;
  gap: 6px !important;
  margin-top: 20px !important;
}
.eon-work-intel-index .slider-dot {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background-color: #cccccc !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease, transform 0.2s ease !important;
}
.eon-work-intel-index .slider-dot.active {
  background-color: #000000 !important;
  transform: scale(1.1) !important;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .eon-work-intel-index .shelf-header h2 {
    font-size: 28px !important;
    line-height: 40px !important;
  }
}

@media (max-width: 768px) {
  .eon-work-intel-index .shelf-nav {
    display: none !important; /* Hide header arrows on mobile */
  }
  .eon-work-intel-index .mobile-arrows {
    display: flex !important; /* Show overlay arrows on mobile */
  }
  .eon-work-intel-index .shelf-row {
    padding: 45px 0 !important;
  }
}

/* ==========================================================================
   POPUP MODAL (Scoped specifically to the Index Modal Backdrop)
   ========================================================================== */
.eon-research-modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(4, 15, 44, 0.45);
  backdrop-filter: blur(5px);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity .2s ease;
}
.eon-research-modal-backdrop.open {
  display: flex;
  opacity: 1;
}
.eon-research-modal-backdrop .resource-modal {
  width: min(570px, 100%) !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  border: 1px solid rgba(255,255,255,.7) !important;
  box-shadow: 0 32px 90px rgba(4,15,44,.28) !important;
  transform: translateY(12px) scale(.98);
  transition: transform .22s cubic-bezier(.2,.8,.2,1);
  overflow: hidden !important;
}
.eon-research-modal-backdrop.open .resource-modal {
  transform: translateY(0) scale(1);
}
.eon-research-modal-backdrop .modal-head {
  padding: 24px 26px 18px !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 16px !important;
  border-bottom: 1px solid #eceef6 !important;
  background: linear-gradient(135deg, #fff, #f5f3ff) !important;
}
.eon-research-modal-backdrop .modal-head-copy {
  min-width: 0 !important;
  flex: 1 !important;
}
.eon-research-modal-backdrop .modal-label {
  margin: 0 0 6px !important;
  color: var(--purple) !important; /* Force Brand Violet #8B86F7 */
  font-family: "Poppins", sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
  display: block !important;
}
.eon-research-modal-backdrop .modal-title {
  margin: 0 !important;
  font-family: "Poppins", sans-serif !important;
  font-size: 22px !important;
  line-height: 1.35 !important;
  letter-spacing: -.02em !important;
  color: #8B86F7 !important; /* Force Violet #8B86F7 */
}
.eon-research-modal-backdrop .modal-subtitle {
  margin: 8px 0 0 !important;
  color: var(--muted) !important; /* Force Slate Grey */
  font-family: "Open Sans", sans-serif !important;
  font-size: 13.5px !important;
  line-height: 1.5 !important;
}
.eon-research-modal-backdrop .close-modal {
  width: 38px !important;
  height: 38px !important;
  border: 1px solid #dfe3f0 !important;
  border-radius: 50% !important;
  background: #fff !important;
  color: var(--ink) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: border-color .2s ease, color .2s ease, background .2s ease !important;
  padding: 0 !important;
}
.eon-research-modal-backdrop .close-modal:hover {
  background: #f6f5ff !important;
  border-color: var(--purple) !important;
  color: var(--purple) !important;
  transform: none !important;
}
.eon-research-modal-backdrop .resource-grid {
  padding: 22px 26px 27px !important;
  display: grid !important;
  grid-template-columns: repeat(2,1fr) !important;
  gap: 13px !important;
}
.eon-research-modal-backdrop .resource-link {
  min-height: 96px !important;
  border: 1px solid #dde2f0 !important; /* Force default border #dde2f0 */
  border-radius: 12px !important;
  padding: 16px !important;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  text-decoration: none !important;
  background: #fff !important;
  box-shadow: none !important;
  transform: none !important;
  transition: border-color 0.2s ease, background-color 0.2s ease !important;
}
.eon-research-modal-backdrop .resource-link:hover, 
.eon-research-modal-backdrop .resource-link:focus-visible {
  border-color: #8B86F7 !important; /* Force violet border on hover */
  background: #ffffff !important; /* Keep flat white background, no change */
  box-shadow: none !important; /* No shadow */
  transform: none !important; /* No translateY transition */
  outline: none !important;
}
.eon-research-modal-backdrop .resource-link.disabled {
  opacity: 0.45 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
  background: #ffffff !important;
  border-color: #dfe4f2 !important;
}
.eon-research-modal-backdrop .resource-link.disabled .resource-icon {
  background: #fbfbfe !important;
  color: #a0aec0 !important;
}
.eon-research-modal-backdrop .resource-link.disabled .resource-icon svg {
  color: #a0aec0 !important;
  stroke: #a0aec0 !important;
}
.eon-research-modal-backdrop .resource-link.disabled .resource-text strong {
  color: #718096 !important;
}
.eon-research-modal-backdrop .resource-link.disabled .resource-text span {
  color: #a0aec0 !important;
}
.eon-research-modal-backdrop .resource-icon {
  flex: 0 0 48px !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 12px !important;
  background: #f0eeff !important; /* Light violet/lavender background */
  color: #8B86F7 !important; /* Force Brand Violet #8B86F7 icon color */
  display: grid !important;
  place-items: center !important;
}
.eon-research-modal-backdrop .resource-icon svg {
  width: 25px !important;
  height: 25px !important;
  color: #8B86F7 !important;
  stroke: #8B86F7 !important;
}
.eon-research-modal-backdrop .resource-text strong {
  display: block !important;
  font-family: "Poppins", sans-serif !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #102650 !important; /* Force dark navy #102650 */
}
.eon-research-modal-backdrop .resource-text span {
  display: block !important;
  margin-top: 4px !important;
  color: #607090 !important; /* Force slate grey #607090 */
  font-family: "Open Sans", sans-serif !important;
  font-size: 12px !important;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .eon-research-modal-backdrop .resource-grid {
    grid-template-columns: 1fr !important;
  }
}
