/* ==========================================================================
   STAR WARS: GALAXY TIMELINE & JEDI FORGE HUD (TV Play)
   ========================================================================== */

:root {
  --sw-bg: #05070d;
  --sw-space: #0b0f19;
  --sw-card-bg: rgba(14, 20, 32, 0.75);
  --sw-border: rgba(0, 210, 255, 0.15);
  --sw-border-hover: rgba(0, 210, 255, 0.45);
  --sw-gold: #f39c12;
  --sw-yellow: #ffe81f; /* Iconic Star Wars Yellow */
  --sw-blue: #00d2ff;
  --sw-green: #00e676;
  --sw-red: #ff2a4d;
  --sw-purple: #b700ff;
  --sw-white: #ffffff;
  --sw-dark: #121212;
  --sw-text: #e2e8f0;
  --sw-muted: #8492a6;
  --sw-glow-blue: 0 0 20px rgba(0, 210, 255, 0.45);
  --sw-glow-green: 0 0 20px rgba(0, 230, 118, 0.45);
  --sw-glow-red: 0 0 20px rgba(255, 42, 77, 0.45);
  --sw-glow-purple: 0 0 20px rgba(183, 0, 255, 0.45);
  --sw-glow-white: 0 0 20px rgba(255, 255, 255, 0.55);
  --sw-glow-dark: 0 0 22px rgba(255, 255, 255, 0.85);
}

.starwars-universe-view {
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: swFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: 60px;
}

@keyframes swFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   STAR WARS HUD HERO: FORCE LEVEL & KYBER FORGE
   ========================================================================== */

.sw-hud-hero {
  position: relative;
  background: radial-gradient(circle at 80% 20%, rgba(0, 210, 255, 0.12) 0%, transparent 50%),
              radial-gradient(circle at 10% 90%, rgba(255, 42, 77, 0.08) 0%, transparent 45%),
              linear-gradient(135deg, #070a12 0%, #0d1322 100%);
  border: 1px solid rgba(0, 210, 255, 0.22);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sw-hud-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #00d2ff, #00e676, #ffe81f, #ff2a4d, #b700ff);
  opacity: 0.85;
}

.sw-hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.sw-title-group {
  max-width: 620px;
}

.sw-brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 900 11px/1 Manrope, sans-serif;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sw-yellow);
  background: rgba(255, 232, 31, 0.1);
  border: 1px solid rgba(255, 232, 31, 0.3);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.sw-title-group h1 {
  font: 900 28px/1.15 'DM Sans', Manrope, sans-serif;
  color: #ffffff;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  text-shadow: 0 0 24px rgba(0, 210, 255, 0.3);
}

.sw-title-group p {
  font: 400 14px/1.55 'DM Sans', sans-serif;
  color: var(--sw-muted);
  margin: 0;
}

/* Force Rank Card */
.sw-profile-hud {
  background: rgba(8, 12, 22, 0.75);
  border: 1px solid rgba(0, 210, 255, 0.2);
  border-radius: 16px;
  padding: 16px 20px;
  min-width: 300px;
  backdrop-filter: blur(12px);
}

.sw-rank-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.sw-avatar-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.2) 0%, rgba(5, 7, 13, 0.9) 100%);
  border: 2px solid var(--sw-blue);
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.4);
}

.sw-rank-info small {
  display: block;
  font: 800 10px/1 Manrope, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sw-blue);
  margin-bottom: 4px;
}

.sw-rank-info strong {
  display: block;
  font: 800 16px/1.2 Manrope, sans-serif;
  color: #fff;
}

.sw-xp-bar-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sw-xp-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.sw-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sw-blue), #00ffcc, var(--sw-green));
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.8);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.sw-xp-labels {
  display: flex;
  justify-content: space-between;
  font: 500 12px/1 'DM Sans', sans-serif;
  color: var(--sw-muted);
}

.sw-xp-labels b {
  color: #fff;
}

/* ==========================================================================
   KYBER CRYSTAL FORGE & LIGHTSABER TRACKER
   ========================================================================== */

.sw-kyber-forge-hud {
  background: rgba(5, 8, 15, 0.85);
  border: 1px solid rgba(0, 210, 255, 0.25);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: inset 0 0 20px rgba(0, 210, 255, 0.04);
}

.forge-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.forge-title span {
  font-size: 26px;
  filter: drop-shadow(0 0 8px rgba(0, 210, 255, 0.6));
}

.forge-title strong {
  display: block;
  font: 800 15px/1.2 Manrope, sans-serif;
  color: #fff;
}

.forge-title small {
  display: block;
  font: 500 12px/1 'DM Sans', sans-serif;
  color: var(--sw-muted);
  margin-top: 2px;
}

.kyber-crystals-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kyber-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font: 700 12px/1 Manrope, sans-serif;
  background: rgba(14, 20, 32, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.kyber-pill i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.kyber-pill.crystal-blue.unlocked i { background: var(--sw-blue); box-shadow: var(--sw-glow-blue); }
.kyber-pill.crystal-green.unlocked i { background: var(--sw-green); box-shadow: var(--sw-glow-green); }
.kyber-pill.crystal-red.unlocked i { background: var(--sw-red); box-shadow: var(--sw-glow-red); }
.kyber-pill.crystal-purple.unlocked i { background: var(--sw-purple); box-shadow: var(--sw-glow-purple); }
.kyber-pill.crystal-white.unlocked i { background: var(--sw-white); box-shadow: var(--sw-glow-white); }
.kyber-pill.crystal-darksaber.unlocked i { 
  background: #111; 
  border: 1px solid #fff; 
  box-shadow: var(--sw-glow-dark); 
}

.kyber-pill.unlocked {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

.kyber-pill.active-filter {
  outline: 2px solid var(--sw-yellow);
  background: rgba(255, 232, 31, 0.15) !important;
  color: #fff !important;
}

.kyber-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 210, 255, 0.5);
}

.sw-achievements-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 232, 31, 0.12);
  border: 1px solid rgba(255, 232, 31, 0.35);
  color: var(--sw-yellow);
  font: 800 13px/1 Manrope, sans-serif;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sw-achievements-btn:hover {
  background: rgba(255, 232, 31, 0.25);
  transform: scale(1.03);
}

/* ==========================================================================
   CONTROLS BAR: TIMELINE VS ERAS & FILTERS
   ========================================================================== */

.sw-controls-bar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(11, 16, 28, 0.85);
  border: 1px solid rgba(0, 210, 255, 0.15);
  border-radius: 16px;
  padding: 18px 20px;
  backdrop-filter: blur(16px);
}

.sw-mode-switcher {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sw-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font: 700 13px/1 Manrope, sans-serif;
  color: var(--sw-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sw-mode-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.25) 0%, rgba(0, 110, 255, 0.4) 100%);
  border: 1px solid rgba(0, 210, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 210, 255, 0.2);
}

/* Era Pills Ribbon */
.sw-era-ribbon {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.sw-era-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font: 700 12px/1 Manrope, sans-serif;
  color: var(--sw-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.sw-era-pill:hover {
  color: #fff;
  border-color: rgba(0, 210, 255, 0.3);
}

.sw-era-pill.active {
  color: #fff;
  background: rgba(0, 210, 255, 0.15);
  border-color: var(--sw-blue);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

/* Filter Tags & Search */
.sw-filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.sw-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(5, 8, 15, 0.8);
  border: 1px solid rgba(0, 210, 255, 0.2);
  border-radius: 10px;
  padding: 8px 14px;
  flex: 1;
  min-width: 260px;
  max-width: 460px;
}

.sw-search-box span {
  color: var(--sw-blue);
  font-size: 16px;
}

.sw-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font: 500 13px 'DM Sans', sans-serif;
  width: 100%;
}

.sw-tags-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sw-filter-tag {
  padding: 7px 12px;
  border-radius: 8px;
  font: 700 11px/1 Manrope, sans-serif;
  color: var(--sw-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sw-filter-tag:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.sw-filter-tag.active {
  color: #fff;
  background: rgba(0, 210, 255, 0.2);
  border-color: var(--sw-blue);
}

/* ==========================================================================
   GALACTIC TIMELINE (BBY / ABY ORDER)
   ========================================================================== */

.sw-timeline-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sw-timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 210, 255, 0.15);
}

.sw-timeline-header h2 {
  font: 800 20px/1.2 Manrope, sans-serif;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sw-timeline-header span {
  font: 500 13px 'DM Sans', sans-serif;
  color: var(--sw-muted);
}

.sw-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  padding-left: 32px;
}

.sw-timeline-list::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 12px;
  width: 2px;
  background: linear-gradient(180deg, var(--sw-blue), var(--sw-green), var(--sw-red), var(--sw-yellow));
  opacity: 0.6;
}

.sw-timeline-card {
  position: relative;
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 20px;
  background: var(--sw-card-bg);
  border: 1px solid var(--sw-border);
  border-radius: 14px;
  padding: 14px;
  align-items: center;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
}

.sw-timeline-card::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sw-blue);
  box-shadow: 0 0 10px var(--sw-blue);
  border: 2px solid #05070d;
}

.sw-timeline-card.watched::before {
  background: var(--sw-green);
  box-shadow: 0 0 12px var(--sw-green);
}

.sw-timeline-card:hover {
  transform: translateX(4px);
  border-color: var(--sw-border-hover);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.sw-card-poster {
  width: 140px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  background: #080c16;
  position: relative;
  flex-shrink: 0;
}

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

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

.sw-card-bby-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0, 210, 255, 0.4);
  color: var(--sw-blue);
  font: 800 10px/1 Manrope, sans-serif;
  padding: 3px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.sw-card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sw-card-info-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sw-era-tag {
  font: 700 10px/1 Manrope, sans-serif;
  color: var(--sw-yellow);
  background: rgba(255, 232, 31, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
}

.sw-type-tag {
  font: 700 10px/1 Manrope, sans-serif;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
}

.sw-card-title {
  font: 800 16px/1.2 Manrope, sans-serif;
  color: #fff;
  margin: 0;
}

.sw-card-desc {
  font: 400 12px/1.45 'DM Sans', sans-serif;
  color: var(--sw-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sw-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sw-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #00d2ff 0%, #0077ff 100%);
  color: #fff;
  font: 800 12px/1 Manrope, sans-serif;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 210, 255, 0.35);
}

.sw-play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 210, 255, 0.55);
}

.sw-watched-check {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sw-watched-check.checked {
  background: var(--sw-green);
  border-color: var(--sw-green);
  color: #05070d;
  font-weight: 900;
  box-shadow: 0 0 12px var(--sw-green);
}

/* ==========================================================================
   ERAS CATALOG GRID VIEW
   ========================================================================== */

.sw-era-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sw-era-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 210, 255, 0.15);
}

.sw-era-header h2 {
  font: 800 22px/1.2 Manrope, sans-serif;
  color: #fff;
  margin: 0 0 4px;
}

.sw-era-header p {
  font: 400 13px/1.4 'DM Sans', sans-serif;
  color: var(--sw-muted);
  margin: 0;
}

.sw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.sw-card {
  background: var(--sw-card-bg);
  border: 1px solid var(--sw-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
}

.sw-card:hover {
  transform: translateY(-4px);
  border-color: var(--sw-border-hover);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.sw-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  background: #080c16;
}

.sw-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sw-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
}

.sw-badges-corner {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.sw-badge-4k {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: #fff;
  font: 900 9px/1 Manrope, sans-serif;
  padding: 3px 6px;
  border-radius: 4px;
}

.sw-badge-audio {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  color: #fff;
  font: 700 9px/1 Manrope, sans-serif;
  padding: 3px 6px;
  border-radius: 4px;
}

.sw-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.sw-card-body h3 {
  font: 800 14px/1.25 Manrope, sans-serif;
  color: #fff;
  margin: 0;
}

.sw-card-meta {
  display: flex;
  justify-content: space-between;
  font: 500 11px 'DM Sans', sans-serif;
  color: var(--sw-muted);
}

/* Series Modal for Star Wars */
.sw-series-modal {
  border: 1px solid rgba(0, 210, 255, 0.3);
  border-radius: 20px;
  background: #080c16;
  color: #fff;
  padding: 0;
  max-width: 760px;
  width: 92vw;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
}

.sw-series-modal::backdrop {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .sw-hud-top {
    flex-direction: column;
  }
  .sw-profile-hud {
    width: 100%;
    min-width: 0;
  }
  .sw-timeline-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .sw-card-poster {
    width: 100%;
    height: 140px;
  }
}
