/*
Theme Name: Drama
Theme URI: 
Description: Japanese Drama Video Site
Version: 2.0
Author: Drama
Text Domain: drama
*/

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --bg-elevated: #1e1e2a;
  --border-subtle: rgba(255,255,255,0.06);
  --text-primary: #f0f0f5;
  --text-secondary: #8a8a9a;
  --text-muted: #55556a;
  --accent: #e50914;
  --accent-hover: #ff1a25;
  --accent-glow: rgba(229, 9, 20, 0.3);
  --gradient-hero: linear-gradient(135deg, #1a0a2e 0%, #0a0a0f 50%, #0f1a0a 100%);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-card-hover: 0 12px 40px rgba(0,0,0,0.6), 0 0 20px var(--accent-glow);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

::selection {
  background: var(--accent);
  color: #fff;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Header */
.site-header {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 32px;
}

.site-title a {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-transform: uppercase;
  position: relative;
}

.site-title a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-smooth);
}

.site-title a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-nav ul {
  list-style: none;
  display: flex;
  gap: 8px;
}

.header-nav li a {
  display: block;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  letter-spacing: 0.02em;
}

.header-nav li a:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

/* Main */
.site-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 32px;
  min-height: calc(100vh - 64px - 80px);
}

/* Section Title */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  position: relative;
  padding-left: 16px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* Search */
.search-form {
  display: flex;
  max-width: 480px;
  margin-bottom: 36px;
  position: relative;
}

.search-form input[type="text"] {
  flex: 1;
  padding: 12px 20px;
  padding-right: 48px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.search-form input[type="text"]::placeholder {
  color: var(--text-muted);
}

.search-form input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-elevated);
}

.search-form button {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  width: 40px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.search-form button:hover {
  background: var(--accent-hover);
}

/* Drama Grid */
.drama-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
}

.drama-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-smooth);
  cursor: pointer;
  position: relative;
  border: 1px solid transparent;
}

.drama-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  background: linear-gradient(180deg, transparent 40%, rgba(229, 9, 20, 0.08) 100%);
  pointer-events: none;
}

.drama-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(229, 9, 20, 0.2);
  background: var(--bg-card-hover);
}

.drama-card:hover::after {
  opacity: 1;
}

.drama-card-thumb {
  width: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  overflow: hidden;
  position: relative;
}

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

.drama-card:hover .drama-card-thumb img {
  transform: scale(1.08);
}

.drama-card-thumb span {
  opacity: 0.4;
}

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

.drama-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: 0.01em;
}

/* Single Drama */
.single-drama {
  max-width: 960px;
  margin: 0 auto;
}

.single-drama-header {
  margin-bottom: 36px;
}

.single-drama-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.single-drama-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.single-drama-image {
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.video-embed {
  margin-bottom: 32px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.video-embed iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
}

.single-drama-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 32px;
  line-height: 1.9;
  font-size: 0.95rem;
  border: 1px solid var(--border-subtle);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 48px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.pagination a:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.12);
}

.pagination .current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

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

/* No Results */
.no-results {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.no-results h2 {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* Footer */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 28px 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

/* Hero (front page) */
.hero-section {
  background: var(--gradient-hero);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  margin-bottom: 48px;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(229, 9, 20, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  position: relative;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
  position: relative;
}

/* Responsive */
@media (max-width: 1024px) {
  .drama-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
  }
}

/* Episode List (on drama page) */
.episode-list {
  margin-top: 40px;
}

.episode-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.episode-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid transparent;
  transition: all var(--transition-smooth);
}

.episode-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(229, 9, 20, 0.2);
  transform: translateX(4px);
}

.episode-item-thumb {
  width: 100px;
  min-width: 100px;
  aspect-ratio: 16/10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.episode-num {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.episode-item-body {
  flex: 1;
  min-width: 0;
}

.episode-badge {
  display: inline-block;
  background: rgba(229, 9, 20, 0.15);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.episode-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Single Episode Page */
.single-episode {
  max-width: 960px;
  margin: 0 auto;
}

.episode-player-wrap {
  margin-bottom: 32px;
}

.episode-video {
  margin-bottom: 0;
}

.video-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #0f0f1a 0%, #1a0a2e 50%, #0f0f1a 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.video-placeholder[style*="background-image"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(2px);
}

.video-placeholder-inner {
  text-align: center;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.video-placeholder-inner svg {
  margin-bottom: 0;
  opacity: 0.8;
  filter: drop-shadow(0 0 20px rgba(229, 9, 20, 0.5));
  position: relative;
  z-index: 2;
}

.video-placeholder-inner svg:hover {
  opacity: 1;
}

.video-placeholder-inner span {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
}

.episode-info {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  border: 1px solid var(--border-subtle);
}

.episode-info-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.episode-info-title a {
  transition: color var(--transition-fast);
}

.episode-info-title a:hover {
  color: var(--accent);
}

.episode-info-num {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(229, 9, 20, 0.1);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}

.episode-nav {
  margin-bottom: 20px;
}

.episode-nav-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.episode-nav-items {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.episode-nav-item {
  padding: 8px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.episode-nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.12);
}

.episode-nav-item.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

.back-to-drama {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color var(--transition-fast);
  margin-top: 8px;
}

.back-to-drama:hover {
  color: var(--accent);
}

@media (max-width: 768px) {
  .header-inner {
    height: auto;
    padding: 14px 20px;
    flex-direction: column;
    gap: 10px;
  }

  .site-main {
    padding: 24px 16px;
  }

  .drama-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
  }

  .hero-section {
    padding: 32px 24px;
    margin-bottom: 32px;
  }

  .hero-title {
    font-size: 1.4rem;
  }

  .single-drama-title {
    font-size: 1.5rem;
  }

  .single-drama-content {
    padding: 20px;
  }

  .section-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .drama-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .drama-card-body {
    padding: 10px 8px 12px;
  }

  .drama-card-title {
    font-size: 0.72rem;
  }
}
