/* Smart Home Insights - Showcase Styles */

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* Subtle circuit-board background pattern */
.circuit-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg stroke='%230ea5e9' stroke-width='1' opacity='0.25'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Scroll reveal base state */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease-out, transform 0.55s ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delay for sequential reveals */
.reveal:nth-child(1) { transition-delay: 0s; }
.reveal:nth-child(2) { transition-delay: 80ms; }
.reveal:nth-child(3) { transition-delay: 160ms; }
.reveal:nth-child(4) { transition-delay: 240ms; }
.reveal:nth-child(5) { transition-delay: 320ms; }
.reveal:nth-child(6) { transition-delay: 400ms; }

/* Topic cards */
.topic-card {
  position: relative;
  padding: 1.75rem;
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -15px rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.3);
}

/* Video cards in the recent-videos sidebar */
.video-card {
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.video-card.active {
  background-color: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.5);
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.2);
}

.video-card.active .video-card-title {
  color: #38bdf8;
}

/* Video list height matches the player at all sizes */
#video-list {
  max-height: min(360px, 90vw);
}

@media (min-width: 1024px) {
  #video-list {
    max-height: min(380px, 30vw);
  }
}

/* Custom scrollbar for the video list */
#video-list::-webkit-scrollbar {
  width: 6px;
}

#video-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

#video-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

#video-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Video container */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: 1rem;
  overflow: hidden;
}

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

/* YouTube iframe border override */
iframe {
  border: 0;
}

/* Header blur support */
header {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }
  .topic-card {
    transition: none;
  }
}
