@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;600;700&family=Space+Grotesk:wght@400;600&display=swap");

:root {
  --bg: #0f0f0f;
  --bg-soft: #181818;
  --bg-card: #202020;
  --accent: #ff0000;
  --accent-soft: #ff5a3c;
  --text: #f1f1f1;
  --muted: #b3b3b3;
  --stroke: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  background: radial-gradient(circle at top left, #1a1a1a 0%, #0f0f0f 55%);
  color: var(--text);
  min-height: 100vh;
}

.ambient {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 15% 20%, rgba(255, 0, 0, 0.15), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(255, 90, 60, 0.12), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.06), transparent 45%);
  pointer-events: none;
  z-index: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--stroke);
}


.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  color: var(--text);
}

.logo-dot {
  position: relative;
  width: 24px;
  height: 16px;
  border-radius: 4px;
  background: #ff3b30;
  box-shadow: 0 0 14px rgba(255, 59, 48, 0.5);
}

.logo-dot::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 4px;
  width: 0;
  height: 0;
  border-left: 6px solid #fff;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.search {
  display: flex;
  gap: 0;
  flex: 1;
  max-width: 620px;
  background: #0f141c;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  overflow: hidden;
}

.search input {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text);
}

.search button,
.actions button,
.like-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #0d1117;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search button {
  width: 52px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: #1b2230;
  color: var(--muted);
}

.search svg {
  width: 18px;
  height: 18px;
}

.actions {
  display: flex;
  align-items: center;
}

.count-badge {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  font-family: "IBM Plex Sans", sans-serif;
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
  line-height: 1;
}

.count-icon {
  font-weight: 700;
  font-size: 12px;
  opacity: 0.7;
}

.count-text {
  font-size: 11px;
  letter-spacing: 0.2px;
}

.search button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 0 40px 60px 0;
}

.sidebar {
  background: rgba(21, 27, 36, 0.75);
  border: 1px solid var(--stroke);
  border-radius: 0 20px 20px 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: calc(100vh - 64px);
  margin-top: 64px;
  z-index: 9;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

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

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}

.sidebar:hover::-webkit-scrollbar-thumb,
.sidebar:focus-within::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
}

.nav-title {
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.nav-note {
  margin-top: auto;
  font-size: 12px;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.06);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #ffe6f1;
  border: none;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-left: 244px;
  padding-top: 16px;
}



.meta {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  animation: fadeIn 0.6s ease;
}

.card {
  background: var(--bg-card);
  border-radius: 18px;
  border: 1px solid var(--stroke);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  animation: rise 0.5s ease;
}

.frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
}

.frame iframe,
.frame img,
.frame .thumb-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.thumb-btn {
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}

.frame img {
  object-fit: cover;
  filter: saturate(1.05);
}

.play-badge {
  position: absolute;
  inset: auto;
  left: 16px;
  bottom: 16px;
  background: rgba(13, 17, 23, 0.75);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--stroke);
}

.player-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.player-overlay.open {
  display: flex;
}

.player-shell {
  width: min(920px, 92vw);
  display: grid;
  gap: 12px;
}

.player-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  box-sizing: border-box;
}

#ytPlayer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#ytPlayer iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 2px);
  margin: 0 1px;
  box-sizing: border-box;
}


.player-skip {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  position: relative;
}

.player-skip::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}

.player-skip.prev::before {
  border-right: 14px solid #ffe6f1;
  margin-left: 16px;
}

.player-skip.next::before {
  border-left: 14px solid #ffe6f1;
  margin-right: 16px;
}

.player-skip.floating {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
}

.player-skip.floating.prev {
  left: 16px;
}

.player-skip.floating.next {
  right: 16px;
}

.player-like {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 12px;
}

.player-like.liked {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #ffe6f1;
  border: none;
}

.player-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  cursor: pointer;
}

.player-toggle::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 12px;
  width: 0;
  height: 0;
  border-left: 10px solid #ffe6f1;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.player-toggle.paused::before {
  border-left: 0;
  width: 10px;
  height: 12px;
  left: 16px;
  top: 14px;
  background: linear-gradient(90deg, #ffe6f1 0 3px, transparent 3px 6px, #ffe6f1 6px 9px);
}

.player-progress {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  cursor: pointer;
}

.player-progress-fill {
  position: absolute;
  inset: 0;
  transform-origin: left;
  transform: scaleX(0);
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
}

.player-close {
  justify-self: end;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  cursor: pointer;
}

.player-close::before,
.player-close::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 17px;
  width: 2px;
  height: 16px;
  background: #ffe6f1;
}

.player-close::before {
  transform: rotate(45deg);
}

.player-close::after {
  transform: rotate(-45deg);
}

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

.card-title {
  font-weight: 600;
  font-size: 15px;
}

.card-meta {
  color: var(--muted);
  font-size: 13px;
}

.card-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.like-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 8px 14px;
  border: 1px solid var(--stroke);
}

.like-btn.liked {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #ffe6f1;
  border: none;
}

.card-tag {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
}

.empty {
  padding: 40px;
  border-radius: 20px;
  border: 1px dashed var(--stroke);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.load-more {
  display: flex;
  justify-content: center;
  padding: 10px 0 30px;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.load-more-status {
  color: transparent;
  font-size: 0;
}

.load-more-sentinel {
  width: 100%;
  height: 1px;
}

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

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

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search {
    width: 100%;
  }

  .meta {
    grid-template-columns: 1fr;
  }
}
