:root {
  --story-view-font-main: 'Raleway', Avenir, 'Century Gothic', sans-serif;
  --story-view-bg-color: #000;
  --story-view-text-color: #e0e0e0;
  /* --story-view-heading-color: #ffffff; */
  --story-view-accent-color: #a90c17;
  --story-view-card-bg: #1e1e1e;
  --story-view-card-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  --story-view-border-radius: 10px;
}

.story-view-container {
  color: var(--story-view-text-color);
  font-family: var(--story-view-font-main);
  background: var(--story-view-bg-color);
}

.story-view-hero-section {
  position: relative;
  width: 100%;
  height: 70vh;
  overflow: hidden;
  /* border-radius: 15px; */
  display: flex;
  flex-direction: column;
}

.story-view-hero-background {
  /* position: absolute; */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: black;
  flex: 1;
  position: relative;
}
body.light-mode .story-view-hero-background {
  background: white;
}

.story-view-hero-background img {
  position: absolute;
  top: 0;
  left: 0;
  width: 150%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.8);
  animation: story-view-panBackground 30s linear infinite;
  animation-play-state: paused;
  background-repeat: repeat-x;
}

.story-view-hero-background img.animation-active {
  animation-play-state: running;
  /* Start animation when class is added */
}

.story-view-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 1) 100%);
  z-index: 1;
  display: none;
}

.story-view-hero-content {
  /* position: absolute; */
    bottom: 0%;
    left: 0;
    right: 0;
    color: var(--story-view-heading-color);
    max-width: 800px;
    margin: 0 auto;
    z-index: 2;
    background-color: #24162eff;
    width: 100%;
}
.story-view-related-compact-card,
.story-view-related-single-card,
.story-view-related-side-card,
.story-view-related-stacked-card {
  background-color: #24162eff;
}

body.light-mode .story-view-related-compact-card,
body.light-mode .story-view-related-single-card,
body.light-mode .story-view-related-side-card,
body.light-mode .story-view-related-stacked-card,
body.light-mode .story-view-hero-content {
  background-color: white;
}

.story-view-hero-headline {
  font-size: 3.2vh;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  background: #24162eff;
  padding: 1rem;
  /* border-bottom: 0.1px solid #9e0c0c; */
  margin-bottom: 0px;
  padding-top: 1rem;
  margin-top: 0px;
}

body.light-mode .story-view-hero-headline {
  background: white;
}

.story-view-hero-insight {
  font-size: 1.5vh;
  line-height: 1.3;
  opacity: 0.9;
  font-weight: 400;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  margin-bottom: 0rem;
  padding: 1rem;
  background: #24162eff;
  margin-top: 0px;
  padding-bottom: 0rem;
  padding-top: 0rem;
  padding-bottom: 0.5rem;
}

.story-view-hero-favicons {
  display: flex
  ;
      align-items: center;
      margin-top: 12px;
      height: 20px;
      font-size: 0.9rem;
      line-height: 1.5;
      opacity: 0.9;
      font-weight: 400;
      text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
      padding: 1rem;
      background: #24162eff;
      margin-top: 0px;
      padding-left: 1rem;
      padding-right: 0rem;
      flex: 1;
}

.story-view-hero-favicons-list {
  display: flex
  ;
      align-items: center;
      gap: -6px;
}

.story-view-hero-favicon {
  width: 20px;
    height: 20px;
    border-radius: 4px;
    background: #fff;
    object-fit: cover;
    border-radius: 50%;
    border: 0.1px solid black;
    padding: 2px;
}

.story-view-favicon-counter {
  display: flex
;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: rgba(128, 128, 128, 0.3);
    color: #9e9e9e;
    font-size: 11px;
    font-weight: 500;
    
    padding: 2px;
    border-radius: 50%;
    border: 0.1px solid white;
}

.story-view-hero-favicon-label {
  font-size: 1.5vh;
  color: #9e9e9e;
  margin-right: 6px;
  display:none;
}

@keyframes story-view-panBackground {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-25%);
  }
}

.story-view-hero-timestamp {
  font-size: 1.2vh;
    color: #9e9e9e;
    margin-left: 1rem;
    font-weight: 400;
    opacity: 0.9;
}

.story-view-hero-timing-container {
  display: flex;
    align-items: center;
    margin-top: 4px;
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    background: #24162eff;
    margin-top: 0px;
    padding-top: 1rem;
}
.main-container .story-view-hero-timing-container,
.article-modal .story-view-hero-timing-container {
  padding-bottom: 1rem;
  padding-top: 0rem;
}

.story-view-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.story-view-article-section {
  position: relative;
  /* width: 100%; */
  /* min-height: 50vh; */
  /* margin-bottom: 4rem; */
  overflow: hidden;
  padding-left: 0.05rem;
  padding-right: 0.05rem;
  padding-bottom: 1rem;
  
}

.story-view-section-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.story-view-section-background img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
}

.story-view-section-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.6) 50%, rgba(0, 0, 0, 1) 100%);
  z-index: 1;
}

.story-view-section-content {
  position: relative;
  z-index: 2;
  color: var(--story-view-heading-color);
}

.story-view-section-headline {
  font-size: 2.5vh;
  line-height: 1.2;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  padding: 1rem;
  margin: 0px;
  /* text-align: center; */
  padding-right: 3rem;
  padding-left: 1rem;
  /* margin-top: 2rem; */
  /* border-left: 3px solid #6d0dbd;
  border-right: 3px solid #6d0dbd; */
  padding-top: 3rem;
  padding-bottom: 1rem;
}

/* Quotes Section Styles */
.story-view-quotes-container {
  position: relative;
  max-width: 800px;
  /* border-left: 3px solid #6d0dbd; */
  padding: 0;
  z-index: 5;
  padding-top: 1rem;
  /* border-right: 3px solid #6d0dbd; */
  padding-bottom: 1rem;
  padding-right: 1rem;
  padding-left: 1rem;
}

.story-view-quotes-carousel {
  position: relative;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  display: flex;
  gap: 1rem;
  
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;
}

.story-view-quotes-carousel::-webkit-scrollbar {
  display: none;
}

.story-view-quote-card {
  scroll-snap-align: start;
  /* flex: 0 0 80%; */
  min-width: calc(100vw - 4.3rem);
  /* background: #24162eff; */
  /* border: 1px solid #2a2a2a; */
  /* border-radius: 10px; */
  padding: 1rem;
  position: relative;
  /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); */
  margin: 0 auto;
  background: #111111CC;

  border: 0.1px solid #A045EC;
}

.story-view-quote-content {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  position: relative;
  padding-left: 2rem;
}

.story-view-quote-content::before {
  content: '"';
  position: absolute;
  left: 0;
  top: -0.5rem;
  font-size: 3rem;
  color: #fbe1ff;
  opacity: 0.7;
  line-height: 1;
}

.story-view-quote-speaker {
  font-weight: 400;
  font-size: 1rem;
  color: #ffffff;
  width: 70%;
}

.story-view-quote-role {
  font-size: 0.85rem;
  opacity: 0.8;
  width: 70%;
}

.story-view-quote-sources {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
  position: absolute;
  right: 1rem;
  bottom: 1rem;
}
.story-view-stat-card .story-view-quote-sources {
  right:0.5rem;
  bottom: 0.5rem;
}

.story-view-quote-sources-for-content {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
  padding-bottom: 1rem;
}

.story-view-source-favicon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
  opacity: 0.9;
}

.story-view-carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  /* margin-top: 1rem; */
  margin-bottom: 0.5rem;
}

.story-view-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background 0.3s ease;
}

.story-view-indicator.active {
  background: #6d0dbd;
}

@media (min-width: 768px) {
  .story-view-quotes-carousel {
    overflow-x: hidden;
  }

  .story-view-quote-card {
    flex: 0 0 calc(100% - 2rem);
    max-width: 100%;
  }
}

/* Facts List Styles */
.story-view-facts-container {
  
  padding: 1rem;
  background: #24162eee;
  /* border-radius: 10px; */
  border-left: 3px solid #6d0dbd;
  border-right: 3px solid #6d0dbd;
  padding-bottom: 2rem;
  padding-top: 1rem;
  margin-left: 1rem;
  margin-right: 1rem;

}

.story-view-facts-title {
  font-size: 0.9rem;
  font-weight: 200;
  color: #b0b0b0;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: none;
}

.story-view-facts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.story-view-fact-item {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  line-height: 1.5;
  font-size: 0.9rem;
}

.story-view-fact-item:last-child {
  margin-bottom: 0;
}

.story-view-fact-item:before {
  content: "•";
  position: absolute;
  left: 0;
  color: #6d0dbd;
  font-size: 1.2rem;
  line-height: 1.5;
}

/* Stats Display Styles */
.story-view-stats-container {
    
  
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  padding: 1rem;
  /* border-left: 3px solid #6d0dbd;
  border-right: 3px solid #6d0dbd; */
}

.story-view-stat-card {
  
  
  
  display: flex;
  flex-direction: row;
  /* border-bottom: 2px solid #4951b6; */
  position: relative;
  flex: 1 0 calc(50% - 3rem);
  padding-left: 1rem;
  padding-right: 1rem;
  border-bottom: 0.1px solid #A045EC;
  background: #111111CC;
}

.story-view-stat-name {
  font-size: 0.9rem;
  font-weight: 200;
  /* color: #b0b0b0; */
  /* margin-bottom: 0.5rem; */
  /* text-transform: uppercase; */
  letter-spacing: 0.5px;
  padding-right: 1rem;
  width: 50%;
  border-right: 0.1px solid #A045EC;
  padding-bottom: 1rem;
  padding-top: 1rem;
  display: flex;
  align-items: center;
}

.story-view-stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  width: 50%;
  /* padding-bottom: 1rem; */
  padding-left: 1rem;
  align-items: center;
  display: flex;
}

@media (min-width: 768px) {
  .story-view-stats-container {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .story-view-stat-card {
    flex: 1 0 calc(50% - 3rem);
    min-width: 200px;
  }
}

.story-view-related-news-section {
  margin: 3rem 0;
  padding: 1rem 0;
  background: rgba(0, 0, 0, 0.8);
  border-top: 1px solid rgba(230, 57, 70, 0.3);
}

.story-view-related-news-heading {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--story-view-heading-color);
  margin: 0.5rem 1rem 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.story-view-related-news-container {
  position: relative;
  overflow: hidden;
  margin: 0 1rem;
}

.story-view-related-news-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 1rem;
  padding: 0.5rem 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.story-view-related-news-carousel::-webkit-scrollbar {
  display: none;
}

.story-view-related-news-card {
  scroll-snap-align: start;
  flex: 0 0 85%;
  min-width: 280px;
  max-width: 350px;
  background: var(--story-view-card-bg);
  border-radius: var(--story-view-border-radius);
  overflow: hidden;
  box-shadow: var(--story-view-card-shadow);
  transition: transform 0.3s ease;
  border-left: 3px solid var(--story-view-accent-color);
}

.story-view-related-news-content {
  padding: 1rem;
}

.story-view-related-news-fact {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--story-view-text-color);
}

.story-view-related-news-sources {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.story-view-related-source-favicon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 3px;
  background: #fff;
}

@media (min-width: 768px) {
  .story-view-related-news-card {
    flex: 0 0 350px;
  }
}

/* Add fade effect on edges */
.story-view-related-news-container::before,
.story-view-related-news-container::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20px;
  z-index: 1;
  pointer-events: none;
}

.story-view-related-news-container::before {
  left: 0;
}

.story-view-related-news-container::after {
  right: 0;
}

.story-view-citation-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  cursor: pointer;
  position: relative;
  height: 14px;
  border-radius: 3px;
  bottom: -0.5px;
  gap: 5px;
}

.story-view-citation-indicator img {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #fff;
  opacity: 0.9;
}

.story-view-citation-badge {
  display: inline-block;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  font-size: 8px;
  font-weight: bold;
  background: var(--story-view-accent-color);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  margin-left: 2px;
  position: relative;
  top: -1px;
}

.story-view-citation-bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #121212;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  
  z-index: 20002;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  padding-bottom: env(safe-area-inset-bottom, 20px);
}

.story-view-citation-bottom-sheet.active {
  transform: translateY(0);
}

.story-view-citation-sheet-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.story-view-citation-sheet-title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.story-view-citation-close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.story-view-citation-content {
  padding: 16px;
}

.story-view-citation-item {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.story-view-citation-item:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.story-view-citation-source {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.story-view-citation-favicon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #fff;
}

.story-view-citation-domain {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
}

.story-view-citation-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 16px;
  padding-left: 28px;
}

.story-view-citation-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(230, 57, 70, 0.1);
  color: var(--story-view-accent-color);
  border: 1px solid var(--story-view-accent-color);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  margin-left: 28px;
  transition: background 0.2s ease;
}

.story-view-citation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 20001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.story-view-citation-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.story-view-fact-item {
  position: relative;
}

.story-view-citation-letter-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--story-view-accent-color);
  color: white;
  font-size: 8px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.story-view-citation-count-indicator {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: rgba(230, 57, 70, 0.2);
  color: var(--story-view-accent-color);
  font-size: 8px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Section Type Pill Styles */
.story-view-section-type-pill {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background-color: rgba(230, 57, 70, 0.8);
  border-radius: 30px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
  margin-bottom: 0.5rem;
  margin-left: 1rem;
  margin-top: 1rem;
}

/* Different pill colors for different section types */
.story-view-section-type-pill.background-context {
  background-color: rgba(71, 118, 230, 0.8);
}

.story-view-section-type-pill.post-match-summary {
  background-color: rgba(115, 54, 230, 0.8);
}

.story-view-section-type-pill.expert-analysis {
  background-color: rgba(230, 57, 70, 0.8);
}

.story-view-section-type-pill.cause-and-effect {
  background-color: rgba(30, 144, 255, 0.8);
}

.story-view-section-type-pill.timeline {
  background-color: rgba(102, 187, 106, 0.8);
}

/* Splash screen styles */
.story-view-splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--story-view-bg-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.story-view-loader-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.story-view-hexagon-loader {
  width: 100%;
  height: 60%;
  max-height: 50vh;
}

.story-view-hexagon-loader-end {
  width: 150px;
  height: 150px;
}

.story-view-hexagon-path {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 3000;
  stroke-dashoffset: 3000;
  animation: story-view-draw 4s linear infinite;
}

@keyframes story-view-draw {
  0% {
    stroke-dashoffset: 3000;
  }

  80% {
    stroke-dashoffset: 0;
    stroke-width: 3;
  }

  90% {
    stroke-dashoffset: 0;
    stroke-width: 5;
  }

  100% {
    stroke-dashoffset: 0;
    stroke-width: 3;
  }
}

/* Create gradient for the stroke */
.story-view-gradient-stroke {
  stroke: url(#story-view-line-gradient);
}

/* Toast message styles */
.story-view-toast-container {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1e1e1e;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  max-width: 90%;
  border-left: 4px solid #e63946;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.story-view-toast-container.visible {
  opacity: 1;
}

.story-view-toast-icon {
  margin-right: 10px;
  font-size: 20px;
}

/* Tab Navigation Styles */
.story-view-tabs-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.8);
  border-radius: var(--story-view-border-radius);
  overflow: hidden;
  display: none;
}

.story-view-tabs-nav {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.story-view-tab-button {
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  color: var(--story-view-text-color);
  font-family: var(--story-view-font-main);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color 0.3s ease;
  flex: 1;
  text-align: center;
}

.story-view-tab-button.active {
  color: var(--story-view-heading-color);
}

.story-view-tab-button.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--story-view-accent-color);
}

.story-view-tab-content {
  visibility: hidden;
  opacity: 0;
  height: 0;
  min-height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease-in-out, height 0.3s ease-in-out, min-height 0.3s ease-in-out;
}

.story-view-tab-content.active {
  visibility: visible;
  opacity: 1;
  height: auto;
  min-height: 100vh;
  overflow-y: auto;
  padding: 2rem;
}


#story-view-full-story-content {
  height: 0px;
  min-height: 0px;
  padding: 0rem;
}



/* Section title in tabs */
.story-view-tab-section-title {
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--story-view-text-color);
  opacity: 0.7;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-top: 2rem;
}

/* Added spacing between quotes/stats in tabs view */
.story-view-tab-content .story-view-quote-card,
.story-view-tab-content .story-view-stat-card {
  margin-bottom: 1rem;
}

/* Background styling for tabs */
.story-view-tabs-content-wrapper {
  position: relative;
}

.story-view-tabs-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.2;
}

.story-view-tabs-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-view-tabs-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.9) 100%);
  z-index: 1;
}

.story-view-tabs-content-container {
  position: relative;
  z-index: 2;
}

/* Floating Action Buttons Styles */
.story-view-floating-actions-container {
  
  
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
  transition: all 0.3s ease;
  background: #24162eff;
  padding: 1rem;
  /* border-top: 0.1px solid #9e0c0c; */
  padding-top: 0px;
  padding-bottom: 0rem;
  padding-left: 0rem;
}

.story-view-floating-actions-container.visible {
  transform: translateY(0);
  opacity: 1;
}

.story-view-action-btn {
  background: transparent;
  color: #e0e0e0;
  border-radius: 50%;
  width: 4vh;
  height: 4vh;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.story-view-action-btn:active {
  transform: translateY(0);
}

.story-view-action-icon {
  
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease, fill 0.3s ease;
}

/* Like button styles */
.story-view-like-btn.active {
  background: rgba(46, 125, 50, 0.9);
  color: white;
  border-color: rgba(46, 125, 50, 0.6);
}

.story-view-like-btn.active .story-view-action-icon {
  animation: story-view-pulse 0.4s ease-out;
  fill: white;
}

.story-view-like-btn.active svg {
  stroke: white;
}

/* Dislike button styles */
.story-view-dislike-btn.active {
  background: rgba(198, 40, 40, 0.9);
  color: white;
  border-color: rgba(198, 40, 40, 0.6);
}

.story-view-dislike-btn.active .story-view-action-icon {
  animation: story-view-pulse 0.4s ease-out;
  fill: white;
}

.story-view-dislike-btn.active svg {
  stroke: white;
}

/* Save button styles */
.story-view-save-btn.active {
  background: rgba(33, 150, 243, 0.9);
  color: white;
  border-color: rgba(33, 150, 243, 0.6);
}

.story-view-save-btn.active .story-view-action-icon {
  fill: white;
  stroke: white;
  animation: story-view-bounce 0.4s ease-out;
}

.story-view-save-btn.active svg {
  stroke: white;
  fill: rgba(255, 255, 255, 0.7);
}

/* Share button styles */
.story-view-share-btn:active .story-view-action-icon {
  animation: story-view-rotate 0.4s ease-out;
}

/* Animation keyframes */
@keyframes story-view-pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes story-view-bounce {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes story-view-rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Ripple effect */
.story-view-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: story-view-ripple 0.6s linear;
  z-index: 1;
}

@keyframes story-view-ripple {
  to {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* Media query for mobile devices */
@media (max-width: 768px) {
  .story-view-floating-actions-container {
    left: auto;
    right: 0px;
    bottom: 0px;
    flex-direction: row-reverse;
    gap: 16px;
  }
}

/* Video Scroll Section Styles */
.story-view-video-scroll-section {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 400px;
  
  overflow: hidden;
  background-color: var(--story-view-bg-color);
  display:none;
}
.story-view-video-scroll-section-main-feed {
  scroll-snap-align: center;
  background-color: none;
  height: 70vh;
  
  scroll-snap-stop: always;
}

.story-view-video-scroll-section-main-feed .story-view-video-scroll-container {
  padding: 0;
}

.story-view-video-scroll-container {
  display: flex;
  height: 70vh;
  
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 1rem;
  padding: 1rem;
  scrollbar-width: thin;
  display:none;
  
}

.story-view-video-scroll-container::-webkit-scrollbar {
  height: 6px;
}

.story-view-video-scroll-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.story-view-video-scroll-container::-webkit-scrollbar-thumb {
  background-color: var(--story-view-accent-color);
  border-radius: 10px;
}

.story-view-video-card {
  flex: 0 0 85%;
  height: calc(100% - 2rem);
  margin: 1rem 0;
  scroll-snap-align: center;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--story-view-card-bg);
  box-shadow: var(--story-view-card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.story-view-video-frame {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  background-color: #000;
}

.story-view-video-content {
  padding: 0.8rem;
  height: 15vh;
  overflow: hidden;
  /* display: none; */
}

.story-view-video-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: var(--story-view-heading-color);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-view-video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  display: none;
}

.story-view-player-overlay {
  position: absolute;
  top: 10%;
  left: 0;
  right: 0;
  width: 100%;
  height: 70%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1001;
  opacity: 0;
}

.story-view-video-tag {
  font-size: 0.65rem;
  background: rgba(230, 57, 70, 0.2);
  color: var(--story-view-accent-color);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.story-view-scroll-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  opacity: 0.7;
  transition: opacity 0.3s ease, background 0.3s ease;
  display: none;
}

.story-view-scroll-left {
  left: 10px;
}

.story-view-scroll-right {
  right: 10px;
}

.story-view-video-section-heading {
  position: relative;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--story-view-heading-color);
  padding: 0.5rem 0;
  margin: 0px;
  max-height: 10vh;
  display: none;
}

.story-view-video-section-heading::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: var(--story-view-accent-color);
}

@media (min-width: 768px) {
  .story-view-video-card {
    flex: 0 0 60%;
  }
}

@media (min-width: 1024px) {
  .story-view-video-card {
    flex: 0 0 40%;
  }
}

.story-view-article-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 1000;
}

.story-view-article-progress-bar {
  height: 100%;
  background: var(--story-view-accent-color, #e63946);
  width: 0%;
  transition: width 0.2s ease;
}

.story-view-article-progress-markers {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.story-view-section-marker {
  position: absolute;
  top: 0;
  height: 100%;
  width: 4px;
  background: rgba(255, 255, 255, 0.5);
}

/* Light mode styles */
.light-mode .story-view-container {
  --story-view-bg-color: #fff;
  --story-view-text-color: #333333;
  --story-view-heading-color: #111111;
  --story-view-accent-color: #e63946;
  --story-view-card-bg: #ffffff;
  --story-view-card-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.light-mode .story-view-hero-headline {
  background: rgba(255, 255, 255, 1);
  color: #111111;
  
  text-shadow: none;
}

.light-mode .story-view-hero-insight,
.light-mode .story-view-hero-favicons {
  background: rgba(255, 255, 255, 0.9);
  color: #333333;
  text-shadow: none;
}

.light-mode .story-view-hero-overlay {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 1) 100%);
}

.light-mode .story-view-section-overlay {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 80%, rgba(255, 255, 255, 1) 100%);
}

.light-mode .story-view-section-headline {
  color: #111111;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.light-mode .story-view-quote-card {
  background: rgba(240, 240, 255, 0.95);
  border: 1px solid #e0e0e0;
  color: #333333;
}

.light-mode .story-view-quote-content::before {
  color: #e63946;
}

.light-mode .story-view-quote-speaker {
  color: #111111;
}

.light-mode .story-view-facts-container {
  background: rgba(255, 255, 255, 0.95);
  
}

.light-mode .story-view-facts-title {
  color: #666666;
}

.light-mode .story-view-fact-item {
  color: #333333;
}

.light-mode .story-view-fact-item:before {
  color: #e63946;
}

.light-mode .story-view-stat-card {
  background: rgba(240, 245, 255, 0.9);
  border-bottom: 2px solid #4951b6;
}

.light-mode .story-view-stat-name {
  color: #666666;
}

.light-mode .story-view-stat-value {
  color: #111111;
}

.light-mode .story-view-related-news-section {
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(230, 57, 70, 0.3);
}

.light-mode .story-view-related-news-heading {
  color: #111111;
}

.light-mode .story-view-related-news-card {
  background: #ffffff;
  border-left: 3px solid var(--story-view-accent-color);
}

.light-mode .story-view-related-news-fact {
  color: #333333;
}

.light-mode .story-view-citation-bottom-sheet {
  background: #f5f5f7;
  
}

.light-mode .story-view-citation-sheet-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .story-view-citation-sheet-title {
  color: #111111;
}

.light-mode .story-view-citation-close-btn {
  color: #333333;
}

.light-mode .story-view-citation-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .story-view-citation-domain {
  color: #111111;
}

.light-mode .story-view-citation-text {
  color: rgba(0, 0, 0, 0.8);
}

.light-mode .story-view-tabs-container {
  background: rgba(255, 255, 255, 0.9);
}

.light-mode .story-view-tabs-nav {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .story-view-tab-button {
  color: #555555;
}

.light-mode .story-view-tab-button.active {
  color: #111111;
}

.light-mode .story-view-tabs-overlay {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.light-mode .story-view-tab-section-title {
  color: #666666;
}

.light-mode .story-view-floating-actions-container {
  background: white;
}

.light-mode .story-view-action-btn {
  background: transparent;
    color: #333333;
    /* border: 1px solid rgba(230, 57, 70, 0.3); */
    box-shadow: none;
}

.light-mode .story-view-toast-container {
  background-color: #ffffff;
  color: #333333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #e63946;
}

.light-mode .story-view-splash-screen {
  background-color: #f5f5f7;
}

.light-mode .story-view-hero-timestamp {
  color: #666666;
}

.light-mode .story-view-hero-timing-container {
  background: rgba(255, 255, 255, 0.9);
  text-shadow: none;
}

.light-mode .story-view-video-card {
  background: #ffffff;
}

.light-mode .story-view-video-tag {
  background: rgba(230, 57, 70, 0.1);
}

.light-mode .story-view-scroll-indicator {
  background: rgba(230, 57, 70, 0.2);
  color: var(--story-view-accent-color);
}

.light-mode .story-view-article-progress-container {
  background: rgba(0, 0, 0, 0.1);
}

.light-mode .story-view-section-marker {
  background: rgba(0, 0, 0, 0.2);
}

.light-mode .story-view-like-btn.active,
.light-mode .story-view-dislike-btn.active,
.light-mode .story-view-save-btn.active {
  color: white;
}

.light-mode .story-view-like-btn.active {
  background: rgba(46, 125, 50, 0.9);
  border-color: rgba(46, 125, 50, 0.6);
}

.light-mode .story-view-dislike-btn.active {
  background: rgba(198, 40, 40, 0.9);
  border-color: rgba(198, 40, 40, 0.6);
}

.light-mode .story-view-save-btn.active {
  background: rgba(33, 150, 243, 0.9);
  border-color: rgba(33, 150, 243, 0.6);
}

.story-view-floating-home-btn {
  position: fixed;
  bottom: 10px;
  left: 10px;
  background: rgb(30 30 30 / 100%);
  color: #e0e0e0;
  border-radius: 50px;
  padding: 5px 20px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 1);
  z-index: 100;
  font-family: var(--font-main);
  transition: all 0.3s ease;
  border: 1px solid rgb(230 57 70 / 83%);

}

.story-view-floating-home-btn.visible {
  transform: translateY(0);
  opacity: 1;
}

/* Storyline integration styles */
.article-modal.storyline-mode {
  background-color: #000;
  /* Darker backdrop for storyline */
}

.article-modal-content.storyline-mode {
  max-width: 100%;
  width: 100%;
  background-color: #000;
  /* Match storyline background */
}

.story-view-article-card {
  height: 100%;
  width: 100%;
  box-shadow: 0 0 1px;
  position: relative;
}

.article-modal.storyline-mode .article-modal-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30000;

  padding: 10px;
  pointer-events: auto;
  border-bottom: none;
  display: none;
}

.article-modal.storyline-mode .modal-close-button {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px;
}

#article-content-container {
  height: 100%;

}

.story-view-container {
  width: 100%;
  height: 100%;
  padding-bottom: 7rem;
}


.article-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 15, 18, 0.9);
  z-index: 2000;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, height 0s 0.3s;
  max-width: 100%;
  overflow-x: hidden;
  height: 0px;
}

.article-modal.active {
  opacity: 1;
  pointer-events: auto;
  height: 100%;
  transition: opacity 0.3s ease, height 0s;
}

.article-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1000px;
  margin: 0 auto;
  background-color: #110f12;
  overflow-y: auto;
  transform: translateY(50px);
  transition: transform 0.3s ease;
  box-sizing: border-box;
  overflow-x: hidden;
  padding-bottom: 60px;
}

.article-modal.active .article-modal-content {
  transform: translateY(0);
}

.article-modal-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  padding: 1rem;
  background-color: #110f12;
  border-bottom: 1px solid #333;
  z-index: 1;
}

.modal-close-button {
  background: none;
  border: none;
  color: #fff;
  padding: 8px;
  cursor: pointer;
  margin-right: 12px;
}

.article-modal-title {
  flex-grow: 1;
  margin: 0;
  font-size: 1.2rem;
  color: #fff;
  text-align: left;
  font-weight: 200;
}

.article-modal-body {
  padding: 0;

  overflow-y: auto;
}





/* Light Mode Styles */
body.light-mode .article-modal {
  background-color: rgba(249, 249, 249, 0.9);
}

body.light-mode .article-modal-content {
  background-color: #f9f9f9;
}

body.light-mode .article-modal-header {
  background-color: #f9f9f9;
  border-bottom: 1px solid #ddd;
}

body.light-mode .modal-close-button {
  color: #333;
}

body.light-mode .article-modal-title {
  color: #333;
}

/* Animation for modal entry */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments */
@media (min-width: 768px) {
  .article-modal-content {
    height: 90%;
    margin-top: 2.5%;
    border-radius: 8px;
  }

  .article-modal-header {
    border-radius: 8px 8px 0 0;
  }
}




/* styles for vertical scroll view */

.story-view-vertical-scroll-container {
  width: 100%;
  height: 90vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  position: relative;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-top: 4vh;
  /* scroll-behavior: smooth; */
  padding-top: 5vh;
  
  scroll-snap-align: start;
}

.story-view-vertical-scroll-container::-webkit-scrollbar {
  display: none;
}
.cat-article-actions.active, .article-actions.active {
  display: none;
}


.story-view-card-wrapper {
  height: 75vh;
  display: flex;
  
  justify-content: flex-start;
  scroll-snap-align: center;
  position: relative;
  box-sizing: border-box;
  margin-bottom: 1rem;
  margin-top: 1vh;
  scroll-snap-stop: always;
  /* box-shadow: 0 0 5px 5px rgba(186, 104, 200, 0.4); */
  border-radius: 15px;
  /* box-shadow: 0 0 1px; */
  flex-direction: column;
  
}

.story-view-card-inner {
  width: 100%;
  max-width: 800px;
  height: 70vh;
  border-radius: var(--story-view-border-radius, 10px);
  overflow: hidden;
  box-shadow: var(--story-view-card-shadow, 0 2px 10px rgba(0, 0, 0, 0.3));
  
}

/* Error card styling */
.story-view-error-card,
.story-view-other-places-card {
  width: 100%;
  max-width: 800px;
  min-height: 400px;
  margin: 1rem auto;
  border-radius: var(--story-view-border-radius, 10px);
  overflow: hidden;
  box-shadow: var(--story-view-card-shadow, 0 2px 10px rgba(0, 0, 0, 0.3));
  background: var(--story-view-card-bg, #1e1e1e);
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--story-view-text-color, #e0e0e0);
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  position: relative;
  box-sizing: border-box;
  margin-bottom: 1rem;
}



/* Other places card styling */
.other-places-header {
  font-size: 1.5rem;
  font-weight: 200;
  margin: 1rem 0;
  text-align: center;
  line-height: 1.5;
  color: var(--story-view-heading-color, #ffffff);
}

.other-places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  width: 100%;
}

.other-grid-item {
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(30, 30, 30, 0.5);
  transition: all 0.2s ease;
}



.other-grid-item p {
  margin-top: 0;
  line-height: 1.5;
  font-size: 0.9rem;
}

.other-grid-item-button {
  margin-top: 1rem;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 0.9rem;
  font-weight: 500;
}



/* Loading button styles */
.cat-floating-load-more-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.cat-floating-load-more {
  background: var(--story-view-accent-color, #e63946);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 2rem;
  font-family: var(--story-view-font-main, 'Raleway', sans-serif);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}



/* Responsive adjustments */
@media (max-width: 768px) {
  /* .story-view-vertical-scroll-container {
    width: 95%;
  } */

  .story-view-card-wrapper {
    height: 75vh;
  }

  .story-view-card-inner {
    height: 70vh;
  }

  .other-places-header {
    font-size: 1.2rem;
  }

  .other-places-grid {
    grid-template-columns: 1fr;
  }
}

/* Light mode styles */
.light-mode .story-view-error-card,
.light-mode .story-view-other-places-card {
  background: var(--story-view-card-bg, #ffffff);
  color: var(--story-view-text-color, #333333);
}

.light-mode .other-grid-item {
  background: rgba(240, 240, 240, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.1);
}


.light-mode .other-grid-item-button {
  background: rgba(0, 0, 0, 0.05);
}









.story-view-action-icon {
  width: 2.5vh;
  height: 2.5vh;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease, fill 0.3s ease;
}

/* Like button styles */
.story-view-like-btn.active {
  background: rgba(46, 125, 50, 0.9);
  color: white;
  border-color: rgba(46, 125, 50, 0.6);
}

.story-view-like-btn.active .action-icon {
  animation: pulse 0.4s ease-out;
  fill: white;
}

.story-view-like-btn.active svg {
  stroke: white;
}

/* Dislike button styles */
.story-view-dislike-btn.active {
  background: rgba(198, 40, 40, 0.9);
  color: white;
  border-color: rgba(198, 40, 40, 0.6);
}

.story-view-dislike-btn.active .action-icon {
  animation: pulse 0.4s ease-out;
  fill: white;
}

.story-view-dislike-btn.active svg {
  stroke: white;
}

/* Save button styles */
.story-view-save-btn.active {
  background: rgba(33, 150, 243, 0.9);
  color: white;
  border-color: rgba(33, 150, 243, 0.6);
}

.story-view-save-btn.active .action-icon {
  fill: white;
  stroke: white;
  animation: bounce 0.4s ease-out;
}

.story-view-save-btn.active svg {
  stroke: white;
  fill: rgba(255, 255, 255, 0.7);
}

/* Share button styles */


.story-view-share-btn:active .action-icon {
  animation: rotate 0.4s ease-out;
}



/* Animation keyframes */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

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

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Ripple effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple 0.6s linear;
  z-index: 1;
}

@keyframes ripple {
  to {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* Media query for mobile devices */
@media (max-width: 768px) {
  .story-view-floating-actions-container {
    left: auto;
    right: 0px;
    bottom: 0px;
    flex-direction: row;
    gap: 0px;
  }
}


body.light-mode .story-view-like-btn.active {
  background: rgba(46, 125, 50, 0.9);
  color: white;
  border-color: rgba(46, 125, 50, 0.6);
}

body.light-mode .story-view-like-btn.active .action-icon {
  animation: pulse 0.4s ease-out;
  fill: white;
}

body.light-mode .story-view-like-btn.active svg {
  stroke: white;
}

body.light-mode .story-view-dislike-btn.active {
  background: rgba(198, 40, 40, 0.9);
  color: white;
  border-color: rgba(198, 40, 40, 0.6);
}

body.light-mode .story-view-dislike-btn.active .action-icon {
  animation: pulse 0.4s ease-out;
  fill: white;
}

body.light-mode .story-view-dislike-btn.active svg {
  stroke: white;
}

body.light-mode .story-view-save-btn.active {
  background: rgba(33, 150, 243, 0.9);
  color: white;
  border-color: rgba(33, 150, 243, 0.6);
}

body.light-mode .story-view-save-btn.active .action-icon {
  animation: bounce 0.4s ease-out;
  fill: white;
}

body.light-mode .story-view-save-btn.active svg {
  stroke: white;
  fill: rgba(255, 255, 255, 0.7);
}

.story-view-modal-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.9);
  padding: 12px 20px;
  z-index: 10001;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
}

.story-view-modal-bottom-nav.hidden {
  transform: translateY(100%);
}

.story-view-modal-bottom-nav-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.story-view-modal-back-btn {
  background: transparent;
  color: #e0e0e0;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--story-view-font-main);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  padding-left: 0px;
}

body.light-mode .story-view-modal-back-btn {
  color: #333;
}


/* Light mode styles */
.light-mode .story-view-modal-bottom-nav {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}


/* Card Carousel Styles */
.story-view-card-carousel-container {
  width: 100%;
  margin: 0;
  position: relative;
  background: transparent;
  border-radius: 8px;
  overflow: hidden;
  padding-left: 0.5rem;
  background: #24162eff;
}

body.light-mode .story-view-card-carousel-container {
  background: white;
}

.story-view-card-carousel-wrapper {
  width: 100%;
  overflow: hidden;
}

.story-view-card-carousel-track {
  display: flex;
  width: 100%;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  
}

.story-view-card-carousel-track::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.story-view-card-carousel-item {
  flex: 0 0 calc(100% - 0.5rem);
  min-width: 90%;
  scroll-snap-align: start;
  padding: 1rem;
  box-sizing: border-box;
  padding-right: 0.5rem;
  padding-left: 0rem;
}

.story-view-card-carousel-indicators {
  display: flex;
  justify-content: left;
  gap: 8px;
  padding: 0rem;
  padding-left: 0.5rem;
}

.story-view-card-carousel-indicator {
  width: 0.6vh;
  height: 0.6vh;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.story-view-card-carousel-indicator.active {
  background-color: var(--story-view-accent-color, #e63946);
}

/* Carousel Item Styles */
.story-view-card-carousel-quote,
.story-view-card-carousel-stat,
.story-view-card-carousel-fact,
.story-view-card-carousel-insight {
  position: relative;
  padding: 0.5rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  height: 12vh;
  justify-content: center;
}

/* Type labels */
.story-view-card-carousel-type-label {
  position: absolute;
  top: 0;
  left: 1rem;
  font-size: 0.6rem;
  padding: 2px 8px;
  border-radius: 4px;
  
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 400;
}

/* Quote specific styles */
.story-view-card-carousel-quote {
  background: rgba(14, 15, 81, 0.2);
  border-left: 0.5px solid #3f51b5;
}

.story-view-card-carousel-quote .story-view-card-carousel-type-label {
  background-color: #3f51b542;
}

.story-view-card-carousel-quote-content {
  font-size: 1.5vh;
  line-height: 1.5;
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.5rem;
  
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-top: 1rem;
}

.story-view-card-carousel-quote-content::before {
  content: '"';
  position: absolute;
  left: 0;
  
  font-size: 2rem;
  color: #8c9eff;
  opacity: 0.7;
  line-height: 1;
}

.story-view-card-carousel-quote-speaker {
  font-weight: 400;
  font-size: 0.9rem;
  color: #b0b0b0;
  margin-top: auto;
  display: none;
}

/* Stat specific styles */
.story-view-card-carousel-stat {
  background: rgba(73, 75, 176, 0.2);
  border-left: 0.5px solid #4951b6;
}

.story-view-card-carousel-stat .story-view-card-carousel-type-label {
  background-color: #4951b673;
}

.story-view-card-carousel-stat-name {
  font-size: 1.5vh;
  color: #d0d0d0;
  margin-bottom: 0rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  
  font-weight: 200;
  padding-top: 0.5rem;
  padding-left: 0.5rem;
}

.story-view-card-carousel-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
  padding-left: 0.5rem;
  margin-top: 1rem;
  padding-bottom: 0.5rem;
}

/* Fact specific styles */
.story-view-card-carousel-fact {
  background: rgba(30, 30, 30, 0.9);
  border-left: 3px solid #e63946;
}

.story-view-card-carousel-fact .story-view-card-carousel-type-label {
  background-color: #e63946;
}

.story-view-card-carousel-fact-content {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #ffffff;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Insight specific styles */
.story-view-card-carousel-insight {
  background: rgba(0, 0, 0, 0.9);
  border-left: 0.5px solid #ffb300;
}

.story-view-card-carousel-insight .story-view-card-carousel-type-label {
  background-color: #ffb30094;
  
}

.story-view-card-carousel-insight-content {
  font-size: 1.5vh;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  
  padding-left: 0.5rem;
}

/* Light mode styles */
/* .light-mode .story-view-card-carousel-container {
  background: rgba(245, 245, 245, 0.7);
} */

.light-mode .story-view-card-carousel-indicator {
  background-color: rgba(0, 0, 0, 0.2);
}

.light-mode .story-view-card-carousel-indicator.active {
  background-color: var(--story-view-accent-color, #e63946);
}

.light-mode .story-view-card-carousel-quote {
  background: rgba(225, 225, 255, 0.2);
  border-left: 0.5px solid #3f51b5;
}

.light-mode .story-view-card-carousel-quote-content {
  color: #333333;
}

.light-mode .story-view-card-carousel-quote-speaker {
  color: #555555;
}

.light-mode .story-view-card-carousel-stat {
  background: rgba(225, 230, 255, 0.2);
  border-left: 0.5px solid #4951b6;
}

.light-mode .story-view-card-carousel-stat-name {
  color: #444444;
}

.light-mode .story-view-card-carousel-stat-value {
  color: #222222;
}

.light-mode .story-view-card-carousel-fact {
  background: rgba(255, 240, 240, 0.7);
  border-left: 3px solid #e63946;
}

.light-mode .story-view-card-carousel-fact-content {
  color: #333333;
}

.light-mode .story-view-card-carousel-insight {
  background: rgba(255, 245, 225, 0.2);
  border-left: 0.5px solid #ffb300;
}

.light-mode .story-view-card-carousel-insight-content {
  color: #333333;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .story-view-card-carousel-quote-content,
  .story-view-card-carousel-fact-content,
  .story-view-card-carousel-insight-content {
    -webkit-line-clamp: 4; /* Show fewer lines on mobile */
    line-height: 1.5;
  }
  
  .story-view-card-carousel-stat-value {
    font-size: 1.4rem;
  }
}



/* Category Section Styles */
.story-view-category-section {
  width: 95%;
  /* margin: 2rem auto; */
  position: relative;
  max-width: 800px;
  scroll-snap-align: center;
  position: relative;
  box-sizing: border-box;
  margin-bottom: 1rem;
  scroll-snap-stop: always;
}

/* Category Header Styles */
.story-view-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  position: relative;
  padding-top: 1rem;
  /* padding-left: 0rem; */
  padding-bottom: 0rem;
}

.category-details {
  color: red;
  font-size: 1.2rem;
  font-weight: 200;
  padding-bottom: 0.2rem;
}

.story-view-category-title {
  font-size: 2.2vh;
  font-weight: 600;
  color: var(--story-view-heading-color, #ffffff);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 70%;
}

.story-view-category-badge {
  font-size: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  position: absolute;
  top: 1.25rem;
  right: 0.5rem;
  
}

.story-view-category-badge.trending {
  background-color: var(--story-view-accent-color, #e63946);
  color: white;
}

.story-view-category-view-all {
  font-size: 0.8rem;
  color: var(--story-view-accent-color, #e63946);
  background: transparent;
  border: 1px solid var(--story-view-accent-color, #e63946);
  border-radius: 4px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: none;
}



/* Horizontal Scroll Container */
.story-view-category-scroll-container {
  position: relative;
  width: 100%;
  height: 42vh;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  scroll-behavior: smooth;
  padding: 1rem;
  padding-left: 0.5rem;
  margin-left: -0.5rem;
}

.story-view-category-scroll-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Scroll Track */
.story-view-category-scroll-track {
  display: inline-flex;
  padding: 0 1rem;
  height: 100%;
  width: 100%;
  padding-left: 0rem;
}

/* Category Card Wrapper */
.story-view-category-card-wrapper {
  flex: 0 0 80%;
  min-width: 80%;
  height: 40vh;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  
  box-sizing: border-box;
  position: relative;
  padding-left: 0rem;
  transform: translateZ(0);
  will-change: transform;
  /* box-shadow: 0 0 15px 5px rgba(186, 104, 200, 0.4); */
  /* border-radius: 15px; */
  margin-right: 1rem;
  box-shadow: 0 0 1px;
}

.story-view-category-card-wrapper .skimmed-badge {
  right: 10px;
  border-radius: 0px;
}

.story-view-has-updates-tag {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 0.6rem;
  padding: 4px 8px;
  background: #460046;
  color: white;
  z-index: 2;
  border: 0.1px solid rgba(0, 0, 0, 0.7);
  border-left: 0px;
  
}

/* Category Article Card */
.story-view-category-article-card {
  width: 100%;
  height: 100%;
  box-shadow: var(--story-view-card-shadow, 0 2px 10px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
  border-radius: 15px;
}



/* Navigation Buttons */
.story-view-category-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.3s ease;
  padding: 0;
  display: none;
}

.story-view-category-scroll-btn.visible {
  opacity: 0.8;
}



.story-view-category-scroll-left {
  left: 10px;
}

.story-view-category-scroll-right {
  right: 10px;
}

/* Empty State */
.story-view-category-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--story-view-text-color, #e0e0e0);
  opacity: 0.7;
  font-style: italic;
}

/* Adjustments for category card hero sections */
.story-view-category-article-card .story-view-hero-section {
  height: 40vh;
}

/* Scale down headlines and text for category cards */
.story-view-category-article-card .story-view-hero-headline {
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow: visible;
  text-overflow: initial;
  line-height: 1.1;
  max-height: none;
  margin-bottom: 0.5rem;
  font-size: 2vh;
  background: inherit;
  padding: 1rem;
  height: auto;
  display: block;
  font-weight: 500;
}

.story-view-category-article-card .story-view-card-carousel-container {
  display: none;
}

.story-view-category-article-card .story-view-hero-insight {
  font-size: 1.4vh;
  display: none;
}

.story-view-category-article-card .story-view-hero-favicon,
.story-view-category-article-card .story-view-favicon-counter {
  width: 15px;
  height: 15px;
  font-size: 0.5rem;
}

.story-view-category-article-card .story-view-floating-actions-container {
  gap: 0px;
}


/* Responsive adjustments */
@media (max-width: 768px) {
  .story-view-category-section {
    
    /* margin: 1.5rem auto; */
    margin-top: 2rem;
  }
  
  .story-view-category-card-wrapper {
    flex: 0 0 85%;
    min-width: 85%;
  }
}

/* Light mode styles */
.light-mode .story-view-category-header {
  color: var(--story-view-text-color, #333333);
}

.light-mode .story-view-category-title {
  color: var(--story-view-heading-color, #111111);
}

.light-mode .story-view-category-scroll-btn {
  background: rgba(230, 57, 70, 0.2);
  color: var(--story-view-accent-color, #e63946);
}



.light-mode .story-view-category-empty {
  color: #888888;
}


/* Reset positioning for iOS */
/* Add this CSS to the end of your stylesheet */

/* Make category article cards use flexbox layout */
.story-view-category-article-card .story-view-hero-section {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Make background image take only available space */
.story-view-category-article-card .story-view-hero-background {
  position: relative;
  flex: 1; /* Take up available space */
  min-height: 0; /* Allow it to shrink */
  overflow: hidden; /* Prevent overflow */
  display: flex;
}

.story-view-category-article-card .story-view-hero-background img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.8);
  animation: story-view-panBackground 30s linear infinite;
  animation-play-state: paused;
  background-repeat: repeat-x;
}

/* Position content at the bottom with fixed size */
.story-view-category-article-card .story-view-hero-content {
  flex: 0 0 auto; /* Don't grow or shrink, use natural size */
  position: relative;
  z-index: 1;
  width: 100%;
}

/* Ensure iOS properly renders */
.story-view-category-article-card,
.story-view-category-card-wrapper {
  transform: translate3d(0,0,0); /* Force hardware acceleration */
}

/* Fix iOS horizontal scrolling */
.story-view-category-scroll-container {
  -webkit-overflow-scrolling: touch;
}


.story-view-action-icon {
  width: 2vh;
  height: 2vh;
}

/* Default (dark mode) icons */
.story-view-like-btn .story-view-action-icon {
  content: url('/static/images/like_dark.png');
}

.story-view-dislike-btn .story-view-action-icon {
  content: url('/static/images/dislike_dark.png');
}

.story-view-save-btn .story-view-action-icon {
  content: url('/static/images/save_dark.png');
}

.story-view-share-btn .story-view-action-icon {
  content: url('/static/images/share_dark.png');
}

/* Light mode icons */
body.light-mode .story-view-like-btn .story-view-action-icon {
  content: url('/static/images/like_light.png');
}

body.light-mode .story-view-dislike-btn .story-view-action-icon {
  content: url('/static/images/dislike_light.png');
}

body.light-mode .story-view-save-btn .story-view-action-icon {
  content: url('/static/images/save_light.png');
}

body.light-mode .story-view-share-btn .story-view-action-icon {
  content: url('/static/images/share_light.png');
}




/* For related cards */
/* CSS Updates for Related Articles Feature */

.story-view-card-with-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  /* scroll-snap-align: center; */
  position: relative;
  scroll-snap-stop: always;
  padding-left: 4px;
  padding-right: 4px;
}

/* Styling for the hashtag header */
.story-view-hashtag-header {
      /* background-color: #1e1e1e; */
  padding: 12px 16px;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 10px;
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
  cursor: pointer;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-left: 0px;
  padding-bottom: 1vh;
  padding-top: 3vh;
  position: sticky;
  top: -2.5vh;
  z-index: 998;
  /* margin-left: -0.5rem;
  margin-right: -0.5rem; */
  background: black;
  padding-left: 0.5rem;
  
  padding-top: 3vh;
  padding-bottom: 1vh;
  padding-left: 0.5rem;
  width: calc(100% - 1.5rem);
}

.story-view-hashtag-header::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome/Safari/Opera */
}

/* Individual hashtag styling - matches your screenshot */
.story-view-hashtag {
  display: inline-block;
  padding: 8px 14px;
  background-color: #292929;
  color: #ffffff;
  font-size: 1.5vh;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.story-view-hashtag:hover {
  background-color: #3a3a3a;
}

/* More tag styling */
.story-view-hashtag-more {
  display: inline-block;
  padding: 8px 14px;
  background-color: #2a2a2a;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  border-radius: 20px;
  white-space: nowrap;
}

/* Modify the card wrapper to work with the header */
.story-view-card-wrapper {
  height: 70vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
  scroll-snap-align: center;
  /* box-shadow: 0 0 5px 5px rgba(186, 104, 200, 0.4); */
  
  
  border-radius: 15px;
  /* box-shadow: 0 0 1px; */
}

/* Light mode styles */
body.light-mode .story-view-hashtag-header {
  background-color: white;
  /* border-bottom: 1px solid rgba(0, 0, 0, 0.1); */
}

body.light-mode .story-view-hashtag {
  background-color: rgba(0, 0, 0, 0.05);
  color: #000;
}

body.light-mode .story-view-hashtag:hover {
  background-color: #d6d6d6;
}

body.light-mode .story-view-hashtag-more {
  background-color: #e6e6e6;
  color: rgba(0, 0, 0, 0.7);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  /* .story-view-hashtag-header {
    padding: 10px 12px;
  } */
  
  .story-view-hashtag {
    font-size: 1.5vh;
    /* padding: 6px 12px; */
  }
  
  .story-view-hashtag-more {
    font-size: 0.85rem;
    padding: 6px 12px;
  }
}

/* Related Articles Section */
.story-view-related-articles-section {
  height: 70vh;
  position: relative;
  
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  /* margin-top: 1rem; */
  margin-bottom: 0rem;
  padding-right: 4px;
  padding-left: 4px;
}

.story-view-related-articles-section.single {
  height: 31vh;
  margin-top: 0;
}
.story-view-related-articles-section.double {
  height: calc(44vh + 1rem);
}

.story-view-related-articles-header {
  padding: 1rem;
  display: none;
  padding-left: 0;
}

.story-view-related-topics-container {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.story-view-related-topics-container::-webkit-scrollbar {
  display: none;
}

.story-view-related-topic-tag {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  margin-right: 0.5rem;
  background: rgba(73, 75, 176, 0.15);
  color: #8c9eff;
  font-size: 0.8rem;
  border-radius: 20px;
  white-space: nowrap;
}

.story-view-related-topic-more {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  margin-right: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  border-radius: 20px;
  white-space: nowrap;
}

.story-view-related-articles-title {
  font-size: 2.5vh;
  font-weight: 600;
  color: var(--story-view-heading-color, #ffffff);
  margin: 0.5rem 0 0 0;
  padding-left: 0.5rem;
}

/* Common styles for related article cards */
.story-view-related-single-card,
.story-view-related-stacked-card,
.story-view-related-compact-card,
.story-view-related-side-card {
  
  border-radius: var(--story-view-border-radius, 10px);
  overflow: hidden;
  /* box-shadow: var(--story-view-card-shadow, 0 2px 10px rgba(0, 0, 0, 0.3)); */
  /* box-shadow: 0 0 15px 5px rgba(186, 104, 200, 0.4); */
  position: relative;
  box-shadow: 0 0 1px;
}

.story-view-related-favicons-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.story-view-related-favicon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 0.1px solid rgba(0, 0, 0, 0.1);
}

.story-view-related-favicon-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(128, 128, 128, 0.2);
  color: #9e9e9e;
  font-size: 10px;
  font-weight: 500;
}

/* Single article layout (for 1 related article) */
.story-view-related-single-layout {
  flex: 1;
  
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-view-related-single-card {
  width: 100%;
  height: 30vh;
  display: flex;
  margin: 0 auto;
}

.story-view-related-card-content {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.story-view-related-card-headline {
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--story-view-heading-color, #ffffff);
  margin: 0 0 1rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-view-related-card-sources {
  display: flex;
  align-items: center;
}

.story-view-related-card-image {
  flex: 0 0 40%;
  height: 100%;
  overflow: hidden;
}

.story-view-related-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Stacked layout (for 2 related articles) */
.story-view-related-stacked-layout {
  flex: 1;
  
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.story-view-related-stacked-card {
  flex: 1;
  display: flex;
  height: calc(50% - 0.5rem);
}

.story-view-related-stacked-content {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.story-view-related-stacked-headline {
  font-size: 2vh;
  font-weight: 400;
  line-height: 1.3;
  color: var(--story-view-heading-color, #ffffff);
  margin: 0 0 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-view-related-stacked-summary {
  font-size: 0.9rem;
  color: var(--story-view-text-color, #e0e0e0);
  opacity: 0.8;
  margin: 0 0 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-view-related-stacked-sources {
  display: flex;
  align-items: center;
}

.story-view-related-stacked-image {
  flex: 0 0 35%;
  height: 100%;
  overflow: hidden;
}

.story-view-related-stacked-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Three article layout (1 top, 2 side-by-side) */
.story-view-related-three-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  
  gap: 1rem;
}

.story-view-related-top-article {
  width: 100%;
  height: 20vh;
}

.story-view-related-bottom-row {
  flex: 1;
  display: flex;
  gap: 1rem;
  height: calc(44vh + 2rem);
  flex-direction: column;
}

.story-view-related-compact-card {
  height: 100%;
  width: 100%;
  display: flex;
}

.story-view-related-compact-content {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.story-view-related-compact-headline {
  font-size: 1.7vh;
  font-weight: 400;
  line-height: 1.3;
  color: var(--story-view-heading-color, #ffffff);
  margin: 0 0 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-view-related-compact-sources {
  display: flex;
  align-items: center;
}

.story-view-related-compact-image {
  flex: 0 0 30%;
  height: 100%;
  overflow: hidden;
  background: rgb(255, 255, 255, 0.8);
}

.story-view-related-compact-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-view-related-side-card {
  height: 22vh;
  display: flex;
  flex-direction: row;
}



.story-view-related-side-image {
  flex: 0 0 60%;
  overflow: hidden;
  background: rgb(255, 255, 255, 0.8);
}

.story-view-related-side-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-view-related-side-content {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.story-view-related-side-headline {
  font-size: 1.7vh;
  font-weight: 400;
  line-height: 1.3;
  color: var(--story-view-heading-color, #ffffff);
  margin: 0 0 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-view-related-side-sources {
  display: flex;
  align-items: center;
}

/* Light mode styles */
.light-mode .story-view-matching-topics-header,
.light-mode .story-view-related-articles-header {
  /* background-color: var(--story-view-bg-color, #fff); */
  /* background-color: white; */
  border-bottom: none;
}
.light-mode .story-view-matching-topics-header {
  background-color: white;
}

.light-mode .story-view-matching-topic-tag,
.light-mode .story-view-related-topic-tag {
  background: none;
  color: #3f51b5;
}

.light-mode .story-view-matching-topic-more,
.light-mode .story-view-related-topic-more {
  
  color: rgba(0, 0, 0, 0.6);
}

.light-mode .story-view-related-articles-title {
  color: var(--story-view-heading-color, #111111);
}

/* .light-mode .story-view-related-single-card,
.light-mode .story-view-related-stacked-card,
.light-mode .story-view-related-compact-card,
.light-mode .story-view-related-side-card {
  
  box-shadow: var(--story-view-card-shadow, 0 2px 10px rgba(0, 0, 0, 0.1));
} */

.light-mode .story-view-related-card-headline,
.light-mode .story-view-related-stacked-headline,
.light-mode .story-view-related-compact-headline,
.light-mode .story-view-related-side-headline {
  color: var(--story-view-heading-color, #111111);
}

.light-mode .story-view-related-stacked-summary {
  color: var(--story-view-text-color, #333333);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .story-view-related-card-headline {
    font-size: 2.2vh;
    -webkit-line-clamp: 7;
  }
  
  .story-view-related-stacked-headline {
    font-size: 2vh;
    -webkit-line-clamp: 6;
  }
  
  .story-view-related-stacked-summary {
    display: none; /* Hide summary on mobile for space */
  }
  
  .story-view-related-side-image {
    flex: 0 0 30%; /* Reduce image height on mobile */
  }
}


.story-view-video-scroll-section-main-feed .story-view-video-card .watch-badge {
  top: 0;
  right: 0;
  border-top-right-radius: 10px;
}



/* Personalization overlay */

/* Personalization Overlay and Panel Styles */
.personalization-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.personalization-overlay.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}

.personalization-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #100e1b;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  padding-bottom: env(safe-area-inset-bottom, 20px);
  display: flex;
  flex-direction: column;
}

.personalization-panel.active {
  transform: translateY(0);
}

body.light-mode .personalization-panel {
  background-color: #ffffff;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.personalization-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background-color: #100e1b;
  z-index: 10;
}

body.light-mode .personalization-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background-color: #ffffff;
}

.personalization-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  color: #ffffff;
}

body.light-mode .personalization-title {
  color: #111111;
}

.personalization-subtitle {
  font-size: 0.9rem;
  color: #9e9e9e;
  margin-top: 4px;
}

body.light-mode .personalization-subtitle {
  color: #666666;
}

.personalization-close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

body.light-mode .personalization-close-btn {
  color: #111111;
}

.personalization-topics-list {
  padding: 16px 20px;
  flex: 1;
  overflow-y: auto;
}

.personalization-topic-item {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.personalization-topic-item:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

body.light-mode .personalization-topic-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.personalization-topic-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  
}

.personalization-topic-name-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.personalization-topic-name {
  font-size: 1.1rem;
  font-weight: 500;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.personalization-topic-name:hover {
  text-decoration: underline;
}

.personalization-topic-name::after {
  content: " >";
  color: #8c9eff;
  margin-left: 5px;
}

body.light-mode .personalization-topic-name {
  color: #111111;
}

.personalization-topic-subtext {
  font-size: 0.85rem;
  color: #9e9e9e;
  margin: 6px 0 0 0;
  font-style: italic;
  width: 50%;
}

body.light-mode .personalization-topic-subtext {
  color: #777777;
}

.personalization-slider-container {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: end;
  height: 5vh;
}

.personalization-weight-label {
  font-size: 0.9rem;
  color: #ffffff;
  font-weight: 500;
  margin-left: 10px;
}

body.light-mode .personalization-weight-label {
  color: #333333;
}

/* Rectangle Pill Slider Styles */
.personalization-pill-slider {
  position: relative;
  height: 24px;
  display: flex;
  justify-content: space-between;
  width: calc(100% - 50px);
  cursor: pointer;
  touch-action: none;
  max-width: 50%;
}

.personalization-pill {
  flex: 1;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.1);
  margin: 0 1px;
  transition: background-color 0.2s ease;
  position: relative;
}

.personalization-pill:first-child {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.personalization-pill:last-child {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

body.light-mode .personalization-pill {
  background-color: rgba(0, 0, 0, 0.1);
}

.personalization-pill.active {
  background-color: #8c9eff;
}

body.light-mode .personalization-pill.active {
  background-color: #3f51b5;
}

/* Interest level colors - purple gradient */
.interest-high .personalization-pill.active {
  background-color: #5e35b1; /* Deep purple */
}

.interest-medium .personalization-pill.active {
  background-color: #7e57c2; /* Medium purple */
}

.interest-low .personalization-pill.active {
  background-color: #9575cd; /* Light purple */
}

.interest-very-low .personalization-pill.active {
  background-color: #b39ddb; /* Very light purple */
}

.interest-none .personalization-pill.active {
  background-color: #d1c4e9; /* Extremely light purple/gray */
}

/* Light mode colors - darker purple tones */
body.light-mode .interest-high .personalization-pill.active {
  background-color: #4527a0; /* Darker deep purple for light mode */
}

body.light-mode .interest-medium .personalization-pill.active {
  background-color: #5e35b1; /* Darker medium purple for light mode */
}

body.light-mode .interest-low .personalization-pill.active {
  background-color: #7e57c2; /* Darker light purple for light mode */
}

body.light-mode .interest-very-low .personalization-pill.active {
  background-color: #9575cd; /* Darker very light purple for light mode */
}

body.light-mode .interest-none .personalization-pill.active {
  background-color: #b39ddb; /* Darker extremely light purple/gray for light mode */
}

/* Pill slider animation */
@keyframes pulse-pill {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

.personalization-pill.recently-selected {
  animation: pulse-pill 0.3s ease;
}

/* Bottom action bars with smooth transitions */
.personalization-bottom-bar {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  bottom: 0;
  background-color: #100e1b;
  z-index: 10;
  transition: transform 0.3s ease, opacity 0.3s ease;
  height: 5vh;
}

body.light-mode .personalization-bottom-bar {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background-color: #ffffff;
}

.personalization-show-all {
  display: flex;
  justify-content: center;
  transform: translateY(0);
  opacity: 1;
  height: auto;
  transition: transform 0.3s ease, opacity 0.3s ease, height 0s linear 0.3s;
}

.personalization-show-all.hidden {
  transform: translateY(20px);
  opacity: 0;
  height: 0;
  padding: 0 20px;
  overflow: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, height 0s linear 0.3s;
}

.personalization-actions {
  display: flex;
  justify-content: space-between;
  transform: translateY(100%);
  opacity: 0;
  height: 0;
  
  overflow: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, height 0s linear 0.3s;
}

.personalization-actions.visible {
  transform: translateY(0);
  opacity: 1;
  height: auto;
  
  transition: transform 0.3s ease, opacity 0.3s ease, height 0s;
}

.personalization-button {
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 15px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s ease;
  flex-grow: 1;
  margin: 0 4px;
}

.personalization-show-all-btn {
  background-color: #5e35b1;
  color: white;
  border: none;
  border-right: 1px solid #959494;
  border-bottom: 1px solid #a6a5a5;
}

.personalization-show-all-btn:hover {
  background-color: #7986cb;
}

body.light-mode .personalization-show-all-btn {
  background-color: #3f51b5;
  color: #ffffff;
}

body.light-mode .personalization-show-all-btn:hover {
  background-color: #303f9f;
}

.personalization-save-btn {
  background-color: #e63946;
  color: white;
  border: none;
}

.personalization-save-btn:hover {
  background-color: #d32f2f;
}

.personalization-reset-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
}

body.light-mode .personalization-reset-btn {
  border: 1px solid rgba(0, 0, 0, 0.3);
  color: #333333;
}

.personalization-reset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

body.light-mode .personalization-reset-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Slider handle for touch/drag */
.personalization-slider-handle {
  position: absolute;
  top: 0;
  height: 24px;
  width: 5px;
  background-color: white;
  border-radius: 2px;
  z-index: 2;
  transform: translateX(-50%);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  display: none;
}

.personalization-slider-handle.dragging {
  display: block;
}

/* Quirky animations */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* .personalization-topic-item.updated {
  animation: pulse 0.5s ease;
} */

/* Responsive adjustments */
@media (max-width: 480px) {
  .personalization-topic-header {
    flex-direction: column;
  }
  
  .personalization-topic-name {
    margin-bottom: 6px;
  }
  
  .personalization-weight-label {
    margin-top: 6px;
  }
  
  .personalization-button {
    padding: 10px 8px;
    font-size: 0.85rem;
  }
}



/* New content grouping */

    /* Container for a group of related content */
    .story-view-content-group-container {
      position: relative;
      margin: 2rem 0;
      scroll-snap-align: start;
      box-sizing: border-box;
      width: 100%;
      scroll-snap-stop: always;
    }
    
    /* Sticky header for hashtags */
    .story-view-sticky-header {
      position: sticky;
      top: -1vh;
      z-index: 998;
      /* background-color: rgba(0, 0, 0, 0.8); */
      /* backdrop-filter: blur(8px); */
      /* -webkit-backdrop-filter: blur(8px); */
      /* border-radius: 8px 8px 0 0; */
      margin-bottom: 0;
      padding-top: 3vh;
      padding-bottom: 1vh;
      padding-left: 0.5rem;
    }
    
    /* body.light-mode .story-view-sticky-header {
      background-color: rgba(255, 255, 255, 0.8);
    } */
    
    /* Content wrapper for all items in the group */
    .story-view-content-group-wrapper {
      display: flex;
      flex-direction: column;
      gap: 1rem;
      margin-top: 1vh;
      padding-right: 4px;
      padding-left: 4px;
    }
    
    /* Main article wrapper */
    .story-view-main-article-wrapper {
      height: 70vh;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      box-sizing: border-box;
      /* box-shadow: 0 0 5px 5px rgba(186, 104, 200, 0.4); */
      
      overflow: hidden;
      margin-top: 0;
      scroll-snap-align: center;
      scroll-snap-stop: always;
      margin-top: 2rem;
      /* box-shadow: 0 0 1px; */
      border-radius: 0px;
    }
    
    /* When main article is the first item after a sticky header */
    /* .story-view-sticky-header + .story-view-content-group-wrapper .story-view-main-article-wrapper {
       border-radius: 0 0 15px 15px; 
      margin-top: 0;
    } */
    
    /* Related articles wrapper */
    .story-view-related-wrapper {
      
      scroll-snap-stop: always;
      scroll-snap-align: center;
    }
    
    /* Videos wrapper */
    .story-view-videos-wrapper {
      
      scroll-snap-align: center;
    }
    
    /* Prevent double box-shadow on content groups */
    .story-view-content-group-container .story-view-related-articles-section {
      box-shadow: none;
    }
    
    /* Adjust scroll-snap behavior */
    /* .story-view-vertical-scroll-container {
      scroll-snap-type: y proximity;
    } */
    
    /* Ensure tracking badges appear properly */
    /* .story-view-main-article-wrapper .skimmed-badge,
    .story-view-related-wrapper .skimmed-badge,
    .story-view-videos-wrapper .skimmed-badge {
      position: absolute;
      top: 10px;
      right: 10px;
      background-color: rgba(0, 0, 0, 0.7);
      color: white;
      padding: 4px 8px;
      border-radius: 4px;
      font-size: 0.8rem;
      display: flex;
      align-items: center;
      gap: 4px;
      z-index: 10;
      opacity: 0;
      transition: opacity 0.3s ease;
    } */
    
    .story-view-main-article-wrapper .skimmed-badge.visible,
    .story-view-related-wrapper .skimmed-badge.visible,
    .story-view-videos-wrapper .skimmed-badge.visible {
      opacity: 1;
    }
    .story-view-related-side-card .skimmed-badge {
      left: 10px;
      right: auto;
    }


    .categories-feed.subtopics-feed .story-view-hashtag-header {
      display: none;
    }





    /* Story View Progress Bar Styles */
.story-view-progress-bar,
.story-view-category-progress-bar {
  
  display: flex;
  align-items: center;
  background-color: #000;
  width: 100%;
  box-sizing: border-box;
  position: fixed;
  top: 5vh;
  left: 0;
  right: 0;
  height: 4vh;
  z-index: 999;
  padding-left: 1rem;
  padding-right: 0.5rem;
}

.story-view-category-progress-bar {
  height: 5vh;
  padding-top: 1vh;
}

.story-view-progress-bar {
  top: 0;
  height: 8vh;

}

/* Profile image */
.story-view-progress-profile-image {
  width: 3.2vh;
  height: 3.2vh;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 2vw;
  border: 0.1px solid;
  /* box-shadow: 0 0 2px 2px rgba(186, 104, 200, 0.4); */
}

/* Middle content section */
.story-view-progress-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Milestone row */
.story-view-progress-milestone-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

/* Current milestone (rank + flag) */
.story-view-progress-current-milestone {
  display: flex;
  align-items: center;
  max-width: 50%;
}

.story-view-progress-rank-text {
  font-size: 1.6vh;
  font-weight: 200;
  color: #fff;
  margin-right: 4px;
}

.story-view-progress-country-flag {
  height: 1.4vh;
}

/* Next milestone container (right side) */
.story-view-progress-next-milestone-container {
  display: flex;
  max-width: 50%;
  align-items: flex-end;
}

.story-view-progress-articles-to-rank {
  font-size: 1.2vh;
  color: #ccc;
}

.story-view-progress-next-milestone-highlight {
  font-size: 1.2vh;
  color: #ba68c8;
  text-align: right;
}

/* Progress container */
.story-view-progress-container {
  width: 100%;
  height: 0.5vh;
  background-color: #333;
  border-radius: 3px;
  overflow: hidden;
}

.story-view-progress-completed {
  height: 100%;
  width: 0;
  background: linear-gradient(to left, #9c27b0, #ff02ff);
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

/* Search icon */
.story-view-progress-search-container {
  margin-left: 3vw;
  cursor: pointer;
}

.story-view-progress-search-icon {
  width: 2.8vh;
  height: 2.8vh;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.story-view-progress-search-icon:hover {
  opacity: 1;
}

/* Animation for appearance */
@keyframes story-view-progress-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.story-view-progress-bar {
  animation: story-view-progress-fade-in 0.3s ease-out;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .story-view-progress-profile-image {
    width: 3.5vh;
    height: 3.5vh;
  }
  
  .story-view-progress-rank-text {
    font-size: 1.3vh;
  }
  
  .story-view-progress-articles-to-rank,
  .story-view-progress-next-milestone-highlight {
    font-size: 1vh;
  }
  
  .story-view-progress-search-icon {
    width: 2.2vh;
    height: 2.2vh;
  }
}

/* Light mode adjustments */
body.light-mode .story-view-progress-bar,
body.light-mode .story-view-category-progress-bar {
  background-color: #fff;
}

body.light-mode .story-view-progress-rank-text {
  color: #333;
}

body.light-mode .story-view-progress-articles-to-rank {
  color: #666;
}

body.light-mode .story-view-progress-container {
  background-color: #eee;
}

body.light-mode .story-view-progress-next-milestone-highlight {
  color: #333;
}

body.light-mode .story-view-progress-completed {
  background: linear-gradient(to left, #6d0dbd, #fbe1ff);
}

body.light-mode .story-view-progress-search-icon path {
  stroke: #333;
}

body.light-mode .tab-item.active {
  color: #6d0dbd;
  background-color: #fbe1ff;
}

.story-view-question-div {
  padding: 0.5rem;
  position: relative;
  scroll-snap-align: center;
  position: relative;
  box-sizing: border-box;
  margin-bottom: 1rem;
  scroll-snap-stop: always;
  /* box-shadow: 0 0 5px 5px rgba(186, 104, 200, 0.4); */
  border-bottom: 1px solid rgba(186, 104, 200, 0.4);
  border-top: 1px solid rgba(186, 104, 200, 0.4);
  margin-top: 4rem;
  
  
}

.story-view-question-header {
  font-size: 1.5vh;
  max-width: 90%;
  position: relative;
}

.story-view-question-header {
  font-size: 1.2vh;
}

.story-view-question-header-text {
  font-size: 1.5vh;
}

.story-view-question-header-text b {
  color: #ff02ff;
}

body.light-mode .story-view-question-header-text b {
  color: #6d0dbd;
}

.story-view-answer-text {
  font-size: 2.5vh;
}

.story-view-question-text {
  font-size: 1.5vh;
}

.story-view-question-chevron {
  font-size: 1.5vh;
  /* position: absolute; */
  right: 1rem;
  bottom: 1rem;
  background: #460046;
  color: #ff02ff;
  border-radius: 25px;
  font-weight: 800;
  padding: 0.5rem;
  text-align: center;
}

body.light-mode .story-view-question-chevron {
  background: #6d0dbd;
  color: #fbe1ff;
}


/* 
 * Horizontal Article Carousel Styles
 * These styles create a horizontal swipeable carousel 
 * for the main article and its related articles
 */

/* Main container for the carousel */
.horizontal-article-carousel {
  width: 100%;
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: auto;
  overflow-y: hidden;
  /* white-space: nowrap; */
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  gap: 1rem;
  flex-direction: row;
  padding-left: 3px;
  padding-right: 3px;
}

/* Scrollable track that holds all carousel items */
.horizontal-article-carousel-track {
  gap: 1rem;
  display: inline-flex;
  padding: 0 1rem;
  height: 100%;
  width: 100%;
  padding-left: 0rem;
}

/* Hide scrollbar */
.horizontal-article-carousel-track::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Individual carousel item */
.horizontal-article-carousel-item {
  flex: 0 0 90%;
  min-width: 90%;
  height: calc(100% - 3vh);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  
}




/* Make the article card take full height of carousel item */
.horizontal-article-carousel-item .story-view-article-card {
  height: 100%;
}
/* .horizontal-article-carousel-item .story-view-article-card.read {
  border-top: 1px solid rgba(255, 2, 255, 0.4);
} */

/* Ensure hero sections in carousel properly fill the space */
.horizontal-article-carousel-item .story-view-hero-section {
  height: 100%;
}

/* Container for the indicator dots */
.horizontal-article-carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
  /* padding: 8px 0; */
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 10;
  align-items: center;
}

/* Individual indicator dot */
.horizontal-article-carousel-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

/* Active indicator */
.horizontal-article-carousel-indicator.active {
  background-color: rgb(255, 2, 255);
  width: 10px;
  height: 10px;
}

/* Light mode styles */
body.light-mode .horizontal-article-carousel-indicator {
  background-color: rgba(0, 0, 0, 0.2);
}

body.light-mode .horizontal-article-carousel-indicator.active {
  background-color: var(--story-view-accent-color, #e63946);
}

/* Navigation arrows for wider screens */
.horizontal-article-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: white;
  font-size: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.horizontal-article-carousel:hover .horizontal-article-carousel-arrow {
  opacity: 0.7;
}

.horizontal-article-carousel-arrow:hover {
  opacity: 1 !important;
  background-color: rgba(0, 0, 0, 0.7);
}

.horizontal-article-carousel-prev {
  left: 10px;
}

.horizontal-article-carousel-next {
  right: 10px;
}

/* Hide arrows on mobile */
@media (max-width: 768px) {
  .horizontal-article-carousel-arrow {
    display: none;
  }
  
  /* Smaller indicators on mobile */
  .horizontal-article-carousel-indicator {
    width: 6px;
    height: 6px;
  }
  
  .horizontal-article-carousel-indicator.active {
    width: 8px;
    height: 8px;
  }
}

/* Ensure the skimmed badge appears properly on carousel items */
/* .horizontal-article-carousel-item .skimmed-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease;
} */

.horizontal-article-carousel-item .skimmed-badge.visible {
  opacity: 1;
}

/* Fix for iOS scroll behavior */
@supports (-webkit-touch-callout: none) {
  .horizontal-article-carousel-track {
    -webkit-overflow-scrolling: touch;
  }
  
  .horizontal-article-carousel-item {
    /* Force hardware acceleration on iOS */
    transform: translateZ(0);
    will-change: transform;
  }
}


/* .horizontal-article-carousel,
.horizontal-article-carousel-track {
  scroll-snap-type: none !important;
  scroll-behavior: auto !important;   /* stop “auto-replay” smooth scroll */
/* }

.horizontal-article-carousel-item {
  scroll-snap-align: none !important;
  scroll-snap-stop: normal !important;
} */ 

.horizontal-article-carousel-item .story-view-article-card #article-card-heroImage {
  animation: none;
  width: 100%;
}


.related-candidates-div {
  padding: 0.5rem;
  position: relative;
  scroll-snap-align: center;
  position: relative;
  box-sizing: border-box;
  background-color: #24162eff;
  scroll-snap-stop: always;
  /* box-shadow: 0 0 5px 5px rgba(186, 104, 200, 0.4); */
  border-bottom: 4px solid rgba(186, 104, 200, 1);
  border-top: 4px solid rgba(186, 104, 200, 1);
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
  box-shadow: 0 0 1px;
}

body.light-mode .related-candidates-div {
  background-color: white;
  
}


.related-candidates-div .story-view-question-chevron {
  min-width: 33%;
}



.floating-home-btn {
  position: fixed;
  bottom: 10px;
  left: 10px;
  background: #6d0dbd !important;
  color: #e0e0e0;
  border-radius: 50px;
  padding: 10px 20px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 1);
  z-index: 100;
  font-family: var(--font-main);
  transition: all 0.3s ease;
  border: 1px solid rgb(133 133 133 / 83%) !important;
  transform: translateY(100px);
  opacity: 0;
  right: 10px;
  align-items: center;
  display: flex;
  justify-content: center;
  max-width: 800px;
  margin-right: auto;
  margin-left: auto;

}

.home-text {
  font-weight: 500;
  letter-spacing: 0.5px;
  font-size: 1rem !important;
}