:root[data-theme="light"] {
  --bg-color: #f9f9f9;
  --text-color: #111;
  --story-bg: #fff;
  --card-bg: #fff;
  --border-color: #ddd;
  --secondary-text: #555;
}

:root {
  --bg-color: #000;
  --text-color: #fff;
  --accent-color: #ff2a5f;
  --gradient-bg: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  --story-bg: #111;
  --card-bg: #222;
  --border-color: #333;
  --secondary-text: #ccc;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body,
html {
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-family);
  overflow: hidden;
  overscroll-behavior-y: none;
  /* Prevent body scroll, everything is in containers */
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Pull to Refresh */
#ptr-indicator {
  position: absolute;
  top: -80px;
  left: 0;
  width: 100%;
  height: 80px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.ptr-icon-wrapper {
  background: var(--card-bg);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  color: var(--primary-color);
  border: 1px solid var(--border-color);
}

.ptr-icon {
  width: 24px;
  height: 24px;
  opacity: 0.8;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.ptr-loading .ptr-icon {
  animation: ptr-spin 1s linear infinite;
  opacity: 1;
}

@keyframes ptr-spin {
  100% { transform: rotate(360deg); }
}

/* HOME VIEW */
#home-view {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 20px 0;
  padding-bottom: 80px;
  transition: opacity 0.3s ease;
  scrollbar-width: none;
}

#home-view::-webkit-scrollbar {
  width: 0px;
  height: 0px;
}

.header {
  padding: 0 20px 20px 20px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header span {
  background: var(--gradient-bg);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.search-container {
  padding: 0 20px 15px 20px;
}

#search-input {
  width: 100%;
  padding: 12px 18px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background-color: var(--story-bg);
  color: var(--text-color);
  font-size: 15px;
  outline: none;
  font-family: var(--font-family);
  transition: border-color 0.2s, box-shadow 0.2s;
}

#search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(255, 42, 95, 0.2);
}

.theme-toggle-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-color);
  padding: 5px;
  transition: transform 0.2s ease;
}

.theme-toggle-btn:active {
  transform: scale(0.9);
}

.section {
  margin-bottom: 30px;
}

.section-title {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 15px 20px;
  text-transform: capitalize;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.story-tray {
  display: flex;
  overflow-x: auto;
  padding: 0 20px;
  gap: 15px;
  scrollbar-width: none;
  /* Firefox */
}

.story-tray::-webkit-scrollbar {
  display: none;
  /* Safari and Chrome */
}

.story-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.story-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--gradient-bg);
  padding: 3px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.story-ring.seen {
  background: #333;
}

.story-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--card-bg);
  border: 3px solid var(--bg-color);
  object-fit: cover;
}

.story-label {
  font-size: 12px;
  font-weight: 500;
  max-width: 76px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--secondary-text);
}

/* CARDS VIEW (For entities, genres) */
.cards-tray {
  display: flex;
  overflow-x: auto;
  padding: 0 20px;
  gap: 15px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 20px;
  scroll-padding-right: 20px;
}

.cards-tray::-webkit-scrollbar {
  display: none;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  padding: 0 20px;
}

.search-grid .card {
  width: 100%;
  height: 200px;
  max-width: none;
  max-height: none;
  scroll-snap-align: none;
}

.card {
  width: 60vw;
  height: 80vw;
  max-width: 280px;
  max-height: 380px;
  border-radius: 12px;
  background-color: var(--card-bg);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.card:hover img {
  opacity: 1;
}

.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 15px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: #ffffff;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

/* HERO SECTION */
.hero-card {
  width: calc(100% - 40px);
  margin: 0 20px 30px 20px;
  height: 400px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: transform 0.4s ease;
}

.hero-card:active .hero-bg {
  transform: scale(1.05);
}

.hero-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.95) 100%);
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
}

.hero-tag {
  background: var(--gradient-bg);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 10px;
  box-shadow: 0 4px 10px rgba(220, 39, 67, 0.4);
}

.hero-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

/* LIST SECTION */
.article-list {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.list-item {
  display: flex;
  gap: 15px;
  background: var(--story-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px;
  align-items: center;
  cursor: pointer;
  transition: background 0.3s;
}

.list-item:active {
  background: var(--card-bg);
}

.list-item img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
}

.list-item-content {
  flex: 1;
}

.list-item-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-item-meta {
  font-size: 12px;
  color: var(--secondary-text);
}

/* STORY FULLSCREEN VIEW */
#story-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 100;
  display: none;
  flex-direction: column;
}

.story-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

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

.story-item {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  scroll-snap-align: start;
  position: relative;
  background-color: var(--story-bg);
  display: flex;
  flex-direction: column;
}

.story-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  z-index: 1;
}

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

.story-content {
  position: relative;
  z-index: 10;
  pointer-events: none;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  padding-bottom: 40px;
}

.story-header {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
}

.story-progress-container {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
  z-index: 5;
}

.story-progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.story-progress-fill {
  height: 100%;
  background: #fff;
  width: 0%;
  transition: width 0.1s linear;
}

.story-close {
  position: absolute;
  top: 10px;
  right: 5px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.story-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.story-tag {
  background: var(--accent-color);
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.story-tag-person {
  background: #3b82f6;
}

.story-tag-org {
  background: #10b981;
}

.story-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 15px;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.story-perex {
  font-size: 15px;
  line-height: 1.5;
  color: #e0e0e0;
  margin-bottom: 25px;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.8);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.play-button {
  background: var(--gradient-bg);
  border: none;
  border-radius: 50%;
  width: 70px;
  height: 70px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 5px 15px rgba(220, 39, 67, 0.4);
  align-self: center;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 20px;
}

.play-button:active {
  transform: scale(0.95);
}

.play-button svg {
  width: 30px;
  height: 30px;
  fill: #fff;
  margin-left: 5px;
}

.play-button.playing {
  animation: pulse 1.5s infinite;
}

.play-button.playing svg {
  margin-left: 0;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 39, 67, 0.7);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(220, 39, 67, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(220, 39, 67, 0);
  }
}

.hidden-content {
  display: none;
}

/* Navigation overlays for tap */
.tap-left,
.tap-right {
  position: absolute;
  top: 0;
  height: 100%;
  z-index: 5;
}

.tap-left {
  left: 0;
  width: 30%;
}

.tap-right {
  right: 0;
  width: 70%;
}

.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
  background-color: var(--bg-color);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 9999;
}

.loader-logo {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
    box-shadow: 0 0 40px rgba(0, 191, 255, 0.4);
  }

  100% {
    transform: scale(0.9);
    opacity: 0.8;
  }
}

/* ARTICLE VIEW */
#article-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  z-index: 200;
  overflow-y: auto;
  scrollbar-width: none;
}

#article-view::-webkit-scrollbar {
  display: none;
}

#article-view {
  display: none;
  flex-direction: column;
}

.article-speech-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin: 15px 0 25px 0;
  transition: opacity 0.2s ease, transform 0.1s ease;
  width: fit-content;
}

.article-speech-btn:active {
  transform: scale(0.96);
  opacity: 0.9;
}

.speech-highlight {
  background-color: #ffeb3b;
  color: #000;
  border-radius: 3px;
  transition: background-color 0.2s linear, color 0.2s linear;
}

#article-audio-player {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--card-bg);
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  z-index: 600;
  display: flex;
  flex-direction: column-reverse;
  padding-top: max(10px, env(safe-area-inset-top));
  padding-bottom: 5px;
}

.audio-player-progress-bg {
  width: 90%;
  height: 6px;
  background: #333;
  margin: 0 auto;
  border-radius: 3px;
  overflow: hidden;
}

.audio-player-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary-color);
  transition: width 0.1s linear;
}

.audio-player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  gap: 20px;
}

#audio-player-playpause {
  background: var(--primary-color);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.audio-player-times {
  font-size: 13px;
  color: #ddd;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
}

.article-header {
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  padding: 15px 20px;
  z-index: 201;
  border-bottom: 1px solid var(--border-color);
}

.back-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

#article-content-container {
  padding: 20px;
  padding-bottom: 60px;
  background: var(--story-bg);
}

.article-main-image {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 20px;
  object-fit: cover;
}

#article-content-container img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 15px 0;
}

#article-content-container iframe,
#article-content-container video {
  max-width: 100%;
  border-radius: 8px;
  margin: 15px 0;
}

#article-content-container h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 15px;
  line-height: 1.3;
}

#article-content-container h2,
#article-content-container h5 {
  font-size: 20px;
  font-weight: 700;
  margin-top: 25px;
  margin-bottom: 10px;
  color: #fff;
}

#article-content-container p {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 15px;
  color: var(--secondary-text);
}

#article-content-container ul,
#article-content-container ol {
  margin-left: 20px;
  margin-bottom: 15px;
  color: var(--secondary-text);
  line-height: 1.6;
}

#article-content-container a {
  color: var(--accent-color);
  text-decoration: none;
}

.article-video {
  width: 100%;
  border-radius: 12px;
  margin-top: 20px;
  margin-bottom: 20px;
}

.article-gallery {
  margin-top: 30px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

.gallery-item {
  background: var(--story-bg);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.gallery-item img {
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

.gallery-caption {
  font-size: 13px;
  color: var(--secondary-text);
  padding: 10px;
  text-align: center;
}

/* DESKTOP WEB EXPERIENCE */
@media (min-width: 992px) {
  
  /* Restore visible scrollbars on desktop */
  #home-view, #article-view {
    scrollbar-width: auto;
  }
  #home-view::-webkit-scrollbar,
  #article-view::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  #home-view::-webkit-scrollbar-track,
  #article-view::-webkit-scrollbar-track {
    background: transparent;
  }
  #home-view::-webkit-scrollbar-thumb,
  #article-view::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
  }

  /* Center and constrain main home view */
  #home-view {
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 40px;
  }

  .header {
    font-size: 32px;
  }

  /* Zobrazovať všetky kartičky ako mriežku, ale menšie */
  .cards-tray {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    padding: 0 20px;
    overflow: visible !important;
  }

  .card {
    width: 100% !important;
    max-width: none !important;
    height: 280px !important;
    display: flex !important;
    flex-direction: column !important;
    transition: transform 0.2s;
  }

  .card img {
    height: 180px !important;
    opacity: 1 !important;
  }

  .card-overlay {
    position: relative !important;
    background: var(--card-color, var(--card-bg)) !important;
    opacity: 0.85;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
  }

  .card-title {
    text-shadow: none !important;
    font-size: 13px !important;
    text-align: center;
    color: #ffffff !important;
  }

  .card:hover {
    transform: translateY(-4px);
  }

  /* Make article list a grid too */
  .article-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 0 20px;
  }

  .list-item {
    margin-bottom: 0 !important;
    height: 100%;
    padding: 20px;
    gap: 20px;
    transition: transform 0.2s;
  }

  .list-item img {
    width: 140px;
    height: 120px;
    border-radius: 12px;
  }

  .list-item-title {
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 10px;
  }

  .list-item-meta {
    font-size: 14px;
  }

  .list-item:hover {
    transform: translateY(-4px);
  }

  /* Story bubbles wrap */
  .story-tray {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    overflow: visible !important;
    gap: 20px;
  }

  .story-bubble {
    transition: transform 0.2s;
  }

  .story-bubble:hover {
    transform: scale(1.05);
  }

  /* Full article view constraints */
  #article-view {
    display: flex;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(10px);
    overflow-y: auto !important;
  }

  .article-header {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    background: none !important;
    border: none !important;
    backdrop-filter: none !important;
  }

  #article-content-container {
    max-width: 800px;
    margin: 100px auto 40px auto;
    background: var(--bg-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    height: max-content;
    min-height: 90vh;
  }

  /* Story View (Reels) Desktop Mode */
  #story-view {
    background: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(20px);
  }

  #story-container {
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 0 50px rgba(0, 0, 0, 1);
    position: relative;
    border-left: 1px solid #333;
    border-right: 1px solid #333;
  }

  #story-progress-container {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    top: 20px;
  }

  .story-close {
    right: calc(50% - 235px);
    top: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
  }

  .hero-card {
    height: 450px;
  }

  /* Desktop overrides for mobile bottom nav */
  #bottom-nav {
    display: none !important;
  }
  
  #home-view, #article-view, #menu-view, #genre-listing-view {
    padding-bottom: 0 !important;
  }
  
  #story-view, #story-container {
    height: 100vh !important;
  }
}
/* BOTTOM NAVIGATION */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--card-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  z-index: 9999;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn {
  background: none;
  border: none;
  color: #888;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  flex: 1;
  height: 60px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-btn.active {
  color: var(--primary-color);
}

.nav-btn svg {
  width: 24px;
  height: 24px;
}

/* Adjust padding for views to account for bottom nav and audio player */
#home-view::after {
  content: "";
  display: block;
  height: calc(90px + env(safe-area-inset-bottom));
  width: 100%;
}

#article-view::after {
  content: "";
  display: block;
  height: calc(150px + env(safe-area-inset-bottom));
  width: 100%;
}

#menu-view::after {
  content: "";
  display: block;
  height: calc(90px + env(safe-area-inset-bottom));
  width: 100%;
}

#genre-articles-container::after {
  content: "";
  display: block;
  height: calc(90px + env(safe-area-inset-bottom));
  width: 100%;
}

#story-view {
  height: calc(100% - 60px - env(safe-area-inset-bottom));
}

#story-container {
  height: calc(100vh - 60px - env(safe-area-inset-bottom));
}

#reels-container {
  height: calc(100vh - 60px - env(safe-area-inset-bottom));
}

.reel-item {
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.reel-embed-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel-embed-container iframe {
  width: 100%;
  height: 56.25vw;
  max-height: 100%;
  border: none;
  pointer-events: auto;
}

.reel-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 80px 20px 40px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #fff;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.reel-overlay-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.reel-read-btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
  pointer-events: auto;
  cursor: pointer;
}

/* PWA INSTALL BANNER */
.pwa-install-banner {
  position: fixed;
  bottom: calc(70px + env(safe-area-inset-bottom));
  left: 10px;
  right: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  z-index: 1000;
  transform: translateY(150%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pwa-install-banner.visible {
  transform: translateY(0);
}

.pwa-install-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.pwa-install-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.pwa-install-text {
  display: flex;
  flex-direction: column;
}

.pwa-install-text strong {
  font-size: 14px;
  color: var(--text-color);
  margin-bottom: 2px;
}

.pwa-install-text p {
  font-size: 12px;
  color: var(--secondary-text);
  margin: 0;
  line-height: 1.3;
}

.pwa-btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  margin-left: 10px;
}

.pwa-close {
  background: none;
  border: none;
  color: #888;
  font-size: 20px;
  cursor: pointer;
  padding: 0 0 0 10px;
  align-self: flex-start;
  margin-top: -5px;
}

@media (min-width: 992px) {
  .pwa-install-banner {
    bottom: 20px;
    left: auto;
    right: 20px;
    width: 350px;
  }
}

.live-video-wrapper {
  position: relative;
  width: 100%;
  transition: all 0.3s ease;
}

.live-video-wrapper.sticky {
  position: fixed;
  bottom: calc(70px + env(safe-area-inset-bottom));
  right: 15px;
  width: 250px;
  z-index: 1000;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: slideInBottom 0.3s forwards;
}

@keyframes slideInBottom {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.sticky-close-btn {
  display: none;
  position: absolute;
  top: -10px;
  right: -10px;
  width: 28px;
  height: 28px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  border: 2px solid #fff;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  z-index: 1001;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.live-video-wrapper.sticky .sticky-close-btn {
  display: flex;
}

@media (min-width: 992px) {
  .live-video-wrapper.sticky {
    width: 350px;
    bottom: 20px;
  }
}

/* Offline Toast */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 20px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  z-index: 2000;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}

.toast.hidden {
  opacity: 0;
  transform: translate(-50%, 20px);
}

.toast.offline {
  background-color: #f44336;
}

.toast.online {
  background-color: #4caf50;
}
