:root {
  --bg: #0c1020;
  --bg-2: #151b2c;
  --accent: #ffb454;
  --accent-2: #66f0d1;
  --card: rgba(255, 255, 255, 0.06);
  --text: #f5f7ff;
  --muted: rgba(245, 247, 255, 0.7);
  --stroke: rgba(255, 255, 255, 0.12);
}

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

body {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(800px 400px at 10% 10%, rgba(102, 240, 209, 0.25), transparent 60%),
    radial-gradient(700px 500px at 90% 10%, rgba(255, 180, 84, 0.25), transparent 60%),
    linear-gradient(180deg, #0b0f1e 0%, #11162a 50%, #0b0f1e 100%);
  z-index: -1;
}

.hero {
  padding: 48px 24px 32px;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.brand {
  display: flex;
  gap: 16px;
  align-items: center;
}

.logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #ff6f61);
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-size: 26px;
  color: #1a1a1a;
  font-weight: 700;
}

h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.2rem;
}

.hero p {
  color: var(--muted);
}

.search {
  display: flex;
  gap: 12px;
  background: var(--card);
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
}

.search-field {
  position: relative;
  flex: 1;
}

.search input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1rem;
}

.search button {
  background: var(--accent);
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.suggestions {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  background: #0f1324;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  display: none;
  z-index: 5;
  max-height: 260px;
  overflow: auto;
}

.suggestions.show {
  display: block;
}

.suggestion-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.suggestion-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.status {
  font-size: 0.9rem;
  color: var(--muted);
}

.api-key {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.api-key input {
  flex: 1;
  min-width: 240px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: #0f1324;
  color: var(--text);
}

.api-key button {
  background: #1f2845;
  border: 1px solid var(--stroke);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.key-status {
  font-size: 0.85rem;
  color: var(--muted);
}

.content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 60px;
  display: grid;
  gap: 36px;
}

.section {
  display: grid;
  gap: 16px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.section-header h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.5rem;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
}

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

.load-more {
  justify-self: center;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
}

.load-more[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  display: grid;
  grid-template-rows: 220px auto;
  transition: transform 0.2s ease, border 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 180, 84, 0.4);
}

.thumb {
  background-size: cover;
  background-position: center;
  filter: saturate(1.1);
}

.card-body {
  padding: 12px;
  display: grid;
  gap: 6px;
}

.card-title {
  font-weight: 600;
}

.card-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 14, 0.7);
}

.modal-card {
  position: relative;
  background: #12172b;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  width: min(1000px, 95vw);
  max-height: 90vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--stroke);
}

.modal-header h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.4rem;
}

.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--stroke);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.modal-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  padding: 20px 24px;
}

.poster {
  width: 200px;
  height: 300px;
  border-radius: 14px;
  background: #1d2238 center/cover no-repeat;
}

.details {
  display: grid;
  gap: 16px;
}

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.meta-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
}

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.controls.hidden {
  display: none;
}

.field {
  display: grid;
  gap: 6px;
}

.field input {
  width: 80px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: #0f1324;
  color: var(--text);
}

.controls button {
  background: var(--accent-2);
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.sources {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.captions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.caption-btn {
  background: #172033;
  border: 1px solid var(--stroke);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
}

.source-btn {
  background: #1f2845;
  border: 1px solid var(--stroke);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.player {
  border-top: 1px solid var(--stroke);
  background: #0b0f1e;
  padding: 16px 24px 24px;
}

.player video {
  width: 100%;
  max-height: 380px;
  border-radius: 12px;
  background: black;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  color: var(--muted);
  border-top: 1px solid var(--stroke);
}

@media (max-width: 800px) {
  .modal-body {
    grid-template-columns: 1fr;
  }

  .poster {
    width: 100%;
    height: 260px;
  }

  .footer {
    flex-direction: column;
  }
}
