:root {
  --bg-color: #ffffff;
  --text-color: #1a1a1a;
  --accent-color: #007aff;
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --spacing: 2rem;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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



body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: var(--spacing);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.logo {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
}

.logo-img {
  height: clamp(1.5rem, 5vw, 2.5rem);
  width: auto;
  display: block;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: clamp(75rem, 92vw, 200rem);
  margin: 0 auto;
  padding: var(--spacing) clamp(1rem, 4vw, 2rem);
  width: 100%;
}

.section-title {
  font-size: 1.6rem;
  margin-bottom: var(--spacing);
  font-weight: 500;
  text-transform: uppercase;
  text-align: center;
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
}

@media (min-width: 48rem) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }


}

.category-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

.thumbnail-wrapper {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0.75rem;
  background: #f0f0f0;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.05);
  margin-bottom: 0.75rem;
  transition: var(--transition);
}

.category-card:hover .thumbnail-wrapper {
  transform: translateY(-0.25rem);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.1);
}

.thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.category-card:hover img {
  transform: scale(1.05);
}

.category-title {
  font-size: clamp(0.9rem, 0.9vw, 1.1rem);
  font-weight: 500;
}

/* Category Page (Videos) */
.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 48rem) {
  .video-grid {
    grid-template-columns: repeat(auto-fit, minmax(28.125rem, 1fr));
  }
}

.video-container {
  aspect-ratio: 16 / 9;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.1);
}

.video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Fallback UI Styles */
.video-item-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.youtube-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.video-fallback-ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  /* Sit between iframe and overlay */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.video-fallback-ui:not(.hidden) {
  opacity: 1;
  z-index: 10;
  /* Bring to front when detection triggers */
}

.video-fallback-ui img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.video-fallback-ui:hover img {
  opacity: 0.8;
}

.play-button-overlay {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  pointer-events: none;
}

.play-button-overlay svg {
  width: 4rem;
  height: 4rem;
  filter: drop-shadow(0 0.25rem 0.75rem rgba(0, 0, 0, 0.3));
}

.play-button-overlay span {
  font-weight: 600;
  text-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.5);
}

.hidden {
  display: none !important;
}

/* Footer */
footer {
  padding: var(--spacing);
  border-top: 0.0625rem solid #eee;
  padding-top: 4rem;
  font-size: 0.9rem;
  color: #666;
  flex-shrink: 0;
}

.footer-content {
  max-width: clamp(75rem, 92vw, 95rem);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-item {
  display: flex;
  gap: 1rem;
}

.footer-item a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.footer-item a:hover {
  color: var(--accent-color);
}

@media (min-width: 48rem) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }
}