@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* HSL Color System */
  --bg-dark-base: 224;
  --bg-primary: hsl(var(--bg-dark-base), 71%, 4%);
  --bg-surface: hsl(var(--bg-dark-base), 40%, 8%);
  --bg-card: hsla(var(--bg-dark-base), 35%, 12%, 0.65);
  --bg-card-hover: hsla(var(--bg-dark-base), 35%, 16%, 0.85);
  
  --text-primary: hsl(var(--bg-dark-base), 20%, 97%);
  --text-secondary: hsl(var(--bg-dark-base), 12%, 78%);
  --text-muted: hsl(var(--bg-dark-base), 10%, 55%);
  
  /* Vibrant Accents */
  --accent-primary: hsl(263, 85%, 63%);     /* Glowing Violet */
  --accent-secondary: hsl(186, 92%, 48%);   /* Neon Cyan */
  --accent-success: hsl(142, 72%, 45%);     /* Vibrant Emerald */
  --accent-yellow: hsl(45, 93%, 47%);       /* Warm Gold */
  
  /* Borders and Shadows */
  --border-color: hsla(var(--bg-dark-base), 20%, 100%, 0.08);
  --border-glow: hsla(263, 85%, 63%, 0.15);
  --border-glow-hover: hsla(186, 92%, 48%, 0.3);
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-neon: 0 0 25px hsla(263, 85%, 63%, 0.25);
  
  /* Transition timings */
  --transition-smooth: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.18s ease-in-out;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) var(--bg-surface);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-surface);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Atmospheric Background Glows */
body::before {
  content: '';
  position: absolute;
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, hsla(263, 85%, 63%, 0.08) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(80px);
}

body::after {
  content: '';
  position: absolute;
  bottom: 10%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, hsla(186, 92%, 48%, 0.06) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(100px);
}

/* App Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* --- Header Section --- */
header {
  text-align: center;
  margin-bottom: 3.5rem;
  position: relative;
  animation: fadeInDown 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.brand-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.brand-logo-glow {
  width: 14px;
  height: 14px;
  background: var(--accent-secondary);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--accent-secondary);
  animation: pulseGlow 2s infinite alternate;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--accent-secondary);
  text-shadow: 0 0 20px hsla(186, 92%, 48%, 0.3);
}

h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary) 20%, hsl(263, 85%, 75%) 50%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

header p {
  color: var(--text-secondary);
  font-size: 1.15rem;
  max-width: 650px;
  margin: 0 auto 1.5rem;
  font-weight: 300;
}

/* --- Stats Badges --- */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.stat-badge {
  background: hsla(var(--bg-dark-base), 35%, 15%, 0.5);
  border: 1px solid var(--border-color);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
}

.stat-badge:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.stat-badge span {
  font-weight: 700;
  color: var(--text-primary);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.badge-dot.purple { background-color: var(--accent-primary); box-shadow: 0 0 8px var(--accent-primary); }
.badge-dot.cyan { background-color: var(--accent-secondary); box-shadow: 0 0 8px var(--accent-secondary); }
.badge-dot.emerald { background-color: var(--accent-success); box-shadow: 0 0 8px var(--accent-success); }


/* --- Search & Controls Dashboard --- */
.dashboard {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  border-radius: 24px;
  padding: 1.5rem 2rem;
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeInUp 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
}

.dashboard::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), var(--accent-secondary), transparent);
  border-radius: 24px 24px 0 0;
  pointer-events: none;
}

.search-bar-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition-fast);
}

.search-input {
  width: 100%;
  background: hsla(var(--bg-dark-base), 35%, 6%, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1.05rem;
  padding: 1rem 1.25rem 1rem 3rem;
  border-radius: 16px;
  outline: none;
  transition: var(--transition-smooth);
}

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px hsla(263, 85%, 63%, 0.15), inset 0 0 10px hsla(263, 85%, 63%, 0.05);
}

.search-input:focus + .search-icon {
  color: var(--accent-primary);
}

/* Controls Grid */
.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* Segmented Switch Controllers */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  color: var(--text-muted);
}

.segmented-control {
  background: hsla(var(--bg-dark-base), 35%, 6%, 0.6);
  border: 1px solid var(--border-color);
  padding: 0.3rem;
  border-radius: 12px;
  display: inline-flex;
  gap: 0.25rem;
}

.seg-btn {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.seg-btn.active {
  background: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: 0 4px 12px hsla(263, 85%, 63%, 0.3);
}

.seg-btn:not(.active):hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}


/* --- Main Video Feed / Cards Grid --- */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  animation: fadeInUp 1s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Premium Card */
.video-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  position: relative;
}

.video-card:hover {
  transform: translateY(-8px) scale(1.005);
  border-color: var(--border-glow-hover);
  box-shadow: var(--shadow-lg), 0 0 30px hsla(186, 92%, 48%, 0.1);
}

/* Card Header */
.card-header {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}

.card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.type-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.type-badge.video {
  background: hsla(263, 85%, 63%, 0.15);
  color: hsl(263, 100%, 75%);
  border: 1px solid hsla(263, 85%, 63%, 0.25);
}

.type-badge.short {
  background: hsla(186, 92%, 48%, 0.12);
  color: hsl(186, 95%, 55%);
  border: 1px solid hsla(186, 92%, 48%, 0.25);
}

.yt-link-btn {
  background: hsla(0, 85%, 60%, 0.12);
  border: 1px solid hsla(0, 85%, 60%, 0.25);
  color: hsl(0, 95%, 70%);
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

.yt-link-btn:hover {
  background: hsl(0, 85%, 60%);
  color: var(--text-primary);
  border-color: hsl(0, 85%, 60%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.25);
}

.video-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

/* YouTube Iframe Wrapper */
.video-media-container {
  position: relative;
  width: 100%;
  /* 16:9 Aspect Ratio */
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
  overflow: hidden;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.video-media-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Subtitles / Transcripts Segment */
.transcript-section {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.15) 100%);
}

.transcript-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lang-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--text-muted);
}

.lang-header.en {
  color: hsl(210, 80%, 75%);
}

.lang-header.es {
  color: hsl(45, 95%, 70%);
}

.transcript-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 0.85rem 1rem;
  border-radius: 12px;
  max-height: 180px;
  overflow-y: auto;
  transition: var(--transition-fast);
}

.transcript-text:hover {
  background: rgba(255, 255, 255, 0.04);
}

.transcript-text.muted {
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.01);
}

/* Instagram Link Button */
.ig-link-btn {
  background: hsla(320, 70%, 55%, 0.12);
  border: 1px solid hsla(320, 70%, 55%, 0.28);
  color: hsl(320, 85%, 75%);
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

.ig-link-btn:hover {
  background: linear-gradient(45deg, #f09433, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888);
  color: var(--text-primary);
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 39, 67, 0.3);
}

/* Post Caption / Description Block (Instagram reels) */
.caption-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: hsla(320, 60%, 55%, 0.05);
  border: 1px solid hsla(320, 60%, 55%, 0.15);
}

.caption-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: hsl(320, 80%, 75%);
}

.caption-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  white-space: pre-line;
}

.caption-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.caption-tag.en {
  background: hsla(210, 80%, 60%, 0.18);
  color: hsl(210, 80%, 78%);
}

.caption-tag.es {
  background: hsla(45, 90%, 55%, 0.18);
  color: hsl(45, 95%, 72%);
}

/* Empty State / Not Found */
.empty-state {
  grid-column: span 2;
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: 24px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.empty-state-icon {
  font-size: 3rem;
  color: var(--text-muted);
  animation: float 3s ease-in-out infinite;
}

/* Footer Section */
footer {
  margin-top: 5rem;
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

footer a {
  color: var(--accent-secondary);
  text-decoration: none;
  font-weight: 600;
}

footer a:hover {
  text-decoration: underline;
}

/* Featured Video & Vimeo Link Styles */
.video-card.featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, hsla(var(--bg-dark-base), 35%, 15%, 0.85) 0%, hsla(var(--bg-dark-base), 35%, 8%, 0.95) 100%);
  border: 1px solid var(--accent-primary);
  box-shadow: 0 0 35px hsla(263, 85%, 63%, 0.25), var(--shadow-lg);
}

.video-card.featured:hover {
  border-color: var(--accent-secondary);
  box-shadow: var(--shadow-lg), 0 0 35px hsla(186, 92%, 48%, 0.2);
}

.vimeo-link-btn {
  background: hsla(186, 92%, 48%, 0.12);
  border: 1px solid hsla(186, 92%, 48%, 0.25);
  color: hsl(186, 95%, 65%);
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

.vimeo-link-btn:hover {
  background: hsl(186, 92%, 48%);
  color: hsl(var(--bg-dark-base), 71%, 4%);
  border-color: hsl(186, 92%, 48%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px hsla(186, 92%, 48%, 0.35);
}

/* --- KEYFRAME ANIMATIONS --- */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 10px var(--accent-secondary), 0 0 20px var(--accent-secondary);
    transform: scale(0.95);
  }
  100% {
    box-shadow: 0 0 20px var(--accent-secondary), 0 0 35px var(--accent-secondary);
    transform: scale(1.05);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}


/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 1100px) {
  .feed-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .empty-state {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.3rem;
  }
  .dashboard {
    padding: 1.25rem 1.25rem;
  }
  .controls-row {
    flex-direction: column;
    align-items: stretch;
  }
  .segmented-control {
    width: 100%;
    justify-content: space-around;
  }
  .seg-btn {
    flex-grow: 1;
    text-align: center;
    justify-content: center;
  }
}
