/* =========================================================
   Uncodemy — Python Modules Series
   Shared stylesheet (external, as requested)
   ========================================================= */

:root {
  --primary: #FF5421;
  --primary-dark: #E8451A;
  --primary-light: #FFF1EC;
  --ink: #1E2230;
  --ink-soft: #5B6172;
  --line: #ECEEF2;
  --bg: #F7F8FA;
  --card: #FFFFFF;
  --shadow-sm: 0 2px 10px rgba(30, 34, 48, 0.05);
  --shadow-md: 0 10px 30px rgba(30, 34, 48, 0.08);
  --shadow-lg: 0 18px 40px rgba(255, 84, 33, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --font-head: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 .6em;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; }
p { margin: 0 0 1em; color: var(--ink-soft); }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  max-width: 1560px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo img { height: 38px; width: auto; }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
  white-space: nowrap;
}
.btn-back:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb-wrap {
  max-width: 1560px;
  margin: 0 auto;
  padding: 18px 24px 0;
}
.breadcrumb {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}
.breadcrumb .sep { margin: 0 6px; color: #C9CCD6; }
.breadcrumb .current { color: var(--primary); font-weight: 600; }

/* ---------- Page layout: 3 columns ---------- */
.layout {
  max-width: 1560px;
  margin: 0 auto;
  padding: 18px 20px 60px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
}

/* ---------- Left sidebar ---------- */
.sidebar-left {
  position: sticky;
  top: 84px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 20px 14px;
}
.sidebar-left h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-soft);
  padding: 4px 10px 12px;
  margin: 0;
}
.topic-list { list-style: none; display: flex; flex-direction: column; gap: 4px;   max-height: calc(100vh - 104px);
  overflow-y: auto;overflow-x: hidden; flex-shrink: 0;}

.topic-list li a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  color: var(--ink-soft);
  font-weight: 500;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.topic-list li a .num {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  color: #B7BCC8;
  min-width: 20px;
}
.topic-list li a:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  transform: translateX(2px);
}
.topic-list li a.active {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.topic-list li a.active .num { color: rgba(255,255,255,.75); }

/* ---------- Main content ---------- */
.content {
  min-width: 0;
}
.content h1 {
  font-size: clamp(26px, 3vw, 34px);
  margin-bottom: .3em;
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 30px 32px;
  margin-top: 18px;
  animation: fadeIn .6s ease both;
}
.card h2 {
  font-size: 20px;
  margin-top: 1.4em;
  border-left: 4px solid var(--primary);
  padding-left: 12px;
}
.card h2:first-child { margin-top: 0; }
.card pre {
  background: #1E2230;
  color: #F3F4F8;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
}
.card code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 13.5px;
}
.card pre code { background: none; color: inherit; padding: 0; }
.card ul, .card ol { padding-left: 22px; color: var(--ink-soft); margin-bottom: 1em; }
.card li { margin-bottom: 8px; }

/* ---------- Prev / Next ---------- */
.prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 22px;
}
.prev-next a {
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 14px 18px;
  font-size: 13.5px;
  color: var(--ink-soft);
  transition: box-shadow .25s ease, transform .25s ease;
}
.prev-next a:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.prev-next .label { display: block; font-size: 11px; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.prev-next .next { text-align: right; }
.prev-next .disabled { opacity: .4; pointer-events: none; }

/* ---------- CTA box ---------- */
.cta-box {
  margin-top: 26px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-lg);
  flex-wrap: wrap;
}
.cta-box h3 { color: #fff; margin: 0 0 6px; font-size: 19px; }
.cta-box p { color: rgba(255,255,255,.85); margin: 0; }
.cta-box .btn-cta {
  background: #fff;
  color: var(--primary-dark);
  font-family: var(--font-head);
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 999px;
  white-space: nowrap;
  transition: transform .25s ease;
}
.cta-box .btn-cta:hover { transform: translateY(-2px) scale(1.03); }

/* ---------- Footer ---------- */
footer {
  background: var(--ink);
  color: #C9CCD6;
  margin-top: 40px;
  padding: 28px 24px;
}
.footer-inner {
  max-width: 1560px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13.5px;
}
.footer-inner a { color: var(--primary); font-weight: 600; }

/* =========================================================
   Right sidebar — premium sticky widget
   ========================================================= */
.sidebar-right {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: start;
  animation: fadeIn .7s ease both;
}

.batch-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.batch-card::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  background: var(--primary-light);
  border-radius: 50%;
}
.badge-floating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: 999px;
  animation: float 3s ease-in-out infinite;
  position: relative;
  z-index: 1;
}
.batch-card h4 {
  font-size: 17px;
  margin: 14px 0 4px;
  position: relative; z-index: 1;
}
.batch-card .batch-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 14px;
  position: relative; z-index: 1;
}
.countdown-box {
  position: relative;
  z-index: 1;
  background: var(--ink);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.countdown-label {
  font-size: 12px;
  font-weight: 500;
  color: #C9CCD6;
}
.countdown-value {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .02em;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.batch-meta {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 6px;
  position: relative; z-index: 1;
}
.batch-meta li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink);
}
.batch-meta li b { color: var(--ink-soft); font-weight: 500; }
.batch-meta .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.seats-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  color: #B8420A;
  background: #FFE7DB;
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.btn-landing {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14.5px;
  padding: 13px 16px;
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.btn-landing:hover {
  background: var(--primary-dark);
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.help-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 20px 22px;
}
.help-card h4 {
  font-size: 15px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.help-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  margin-bottom: 10px;
  font-size: 13.5px;
  transition: background .2s ease;
}
.help-row:hover { background: var(--primary-light); }
.help-row:last-child { margin-bottom: 0; }
.help-row .icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.help-row a { font-weight: 600; color: var(--ink); }

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* =========================================================
   Responsive behaviour
   ========================================================= */

/* Tablet: right sidebar moves below content, left sidebar stays but un-stuck */
@media (max-width: 1240px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-areas:
      "left main"
      "right right";
  }
  .sidebar-left { grid-area: left; }
  .content { grid-area: main; }
  .sidebar-right {
    grid-area: right;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .batch-card, .help-card { flex: 1 1 auto; }
}

/* Mobile: everything stacks, full width */
@media (max-width: 720px) {
  .topbar-inner { padding: 12px 16px; }
  .logo img { height: 30px; }
  .btn-back { padding: 9px 14px; font-size: 13px; }
  .breadcrumb-wrap { padding: 14px 16px 0; }
  .layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "main"
      "right";
    padding: 14px 16px 40px;
    gap: 16px;
  }
  .sidebar-left {
    position: static;
    max-height: none;
  }
  .topic-list li { flex: 1 1 auto; }
  .card { padding: 22px 18px; }
  .cta-box { flex-direction: column; align-items: flex-start; }
  .cta-box .btn-cta { width: 100%; text-align: center; }
  .prev-next { grid-template-columns: 1fr; }
  .prev-next .next { text-align: left; }
  .sidebar-right { flex-direction: column; }
  .footer-inner { flex-direction: column; text-align: center; }
}
