/* ============== Base & Reset ============== */
:root {
  --primary: #FF3B5C;
  --secondary: #7C3AED;
  --dark: #0F0F1E;
  --dark-secondary: #1A1A2E;
  --dark-tertiary: #252540;
  --gray-100: #F3F4F6;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 200ms ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--dark);
  color: #fff;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
input, textarea, select { font: inherit; }

/* ============== Scrollbar ============== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-700); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-600); }

/* ============== Layout ============== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ============== Header ============== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 15, 30, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  height: 64px;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-icon {
  flex-shrink: 0;
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  color: #FF3B5C;
  letter-spacing: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-400);
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.nav-link.active { color: #fff; background: rgba(255, 59, 92, 0.15); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--dark-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 8px;
  min-width: 200px;
  display: none;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.user-dropdown.show { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-300);
  transition: all var(--transition);
  width: 100%;
  text-align: left;
}

.dropdown-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.dropdown-divider { height: 1px; background: rgba(255, 255, 255, 0.06); margin: 4px 0; }

/* ============== Buttons ============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}
.btn-primary:hover { box-shadow: 0 8px 24px rgba(255, 59, 92, 0.35); transform: translateY(-1px); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.2); }

.btn-ghost { color: var(--gray-400); padding: 8px 12px; }
.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  transition: all var(--transition);
}
.btn-icon:hover { background: rgba(255, 255, 255, 0.15); }
.btn-icon.active { background: var(--primary); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }

/* ============== Cards ============== */
.drama-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--dark-secondary);
  transition: all 300ms ease;
  cursor: pointer;
}
.drama-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4); }

.drama-card-img {
  aspect-ratio: 2/3;
  width: 100%;
  object-fit: cover;
  background: var(--dark-tertiary);
}
.drama-card-yt .drama-card-img {
  aspect-ratio: 16/9;
}

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

.drama-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.drama-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-400);
}

.drama-card-ranks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.genre-rank-label {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.12);
  text-decoration: none;
  transition: background 0.2s;
}

.genre-rank-label:hover {
  background: rgba(245, 158, 11, 0.25);
}

/* ---- Genre Ranking Page ---- */
.rank-genre-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 16px;
  scrollbar-width: none;
}
.rank-genre-tabs::-webkit-scrollbar { display: none; }

.rank-genre-chip {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--gray-600);
  background: transparent;
  color: var(--gray-300);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.rank-genre-chip:hover { border-color: var(--gray-400); color: var(--gray-200); }
.rank-genre-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

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

.rank-item {
  display: flex;
  gap: 16px;
  padding: 12px;
  border-radius: 12px;
  background: var(--dark-secondary);
  cursor: pointer;
  transition: background 0.2s;
}
.rank-item:hover { background: var(--dark-tertiary); }

.rank-thumb-wrap {
  position: relative;
  flex-shrink: 0;
  width: 100px;
  height: 130px;
}
.rank-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.rank-number {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  z-index: 1;
}

.rank-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.rank-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-100);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-meta {
  font-size: 12px;
  color: var(--gray-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-desc {
  font-size: 12px;
  color: var(--gray-500);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.rank-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.rank-tag-hot { background: var(--primary); color: #fff; }
.rank-tag-new { background: #10B981; color: #fff; }
.rank-tag-default { background: var(--gray-600); color: var(--gray-200); }
.rank-tag-stat { background: transparent; color: #10B981; font-weight: 500; }

.drama-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-hot { background: var(--primary); color: #fff; }
.badge-new { background: #10B981; color: #fff; }
.badge-top { background: #F59E0B; color: #000; }
.badge-streaming { background: var(--secondary); color: #fff; }
.badge-youtube { background: #FF0000; color: #fff; }

.drama-card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #F59E0B;
  font-weight: 600;
}

.drama-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 300ms ease;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}
.drama-card:hover .drama-card-overlay { opacity: 1; }

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

@media (max-width: 640px) {
  .drama-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
}

/* ============== Carousel ============== */
.carousel-section { margin-bottom: 40px; }

.carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.carousel-title { font-size: 22px; font-weight: 700; }

.carousel-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.carousel-scroll::-webkit-scrollbar { display: none; }

.carousel-scroll .drama-card {
  flex-shrink: 0;
  width: 180px;
  scroll-snap-align: start;
}

@media (max-width: 640px) {
  .carousel-scroll .drama-card { width: 150px; }
}

/* ============== Hero ============== */
.hero {
  position: relative;
  padding: 100px 0 40px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}

.hero-blob-1 { width: 400px; height: 400px; background: var(--primary); top: -100px; left: 10%; }
.hero-blob-2 { width: 300px; height: 300px; background: var(--secondary); bottom: -50px; right: 15%; }

.hero-title {
  font-size: 56px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 20px;
  color: var(--gray-300);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .hero { padding: 80px 0 24px; }
  .hero-title { font-size: 36px; }
  .hero-subtitle { font-size: 16px; }
}

/* ============== Section ============== */
.section { padding: 40px 0; }
.section-title { font-size: 22px; font-weight: 700; margin-bottom: 20px; }

/* ============== Tabs ============== */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-400);
  white-space: nowrap;
  transition: all var(--transition);
}
.tab:hover { color: #fff; }
.tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* ============== Search ============== */
.search-bar {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 14px 48px 14px 20px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--dark-secondary);
  color: #fff;
  font-size: 16px;
  outline: none;
  transition: all var(--transition);
}
.search-input::placeholder { color: var(--gray-500); }
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255, 59, 92, 0.15); }

.search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  justify-content: center;
}

.search-tag {
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--gray-300);
  transition: all var(--transition);
  cursor: pointer;
}
.search-tag:hover { background: rgba(255, 59, 92, 0.2); color: var(--primary); }

/* ============== Drama Detail ============== */
.drama-hero {
  display: flex;
  gap: 32px;
  padding: 96px 0 40px;
}

.drama-poster {
  flex-shrink: 0;
  width: 280px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.drama-poster img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }

.drama-info { flex: 1; padding-top: 16px; }

.drama-detail-title { font-size: 32px; font-weight: 800; line-height: 1.2; margin-bottom: 12px; }

.drama-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.drama-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--gray-400);
}

.drama-description {
  font-size: 15px;
  line-height: 1.7;
  color: var(--gray-300);
  margin-bottom: 24px;
}

.drama-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.drama-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.drama-tag {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--gray-300);
}

@media (max-width: 768px) {
  .drama-hero { flex-direction: column; align-items: center; text-align: center; padding-top: 80px; }
  .drama-poster { width: 200px; }
  .drama-meta-row { justify-content: center; }
  .drama-actions { justify-content: center; }
  .drama-tags { justify-content: center; }
}

/* ============== Episodes ============== */
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.episode-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all var(--transition);
}
.episode-item:hover { background: rgba(255, 255, 255, 0.08); }
.episode-item.active { background: rgba(255, 59, 92, 0.15); border: 1px solid rgba(255, 59, 92, 0.3); }

.episode-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--dark-tertiary);
  flex-shrink: 0;
}

.episode-number {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background: var(--dark-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-400);
  flex-shrink: 0;
}

.episode-title { font-size: 14px; font-weight: 500; }

/* ============== Video Player ============== */
.video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  margin-bottom: 24px;
}

.video-container iframe, .video-container video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ============== Comments ============== */
.comment-form { margin-bottom: 24px; }

.comment-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--dark-secondary);
  color: #fff;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: all var(--transition);
}
.comment-input:focus { border-color: var(--primary); }

.comment-item {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--dark-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }

.comment-body { flex: 1; min-width: 0; }
.comment-author { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.comment-text { font-size: 14px; line-height: 1.5; color: var(--gray-300); margin-bottom: 8px; }

.comment-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--gray-500);
}

.comment-action {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color var(--transition);
}
.comment-action:hover { color: var(--primary); }
.comment-action.liked { color: var(--primary); }

.comment-replies { margin-left: 48px; margin-top: 8px; }

/* ============== Actor Card ============== */
.actor-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 300ms ease;
}
.actor-card:hover { transform: translateY(-2px); }

.actor-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--dark-tertiary);
  border: 2px solid transparent;
  transition: border-color 300ms ease;
}
.actor-card:hover .actor-avatar { border-color: var(--primary); }

.actor-name { font-size: 13px; font-weight: 500; text-align: center; color: var(--gray-300); }

.actor-strip {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 8px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.actor-strip::-webkit-scrollbar { display: none; }

/* ============== Profile ============== */
.profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px 0;
}

.profile-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

.profile-name { font-size: 24px; font-weight: 700; }
.profile-email { font-size: 14px; color: var(--gray-400); }

.stats-bar {
  display: flex;
  gap: 32px;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-item { text-align: center; }
.stat-value { font-size: 22px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--gray-400); margin-top: 2px; }

@media (max-width: 640px) {
  .profile-header { flex-direction: column; text-align: center; }
  .stats-bar { justify-content: center; }
}

/* ============== Settings ============== */
.settings-section {
  padding: 24px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-section-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-400); margin-bottom: 6px; }

.form-input {
  width: 100%;
  max-width: 400px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--dark-secondary);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all var(--transition);
}
.form-input:focus { border-color: var(--primary); }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  max-width: 400px;
}

.toggle-label { font-size: 14px; }

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--gray-700);
  cursor: pointer;
  transition: background var(--transition);
}
.toggle.active { background: var(--primary); }

.toggle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform var(--transition);
}
.toggle.active::after { transform: translateX(20px); }

/* ============== Loading & Empty ============== */
.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--dark-tertiary) 25%, rgba(255, 255, 255, 0.06) 50%, var(--dark-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}

.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-text { font-size: 16px; }

/* ============== Toast ============== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  animation: slideIn 300ms ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-width: 360px;
}

.toast-success { background: #059669; color: #fff; }
.toast-error { background: #DC2626; color: #fff; }
.toast-info { background: var(--dark-secondary); color: #fff; border: 1px solid rgba(255, 255, 255, 0.1); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-exit { animation: slideOut 300ms ease forwards; }

@keyframes slideOut {
  to { transform: translateX(100%); opacity: 0; }
}

/* ============== Modal ============== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }

.modal-box {
  background: var(--dark-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 440px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 300ms ease;
}
.modal-overlay.show .modal-box { transform: scale(1); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-close {
  font-size: 28px;
  color: var(--gray-400);
  line-height: 1;
  padding: 4px;
}
.modal-close:hover { color: #fff; }

.modal-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: var(--gray-500);
  font-size: 13px;
}
.modal-divider::before, .modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* ============== Footer ============== */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 48px 0 24px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-heading { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-link { font-size: 14px; color: var(--gray-400); transition: color var(--transition); }
.footer-link:hover { color: var(--primary); }

.footer-bottom { text-align: center; font-size: 13px; color: var(--gray-500); padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.04); }

/* ============== Misc ============== */
.page-content { padding-top: 64px; min-height: 100vh; }

.fade-in { animation: fadeIn 400ms ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted { color: var(--gray-400); }
.text-sm { font-size: 13px; }

.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ============== Unified Search + Chat ============== */

/* Unified input bar */
.unified-input-bar {
  display: flex;
  gap: 8px;
  max-width: 680px;
  margin: 0 auto;
}

.unified-input {
  flex: 1;
  padding: 14px 20px;
  background: var(--dark-secondary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50px;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition);
}

.unified-input:focus {
  border-color: var(--primary);
}

.unified-input::placeholder {
  color: var(--gray-500);
}

.unified-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.unified-btn:hover { transform: scale(1.08); }
.unified-btn:active { transform: scale(0.94); }

.unified-btn-search {
  background: linear-gradient(135deg, var(--primary), #e6335a);
}

.unified-btn-ai {
  background: linear-gradient(135deg, var(--secondary), #9b59b6);
}

/* Suggestions area */
.suggestions-area {
  max-width: 680px;
  margin: 16px auto 0;
}

.suggestions-area.hidden { display: none; }

.suggestion-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 10px;
}

.suggestion-row-ai {
  margin-top: 4px;
}

/* Unified suggestion tag */
.stag {
  padding: 7px 14px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

.stag-keyword {
  background: rgba(255, 255, 255, 0.07);
  color: var(--gray-300);
}

.stag-keyword:hover {
  background: rgba(255, 59, 92, 0.15);
  color: #fff;
  border-color: rgba(255, 59, 92, 0.3);
}

.stag-ai {
  background: rgba(124, 58, 237, 0.12);
  color: #c4b5fd;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.stag-ai:hover {
  background: rgba(124, 58, 237, 0.25);
  color: #fff;
  border-color: rgba(124, 58, 237, 0.4);
}

.stag-ai-icon {
  opacity: 0.7;
}

/* Mode bar */
.mode-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.mode-bar.hidden { display: none; }

.mode-label {
  font-size: 13px;
  color: var(--gray-400);
}

.mode-back-btn {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--gray-300);
  cursor: pointer;
  transition: all var(--transition);
}

.mode-back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Sort bar */
.sort-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.sort-bar.hidden { display: none; }

/* Chat area */
.chat-area {
  max-width: 720px;
  margin: 16px auto 0;
  background: var(--dark-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.chat-area.hidden { display: none; }

.chat-messages {
  max-height: 400px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  padding: 10px 14px;
  border-radius: var(--radius);
  max-width: 85%;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.chat-msg-user {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-msg-assistant {
  background: var(--dark-tertiary);
  color: var(--gray-100);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-dramas {
  padding: 0 20px 16px;
}

.chat-dramas:empty { display: none; }

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
  background: var(--dark-tertiary);
  color: var(--gray-100);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.chat-input:focus {
  border-color: var(--primary);
}

.chat-dramas-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.chat-dramas-scroll .drama-card {
  flex: 0 0 150px;
  scroll-snap-align: start;
}

/* ============== News Cards ============== */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--dark-secondary);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.06);
  transition: background var(--transition), border-color var(--transition);
}

.news-card:hover {
  background: var(--dark-tertiary);
  border-color: rgba(255,255,255,0.12);
}

.news-card-body {
  flex: 1;
  min-width: 0;
}

.news-card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-summary {
  font-size: 13px;
  color: var(--gray-400);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--gray-500);
}

.news-card-source {
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: 4px;
}

.news-card-time {
  white-space: nowrap;
}

.news-card-image {
  flex: 0 0 120px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  margin-bottom: 6px;
}

@media (max-width: 480px) {
  .news-card-image {
    flex: 0 0 80px;
    height: 70px;
  }
  .news-card-title { font-size: 14px; }
  .news-card-summary { -webkit-line-clamp: 2; }
}

/* ============== Scoopz Tabs ============== */
.scoopz-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 20px;
}

.scoopz-tab {
  flex: 1;
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--gray-400);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  text-align: center;
}

.scoopz-tab:hover {
  color: var(--gray-200);
  background: rgba(255,255,255,0.03);
}

.scoopz-tab.active {
  color: #fff;
  border-bottom-color: #1d9bf0;
}

/* ============== Tweet Cards (Twitter/X style) ============== */
.tweet-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tweet-card {
  display: block;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.tweet-card:hover {
  background: rgba(255,255,255,0.03);
}

.tweet-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.tweet-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d9bf0, #1a8cd8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.tweet-author {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  overflow: hidden;
}

.tweet-name {
  font-weight: 700;
  font-size: 15px;
  color: #e7e9ea;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tweet-username {
  font-size: 14px;
  color: #71767b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tweet-time {
  font-size: 13px;
  color: #71767b;
  white-space: nowrap;
  flex-shrink: 0;
}

.tweet-body {
  font-size: 15px;
  line-height: 1.5;
  color: #e7e9ea;
  margin-left: 50px;
  margin-bottom: 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.tweet-body .tweet-link {
  color: #1d9bf0;
  text-decoration: none;
}
.tweet-body .tweet-link:hover {
  text-decoration: underline;
}

.tweet-body .tweet-mention {
  color: #1d9bf0;
  text-decoration: none;
}
.tweet-body .tweet-mention:hover {
  text-decoration: underline;
}

.tweet-body .tweet-hashtag {
  color: #1d9bf0;
  text-decoration: none;
}
.tweet-body .tweet-hashtag:hover {
  text-decoration: underline;
}

/* Tweet media */
.tweet-media {
  margin-left: 50px;
  margin-bottom: 10px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}

.tweet-media img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.tweet-media-single img {
  max-height: 300px;
}

.tweet-media-double {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.tweet-media-double img {
  height: 200px;
}

.tweet-media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
}

.tweet-media-grid img {
  height: 150px;
}

/* Tweet action bar */
.tweet-actions {
  display: flex;
  gap: 0;
  margin-left: 50px;
  max-width: 400px;
  justify-content: space-between;
}

.tweet-action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #71767b;
  padding: 4px 8px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
  cursor: pointer;
}

.tweet-action:hover {
  color: #1d9bf0;
  background: rgba(29, 155, 240, 0.1);
}

.tweet-action svg {
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .tweet-body { margin-left: 0; margin-top: 8px; font-size: 14px; }
  .tweet-media { margin-left: 0; }
  .tweet-actions { margin-left: 0; }
  .tweet-avatar { width: 32px; height: 32px; font-size: 14px; }
  .tweet-name { font-size: 14px; }
  .tweet-username { font-size: 13px; }
  .tweet-media-single img { max-height: 200px; }
  .tweet-media-double img { height: 140px; }
  .tweet-media-grid img { height: 100px; }
}
