/* ==========================================
   PANORAMA STORIES: Filter, Cards, Episodes
   ========================================== */

/* Filter bar */
.stories-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.stories-filter-bar .filter-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.stories-filter-bar .filter-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-cream);
}

.stories-filter-bar .filter-btn.active {
  background: var(--color-teal);
  color: var(--bg-dark);
  border-color: var(--color-teal);
  font-weight: 700;
}

/* Story cards grid */
.stories-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* Story card */
.story-card {
  background: var(--bg-dark-secondary);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.story-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.story-card-image {
  position: relative;
  overflow: hidden;
}

.story-card-image img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.story-card:hover .story-card-image img {
  transform: scale(1.05);
}

.story-card-body {
  padding: 12px 14px 14px;
}

.story-card-body h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-cream);
  margin: 0 0 4px;
  line-height: 1.3;
}

.story-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 4px;
}

/* ==========================================
   STORY EPISODES LIST (Modal)
   ========================================== */

.story-episodes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.story-episode-item {
  display: flex;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
  align-items: flex-start;
}

.story-episode-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.story-episode-thumb {
  position: relative;
  width: 160px;
  min-width: 160px;
  height: 90px;
  border-radius: 6px;
  overflow: hidden;
  background: #111;
  flex-shrink: 0;
}

.story-episode-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.episode-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
  pointer-events: none;
}

.episode-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
}

.story-episode-info {
  flex: 1;
  min-width: 0;
}

.story-episode-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-cream);
  margin: 0 0 4px;
}

/* ==========================================
   COMIC READER OVERLAY
   ========================================== */

#comic-reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000;
  display: none;
  flex-direction: column;
}

#comic-reader-overlay.open {
  display: flex;
}

/* Reader Toolbar */
.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  z-index: 2;
}

.reader-title {
  color: var(--color-cream, #f5f0e8);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40%;
}

.reader-page-counter {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-family: monospace;
}

.reader-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.reader-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Reader Viewport */
.reader-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.reader-page-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

/* Reader Side Navigation */
.reader-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 15%;
  min-width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s;
}

.reader-nav:hover {
  opacity: 1;
}

.reader-nav.left {
  left: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.5), transparent);
}

.reader-nav.right {
  right: 0;
  background: linear-gradient(to left, rgba(0,0,0,0.5), transparent);
}

.reader-nav-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  pointer-events: none;
}

.reader-nav:hover .reader-nav-btn {
  background: rgba(255, 255, 255, 0.3);
}

/* Reader Progress Bar */
.reader-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.reader-progress-fill {
  height: 100%;
  background: var(--color-teal, #4a9b93);
  transition: width 0.3s ease;
}

/* Reader Thumbnails */
.reader-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.9);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.reader-thumbs::-webkit-scrollbar {
  height: 6px;
}

.reader-thumbs::-webkit-scrollbar-track {
  background: transparent;
}

.reader-thumbs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.reader-thumb {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.5;
  border: 2px solid transparent;
  transition: opacity 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.reader-thumb:hover {
  opacity: 0.8;
}

.reader-thumb.active {
  opacity: 1;
  border-color: var(--color-teal, #4a9b93);
}
