/* Kiteretsu Daihyakka Hindi - Premium Custom CSS System */
:root {
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --primary-glow: rgba(245, 158, 11, 0.25);
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.25);
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --border-color: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.6;
  min-height: 100vh;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(245, 158, 11, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Header & Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
}

.brand-badge {
  background: linear-gradient(135deg, var(--primary), #ef4444);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-links a:hover {
  color: var(--primary);
}

/* Container */
.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-main);
  backdrop-filter: blur(10px);
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 900;
  background: linear-gradient(135deg, #fff 30%, var(--primary) 70%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 700px;
  margin: 0 auto 2rem auto;
}

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1.25rem;
  border-radius: 30px;
  font-size: 0.9rem;
  color: var(--text-main);
}

.stat-pill span {
  color: var(--primary);
  font-weight: 700;
}

/* Controls & Search */
.search-controls {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem 1rem 3rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  outline: none;
  transition: all 0.25s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.filter-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
  font-weight: 700;
}

/* Episode Grid */
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  border-color: var(--primary);
}

.card-img-wrapper {
  width: 100%;
  height: 160px;
  overflow: hidden;
  position: relative;
  background: #1e293b;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.card-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.badge-video {
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
}

.badge-soon {
  background: rgba(245, 158, 11, 0.9);
  color: #000;
}

.card-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-ep-num {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Individual Episode Page Styling */
.breadcrumb {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

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

.episode-h1 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.episode-meta-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  flex-wrap: wrap;
}

/* Video Section & Fallback */
.video-section {
  margin-bottom: 2.5rem;
}

.video-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-main);
  position: relative;
}

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

/* Instructional Fallback Card */
.video-fallback-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2.5rem;
  text-align: center;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  color: var(--text-main);
}

.fallback-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

.video-fallback-card h3 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.video-fallback-card p {
  color: var(--text-muted);
  max-width: 500px;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.edit-instruction {
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed var(--primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--accent);
  max-width: 90%;
  word-break: break-all;
}

/* Episode Detail Content Depth Blocks */
.episode-content-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (max-width: 900px) {
  .episode-content-grid {
    grid-template-columns: 1fr;
  }
}

.summary-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
}

.summary-box h2 {
  font-size: 1.35rem;
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-text {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #e2e8f0;
  margin-bottom: 2rem;
}

.section-subtitle {
  font-size: 1.15rem;
  color: var(--accent);
  margin: 1.75rem 0 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.5rem;
}

.gadget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.gadget-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.gadget-name {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.gadget-type {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.gadget-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.highlights-list {
  list-style: none;
  padding-left: 0;
}

.highlights-list li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 0.95rem;
}

.sidebar-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.cover-art-img {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.sidebar-title {
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.characters-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.character-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.82rem;
  color: #e2e8f0;
}

.series-info-box {
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius-sm);
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Related Episodes Navigation */
.related-section {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

.related-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.nav-buttons-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.ep-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.ep-nav-btn:hover {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4rem;
  background: rgba(15, 23, 42, 0.9);
}
