/* Components */

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-pill);
  border: 3px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Firefox Scrollbar */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) var(--bg-primary);
}

/* Buttons */
.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: 50%;
  transition: background-color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background-color: var(--border-color);
}

.btn-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Category Filters (Inside Header) */
.filters {
  display: flex;
  justify-content: flex-start;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  min-width: 0;
}

@media (min-width: 769px) {
  .filters {
    justify-content: center;
  }
}

.filters::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

.chip {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.chip:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.chip.active {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.chip-sm {
  padding: 4px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Hero Section (Cinematic Slider) */
.hero-slider {
  width: 100%;
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 21 / 9;
  background: var(--bg-secondary);
  animation: fadeInUp 0.6s var(--transition-bounce) both;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  pointer-events: none;
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

.hero-img-wrap {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  text-decoration: none;
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-glow) 50%, var(--skeleton-base) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 6s linear; /* Slow zoom effect while active */
  transform: scale(1);
}

.hero-slide.active .hero-img {
  transform: scale(1.05);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
  pointer-events: none;
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: var(--space-2xl);
  padding-bottom: calc(var(--space-2xl) + 20px); /* Space for dots */
  color: #FFFFFF;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}

.hero-category {
  color: #60a5fa;
}

.hero-title {
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
  color: #FFFFFF;
}

.hero-desc {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 800px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Slider Navigation Buttons & Dots */
.hero-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-fast);
  opacity: 0; /* Hidden by default, show on hover */
}

.hero-slider:hover .hero-nav-btn {
  opacity: 1;
}

.hero-nav-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.05);
}

.hero-nav-btn.prev {
  left: var(--space-md);
}

.hero-nav-btn.next {
  right: var(--space-md);
}

.hero-nav-btn svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.hero-nav {
  position: absolute;
  bottom: var(--space-lg);
  right: var(--space-2xl);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.hero-dot {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  border: none;
  padding: 0;
  transition: all var(--transition-fast);
}

.hero-dot:hover {
  background: rgba(255, 255, 255, 0.6);
}

.hero-dot.active {
  background: #FFFFFF;
  box-shadow: 0 0 8px rgba(255,255,255,0.5);
}

@media (max-width: 768px) {
  .hero-slider {
    aspect-ratio: 16 / 9;
  }
  .hero-content {
    padding: var(--space-xl);
    padding-bottom: calc(var(--space-xl) + 20px);
  }
  .hero-nav {
    right: var(--space-xl);
    bottom: var(--space-md);
  }
}

/* Premium News Cards (Grid) */
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  transition: all var(--transition-normal);
  animation: fadeInUp 0.6s var(--transition-bounce) both;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-glow) 50%, var(--skeleton-base) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  overflow: hidden;
}

.card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

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

.card-content {
  padding: var(--space-xl);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-source {
  font-weight: 700;
  color: var(--text-primary);
}

/* Link Reset - No blue underline hyperlinks */
a {
  color: var(--text-primary);
  text-decoration: none;
}

a:visited {
  color: var(--text-primary);
  text-decoration: none;
}

a:hover, a:active {
  color: var(--text-primary);
  text-decoration: underline;
}

a:focus-visible {
  color: var(--text-primary);
  text-decoration: none;
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

.card-title {
  font-size: 1.15rem;
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition-fast);
}

.card-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.card-title a:hover {
  color: #2563eb;
}

.card:hover .card-title, .card:hover .card-title a {
  color: #2563eb;
}

.card-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-top: auto;
  padding-top: var(--space-md);
}

/* Modifiers for Cards */
.card.read-article::after, .hero-slide.read-article::after, .card.watched-article::after {
  content: '✓ Watched';
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.card-duration-badge {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  z-index: 5;
}

.card-progress-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 6;
}

.card-progress-bar {
  height: 100%;
  background: #ef4444;
  width: 0%;
  transition: width 0.3s ease;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger card animations */
.news-grid .card:nth-child(1) { animation-delay: 0.1s; }
.news-grid .card:nth-child(2) { animation-delay: 0.2s; }
.news-grid .card:nth-child(3) { animation-delay: 0.3s; }
.news-grid .card:nth-child(4) { animation-delay: 0.4s; }
.news-grid .card:nth-child(5) { animation-delay: 0.5s; }
.news-grid .card:nth-child(6) { animation-delay: 0.6s; }

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
  width: 100%;
}

.skeleton-text.short {
  width: 60%;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Theme-Aware Clean Modal Player */
.tmkoc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tmkoc-modal-dialog {
  width: 100%;
  max-width: 960px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease;
}

.tmkoc-modal-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.tmkoc-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 85%;
}

.tmkoc-modal-badge {
  background: var(--text-primary);
  color: var(--bg-primary);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.tmkoc-modal-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tmkoc-modal-close {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
}

.tmkoc-modal-close:hover {
  background: #ef4444;
  color: white;
  border-color: transparent;
}

.tmkoc-video-viewport { position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000000;
}

.tmkoc-video-viewport iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.tmkoc-modal-footer {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.tmkoc-nav-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tmkoc-nav-btn:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
}

/* Spotify-Style Visual Share Card Component */
.spotify-share-card {
  width: 100%;
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 24px;
  color: var(--text-primary);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--border-color);
}

.spotify-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.spotify-card-brand {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.spotify-card-brand span {
  color: var(--text-secondary);
}

.spotify-card-brand small {
  background: var(--text-primary) !important;
  color: var(--bg-primary) !important;
}

.spotify-user-badge {
  background: var(--bg-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.spotify-card-body {
  display: flex;
  align-items: center;
  gap: 20px;
}

.spotify-art-box {
  width: 80px;
  height: 80px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
  color: var(--text-primary);
}

.spotify-stats-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spotify-tier-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fbbf24;
}

.spotify-main-stat {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.spotify-sub-stat {
  font-size: 13px;
  color: var(--text-secondary);
}

.spotify-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--border-color);
  padding-top: 12px;
  font-size: 11px;
  color: var(--text-secondary);
}


/* Static Search Bar Component (Always Visible) */
.static-search-form {
  display: flex;
  align-items: center;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 12px;
  color: #4b5563;
  pointer-events: none;
}

[data-theme="dark"] .search-input-wrapper .search-icon {
  color: #a1a1aa;
}

.static-search-form input {
  width: 240px;
  padding: 9px 16px 9px 36px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: all var(--transition-fast);
  background: #f3f4f6;
  border: 1.5px solid var(--border-color);
  color: #111827;
}

@media (max-width: 768px) {
  /* Expandable Search Bar */
  .static-search-form input {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 19px;
    color: transparent !important;
    cursor: pointer;
    background: var(--bg-primary) !important;
    border: 1px solid var(--border-color) !important;
  }
  .static-search-form input::placeholder {
    color: transparent !important;
  }
  .static-search-form input:focus {
    width: 170px;
    padding: 9px 16px 9px 36px;
    color: var(--text-primary) !important;
    background: var(--bg-primary) !important;
    border-color: var(--text-primary) !important;
    cursor: text;
  }
  .static-search-form input:focus::placeholder {
    color: #9ca3af !important;
  }
  .search-input-wrapper .search-icon {
    left: 11px;
    pointer-events: none;
  }

  /* Sort Icon Button */
  .sort-trigger-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 19px;
    justify-content: center;
  }
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: block !important;
  }
}
.mobile-only {
  display: none;
}

[data-theme="dark"] .static-search-form input {
  background: #1e1e1e;
  border: 1.5px solid var(--border-color);
  color: #ffffff;
}

.static-search-form input::placeholder {
  color: #4b5563;
  opacity: 0.8;
}

[data-theme="dark"] .static-search-form input::placeholder {
  color: #a1a1aa;
  opacity: 0.8;
}

.static-search-form input:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] .static-search-form input:focus {
  border-color: #ffffff;
  background: #121212;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}



/* Custom Dropdown Component Styling */
.custom-dropdown {
  position: relative;
  display: inline-block;
}

.sort-trigger-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  cursor: pointer;
}

.chevron-icon {
  transition: transform var(--transition-fast);
  color: var(--text-secondary);
}

.sort-trigger-btn[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 170px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: 6px;
  margin: 0;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.dropdown-menu.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-item {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dropdown-item:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.dropdown-item.active {
  background: var(--text-primary);
  color: var(--bg-primary);
  font-weight: 700;
}

/* Ensure proper responsiveness of header on small screens */


/* Geo-Block and Unavailable Ep Styles */
.tmkoc-geo-warning {
    display: none;
    background: #fff3cd;
    border: 1px solid #ffe69c;
    color: #664d03;
    padding: 12px;
    margin: 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.4;
}

[data-theme="dark"] .tmkoc-geo-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #fbbf24;
}

.ep-unavailable .card-img {
    filter: grayscale(100%) opacity(0.6);
}


/* ==========================================================================
   LED Ticker (Disclaimer)
   ========================================================================== */
.ticker-wrap {
    width: 100%;
    background-color: #ff0000; /* Pure vibrant railway red */
    overflow: hidden;
    height: 36px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(255, 0, 0, 0.4);
    border-bottom: 2px solid #cc0000;
    position: relative;
    z-index: 90;
}

.ticker {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: ticker-scroll 45s linear infinite;
}

.ticker:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 50px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    font-family: var(--font-sans);
    letter-spacing: 0.5px;
}

.ticker-item strong {
    font-weight: 900;
    color: #ffff00; /* Pure bright yellow */
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Dark mode adjustment - keep it vibrant! */
[data-theme="dark"] .ticker-wrap {
    background-color: #ff0000; /* Keep it pure red in dark mode too so it pops */
    border-bottom: 2px solid #990000;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}
