/* =============================================
   SMARTIEHUB AI LEARNING — STYLES v2
   Matches smartiehub.com: Rubik font, #ff416c–#ff4b2b gradient
   ============================================= */

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

:root {
  --red1:     #ff416c;
  --red2:     #ff4b2b;
  --grad:     linear-gradient(to right, #ff416c, #ff4b2b);
  --grad-diag:linear-gradient(135deg, #ff416c, #ff4b2b);
  --dark:     #1e1e2e;
  --dark2:    #16162a;
  --text:     #333333;
  --muted:    #808080;
  --light-bg: #f7f8fc;
  --white:    #ffffff;
  --border:   #e8e8e8;
  --radius:   10px;
  --radius-lg:16px;
  --shadow:   0 2px 16px rgba(0,0,0,.07);
  --shadow-md:0 6px 28px rgba(0,0,0,.10);
  --shadow-hover: 0 10px 36px rgba(255,65,108,.20);
  --transition: .22s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Rubik', sans-serif;
  background: var(--white);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ===================== TOP BAR ===================== */
.top-bar {
  background: var(--grad);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  padding: 9px 16px;
  letter-spacing: .2px;
}

/* ===================== HEADER ===================== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo-link { display: flex; align-items: center; }

.site-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.logo-fallback {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-star { font-size: 1.3rem; }

.header-nav {
  display: flex;
  gap: 28px;
  align-items: center;
}

.header-nav a {
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--transition);
}

.header-nav a:hover { color: var(--red1); }

/* ===================== HERO ===================== */
.hero {
  background: var(--dark);
  padding: 80px 28px 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle background decoration */
.hero::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: rgba(255,65,108,.12);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: rgba(255,75,43,.10);
  pointer-events: none;
}

.hero-inner {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,65,108,.18);
  border: 1px solid rgba(255,65,108,.35);
  color: #ff8fa3;
  font-size: .8rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 50px;
  margin-bottom: 24px;
  letter-spacing: .4px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.12;
  margin-bottom: 20px;
}

.hero-highlight {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  color: rgba(255,255,255,.6);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

/* ---- SEARCH ---- */
.search-form {
  display: flex;
  gap: 10px;
  max-width: 580px;
  margin: 0 auto 12px;
}

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

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: #aaa;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 15px 16px 15px 44px;
  font-size: .95rem;
  font-family: 'Rubik', sans-serif;
  border: none;
  border-radius: var(--radius);
  background: rgba(255,255,255,.95);
  color: var(--text);
  outline: none;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
  transition: box-shadow var(--transition);
}

.search-input:focus { box-shadow: 0 2px 12px rgba(255,65,108,.3); }
.search-input::placeholder { color: #aaa; }

.search-btn {
  padding: 15px 22px;
  background: var(--grad);
  color: #fff;
  font-size: .88rem;
  font-weight: 700;
  font-family: 'Rubik', sans-serif;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: 0 4px 16px rgba(255,65,108,.35);
}

.search-btn:hover { opacity: .9; transform: translateY(-1px); }

.search-note {
  font-size: .78rem;
  color: rgba(255,255,255,.35);
}

/* ===================== STATS STRIP ===================== */
.stats-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  flex-wrap: wrap;
}

.stat {
  padding: 4px 32px;
  font-size: .88rem;
  color: var(--muted);
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ===================== MAIN SECTION ===================== */
.main-section {
  background: var(--light-bg);
  padding: 48px 0 64px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}

.main-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}

/* ===================== TOPIC NAV (LEFT) ===================== */
.topic-nav {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 90px;
}

.nav-heading {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.topic-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
}

.topic-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: .88rem;
  font-weight: 500;
  font-family: 'Rubik', sans-serif;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all var(--transition);
  line-height: 1.3;
}

.topic-btn:hover {
  background: var(--light-bg);
  color: var(--text);
}

.topic-btn.active {
  background: linear-gradient(to right, rgba(255,65,108,.1), rgba(255,75,43,.06));
  color: var(--red1);
  font-weight: 600;
  border-left: 3px solid var(--red1);
  padding-left: 9px;
}

.topic-btn .topic-emoji {
  font-size: 1rem;
  min-width: 20px;
}

.nav-cta {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.nav-cta p {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.btn-outline {
  display: block;
  text-align: center;
  padding: 10px 14px;
  border: 2px solid var(--red1);
  color: var(--red1);
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-outline:hover {
  background: var(--red1);
  color: #fff;
}

/* ===================== VIDEO AREA (RIGHT) ===================== */
.video-area { min-width: 0; }

.video-area-header {
  margin-bottom: 24px;
}

.video-area-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.video-area-desc {
  font-size: .9rem;
  color: var(--muted);
}

/* ===================== VIDEO GRID ===================== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ===================== VIDEO CARD ===================== */
.video-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.video-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.video-thumb-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #111;
  cursor: pointer;
}

.video-thumb-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--transition);
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  transition: background var(--transition);
}

.play-overlay:hover { background: rgba(0,0,0,.15); }

.play-btn {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(255,65,108,.5);
  transition: transform var(--transition);
}

.play-overlay:hover .play-btn { transform: scale(1.1); }

.play-btn svg {
  width: 20px; height: 20px;
  fill: #fff;
  margin-left: 3px;
}

.video-info {
  padding: 14px 16px 16px;
}

.video-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-channel {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--muted);
  font-weight: 500;
}

.channel-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--grad);
  flex-shrink: 0;
}

.watch-link {
  display: inline-block;
  margin-top: 10px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--red1);
  transition: opacity var(--transition);
}

.watch-link:hover { opacity: .75; }

/* ===================== CTA BANNER ===================== */
.cta-banner {
  background: var(--grad-diag);
  padding: 64px 28px;
  text-align: center;
}

.cta-inner { max-width: 560px; margin: 0 auto; }

.cta-banner h2 {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.cta-banner p {
  color: rgba(255,255,255,.8);
  font-size: 1rem;
  margin-bottom: 28px;
  line-height: 1.6;
}

.btn-white {
  display: inline-block;
  padding: 14px 32px;
  background: #fff;
  color: var(--red1);
  font-weight: 700;
  font-size: .95rem;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,.2);
}

/* ===================== FOOTER ===================== */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,.7);
  padding: 56px 28px 0;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.footer-brand {
  max-width: 280px;
}

.footer-logo-text {
  display: inline-block;
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: -0.3px;
  margin-bottom: 12px;
}

.footer-logo-star {
  color: var(--red1);
  margin-right: 5px;
}

.footer-tagline {
  font-size: .88rem;
  color: rgba(255,255,255,.45);
  line-height: 1.6;
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 48px;
}

.footer-col h4 {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  margin-bottom: 14px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col a {
  font-size: .85rem;
  color: rgba(255,255,255,.6);
  transition: color var(--transition);
}

.footer-col a:hover { color: var(--red1); }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
  font-size: .78rem;
  color: rgba(255,255,255,.25);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .topic-nav {
    position: static;
    padding: 16px;
  }

  .topic-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .topic-btn {
    padding: 8px 14px;
    border-radius: 50px;
    width: auto;
    font-size: .82rem;
  }

  .topic-btn.active {
    border-left: none;
    border: 2px solid var(--red1);
    padding-left: 14px;
    background: linear-gradient(to right, rgba(255,65,108,.1), rgba(255,75,43,.06));
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-links-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }
}

@media (max-width: 600px) {
  .header-nav { display: none; }

  .hero { padding: 56px 20px 52px; }

  .search-form { flex-direction: column; }

  .stats-strip { gap: 0; }
  .stat { padding: 8px 16px; }
  .stat-divider { display: none; }

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

  .footer-links-grid { grid-template-columns: 1fr; }
}

/* ---- RESOURCE BACKLINKS ---- */
.video-area-resources {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  line-height: 1.6;
  min-height: 1.4em; /* prevents layout jump when resources appear/disappear */
}

.resources-label {
  color: var(--muted);
  font-weight: 500;
  margin-right: 0.35rem;
}

.resources-link {
  color: var(--red1);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.resources-link:hover {
  color: var(--red2);
  text-decoration: underline;
}
