/* Coredigits Explore - Premium Global Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  /* Color Palette (Deep Space Theme) */
  --bg-primary: #08070d;
  --bg-secondary: #0f0d1a;
  --bg-tertiary: #161326;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Accent Colors */
  --accent-color: #7c3aed; /* Deep Violet */
  --accent-glow: rgba(124, 58, 237, 0.45);
  --accent-hover: #8b5cf6;
  
  /* Glassmorphism Details */
  --glass-bg: rgba(15, 13, 26, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: rgba(0, 0, 0, 0.4);
  
  /* Layout Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-body: 'Inter', sans-serif;
  --font-title: 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography Elements */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

a {
  color: var(--accent-hover);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  color: var(--text-primary);
}

/* Glassmorphism Navigation Bar */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 30px var(--glass-shadow);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #fff 0%, var(--accent-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Decoupled Search Widget CSS */
.search-container {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem;
  padding-left: 2.5rem;
  border-radius: 9999px;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 15px var(--accent-glow);
}

.search-icon-svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  fill: var(--text-muted);
  pointer-events: none;
  transition: var(--transition-smooth);
}

.search-input:focus ~ .search-icon-svg {
  fill: var(--accent-hover);
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  max-height: 350px;
  overflow-y: auto;
  display: none;
  z-index: 101;
}

.search-results-dropdown.active {
  display: block;
}

.search-item {
  display: block;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition-smooth);
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover {
  background: var(--bg-tertiary);
}

.search-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.search-item-summary {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Page Layout Wrappers */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* Article & Episode Page Styles */
.episode-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .episode-container {
    grid-template-columns: 2.2fr 1fr;
  }
}

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.5rem;
}

.breadcrumbs a {
  color: var(--text-secondary);
}

.breadcrumbs a:hover {
  color: var(--accent-hover);
}

.episode-header {
  margin-bottom: 2rem;
}

.episode-title {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.episode-meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  gap: 1.5rem;
}

.hero-media {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  margin-bottom: 2.5rem;
  aspect-ratio: 16 / 9;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.play-overlay:hover {
  background: rgba(0, 0, 0, 0.2);
}

.play-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-color);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 30px var(--accent-glow);
  transition: var(--transition-smooth);
}

.play-overlay:hover .play-btn {
  transform: scale(1.1);
  background: var(--accent-hover);
}

.play-btn svg {
  width: 24px;
  height: 24px;
  fill: #fff;
  margin-left: 4px;
}

.article-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #cbd5e1;
}

.article-content h2 {
  font-size: 1.75rem;
  margin: 2.5rem 0 1rem;
}

.article-content p {
  margin-bottom: 1.5rem;
}

/* Sidebar Sections */
.sidebar-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.sidebar-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
}

/* Grid of Cards (Homepage / Universes) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.15);
}

.card-thumbnail {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

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

.card-body {
  padding: 1.25rem;
}

.card-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* YouTube Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 13, 0.95);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 2rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 100px rgba(0, 0, 0, 0.8);
}

.modal-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: var(--accent-hover);
  transform: scale(1.1);
}

/* Footer Section */
footer {
  border-top: 1px solid var(--glass-border);
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: auto;
}
