/* EXACT nbdev.fast.ai colors and styling - NO GUESSING */
/* Source: https://nbdev.fast.ai/index.css */

:root {
  /* EXACT nbdev colors */
  --background: #33373f; /* Main dark background */
  --background-2: #41454e; /* Cards and features */
  --foreground: white; /* Primary text */
  --foreground-2: #484d54; /* Borders */
  --accent-blue: #009af1; /* Bright blue accent */
  --muted-text: #a2a8b4; /* Secondary text */
  --content-width: 1000px; /* Max content width */
}

/* Hide ALL numbering */
.chapter-number,
.section-number,
h1 .header-section-number,
h2 .header-section-number,
h3 .header-section-number {
  display: none !important;
}

/* Hide gamification elements on landing page - only show when logged in */
#progress-badge,
#streak-indicator,
.progress-badge,
.streak-indicator {
  display: none !important;
}

/* Hide external link icons on landing page */
a[href]::after,
a.external::after,
.quarto-appendix-citeas a::after,
.quarto-appendix-bibtex a::after,
footer a::after,
.site-footer a::after,
.nav-footer a::after,
.navbar a::after,
.nav-center a::after,
.nav-right a::after,
.nav-logo::after {
  display: none !important;
  content: none !important;
  background: none !important;
  background-image: none !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Remove external class styling (except for buttons) */
a.external:not(.btn):not(.btn-action) {
  padding-right: 0 !important;
}

/* Footer logo - bigger size (matches landing-page.css) */
.site-footer .footer-logo img,
.site-footer > div > div > div:first-child img {
  height: 200px !important;
  width: auto !important;
}

/* Reset and full-width */
* {
  box-sizing: border-box;
}

html {
  font-family:
    Inter,
    SF Pro Display,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--background);
  color: var(--foreground);
  text-align: center;
}

h1,
h2,
h3 {
  font-weight: normal;
}

/* Force full-width layout - hide Quarto book elements */
#title-block-header,
.quarto-title,
.sidebar,
#quarto-sidebar,
.page-navigation,
#quarto-margin-sidebar {
  display: none !important;
}

.page-layout-custom,
main.content,
#quarto-content,
.quarto-content,
#quarto-document-content,
article {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  background: var(--background);
}

/* Content container - nbdev style */
.content-block {
  margin-left: 30px;
  margin-right: 30px;
  overflow-x: hidden;
}

@media (min-width: 900px) {
  .content-block {
    margin-left: 50px;
    margin-right: 50px;
  }
}

@media (min-width: 1200px) {
  .content-block {
    max-width: var(--content-width);
    margin-left: auto;
    margin-right: auto;
  }
}

/* Hero Banner - nbdev exact style */
.hero-banner,
.landing-hero {
  padding-top: 25px;
  padding-bottom: 30px;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-left: 30px;
  margin-right: 30px;
}

@media (min-width: 900px) {
  .hero-banner,
  .landing-hero {
    margin-left: 50px;
    margin-right: 50px;
  }
}

@media (min-width: 1200px) {
  .hero-banner,
  .landing-hero {
    max-width: var(--content-width);
    margin-left: auto;
    margin-right: auto;
  }
}

.hero-banner h1,
.landing-hero h1,
.hero-banner h2,
.landing-hero h2 {
  font-size: 56px;
  font-weight: bold;
  margin-top: 10px;
  margin-bottom: 40px;
  color: var(--foreground);
  line-height: 1.2;
  border: none !important;
  border-left: none !important;
  padding-left: 0 !important;
  background: transparent !important;
}

.hero-banner h3,
.landing-hero h3 {
  color: var(--foreground);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 20px;
  opacity: 0.8;
}

.hero-banner p,
.landing-hero p {
  color: var(--foreground);
  font-size: 20px;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
  margin-top: 0;
  margin-bottom: 40px;
  line-height: 1.6;
}

@media (min-width: 900px) {
  .hero-banner p,
  .landing-hero p {
    max-width: 60%;
  }
}

@media (min-width: 1200px) {
  .hero-banner p,
  .landing-hero p {
    max-width: 75%;
  }
}

/* Blue accent color - EXACT nbdev blue */
.accent-blue,
h1 span,
h2 span {
  color: var(--accent-blue) !important;
}

/* Buttons - nbdev exact style */
.btn-action {
  min-width: 165px;
  border-radius: 8px;
  padding: 20px 48px;
  border: none;
  font-size: 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-action-primary,
.btn-primary {
  color: #ffffff !important;
  background: var(--accent-blue);
  font-weight: 700;
  line-height: 20px;
}

.btn-action-primary:hover,
.btn-primary:hover {
  background: #35acf0;
  color: #f9fafb;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--foreground-2);
  color: var(--foreground);
}

.btn-outline:hover {
  background: var(--background-2);
  border-color: var(--accent-blue);
}

/* Mid-content sections with gradient - nbdev exact */
.mid-content,
.trusted-band {
  width: 100%;
  padding: 0;
  padding-top: 80px !important;
  padding-bottom: 80px;
  background: linear-gradient(235.87deg, #656a75 12.29%, #33373f 107.53%);
  overflow-x: hidden;
  margin: 0;
}

/* Section headings */
section h2,
.content-block h2 {
  border: none;
  font-size: 40px;
  font-weight: bold;
  margin-top: 10px;
  margin-bottom: 40px;
  color: var(--foreground);
}

/* Features / Hub Cards - nbdev exact style */
.feature,
.hub-card {
  font-size: 16px;
  min-height: 210px;
  background: var(--background-2);
  border-radius: 12px;
  padding: 30px;
  text-align: left;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  cursor: pointer;
}

.feature:hover,
.hub-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Make the entire hub-card clickable via stretched link */
.hub-card a:last-of-type::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.feature h3,
.feature h4,
.hub-card h3,
.hub-card h4 {
  color: var(--foreground);
  font-size: 18px;
  font-weight: bold;
  margin-top: 0;
  margin-bottom: 15px;
}

.feature p,
.hub-card p {
  color: var(--muted-text);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  flex-grow: 1;
}

.feature a,
.hub-card a {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 600;
  margin-top: 15px;
}

.feature a:hover,
.hub-card a:hover {
  text-decoration: underline;
}

/* Feature grid */
.feature-grid,
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 40px 30px;
}

@media (min-width: 900px) {
  .feature-grid,
  .hub-grid {
    margin: 40px 50px;
  }
}

@media (min-width: 1200px) {
  .feature-grid,
  .hub-grid {
    max-width: var(--content-width);
    margin-left: auto;
    margin-right: auto;
    margin-top: 40px;
    margin-bottom: 40px;
  }
}

/* Lesson cards */
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin: 40px 30px;
}

@media (min-width: 900px) {
  .lesson-grid {
    margin: 40px 50px;
    gap: 30px;
  }
}

@media (min-width: 1200px) {
  .lesson-grid {
    max-width: var(--content-width);
    margin-left: auto;
    margin-right: auto;
  }
}

.lesson-card {
  background: var(--background-2);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  transition: all 0.3s ease;
  padding: 40px 35px;
  position: relative;
  min-height: 280px;
}

.lesson-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lesson-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.lesson-card:hover::before {
  opacity: 1;
}

/* Lesson card color variants - vibrant colored backgrounds */
.lesson-card-darkslate {
  background: #2f4f4f !important; /* Dark Slate for Learning Hubs */
}

.lesson-card-maroon {
  background: #5c0a0a !important; /* Dark Maroon for Fundamentals */
}

.lesson-card-red {
  background: #8b2332 !important; /* Red for Applications */
}

.lesson-card-orange {
  background: #b8511f !important; /* Brown Orange for Architecture Foundations */
}

.lesson-card-lightorange {
  background: #d97e3d !important; /* Light Orange for Distributed & Specialized */
}

.lesson-card-yellow {
  background: #c29605 !important; /* Golden Yellow for Sensing */
}

.lesson-card-darkgreen {
  background: #1c4532 !important; /* Dark Green for Networking Fundamentals */
}

.lesson-card-green {
  background: #3e6b4a !important; /* Medium Green for Short-Range Protocols */
}

.lesson-card-lightgreen {
  background: #5d8d5a !important; /* Light Green for Long-Range & App Protocols */
}

.lesson-card-blue {
  background: #234e73 !important; /* Navy Blue for Data Analytics */
}

.lesson-card-purple {
  background: #7a3053 !important; /* Deep Plum for Privacy & Security */
}

.lesson-card-violet {
  background: #7a2573 !important; /* Purple/Violet for Human Factors */
}

.lesson-card-gray {
  background: #6b6b6b !important; /* Silver Gray for Design & Prototyping */
}

.lesson-card-slateblue {
  background: #5b6b8c !important; /* Slate Blue for IoT Product Analysis */
}

/* Lesson card content styling */
.lesson-number {
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
  font-weight: 700;
  padding: 0;
  margin: 0 0 12px 0;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.lesson-title {
  color: var(--foreground);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 15px 0;
  padding: 0;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

.lesson-description {
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  padding: 0;
  margin: 0 0 25px 0;
  flex-grow: 1;
  line-height: 1.65;
  position: relative;
  z-index: 1;
}

.lesson-link {
  color: var(--foreground) !important;
  padding: 0;
  margin-top: auto;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease;
  position: relative;
  z-index: 1;
}

.lesson-link:hover {
  transform: translateX(5px);
  text-decoration: none;
}

/* Testimonials - nbdev exact style */
.testimonial,
.testimonial-card {
  background: rgba(51, 55, 63, 0.4);
  border-radius: 12px;
  padding: 30px;
  text-align: left;
  border: none;
  transition: all 0.3s ease;
}

.testimonial:hover,
.testimonial-card:hover {
  background: rgba(51, 55, 63, 0.6);
}

.testimonial p,
.testimonial-card p {
  margin: 0;
  padding: 0;
  color: var(--foreground);
  font-size: 16px;
  line-height: 1.6;
  font-style: italic;
}

.testimonial em,
.testimonial-card em {
  color: var(--muted-text);
  font-size: 14px;
  font-style: normal;
  display: block;
  margin-top: 15px;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 40px 30px;
}

@media (min-width: 900px) {
  .testimonial-grid {
    margin: 40px 50px;
  }
}

@media (min-width: 1200px) {
  .testimonial-grid {
    max-width: var(--content-width);
    margin-left: auto;
    margin-right: auto;
  }
}

/* CTA Section */
.cta-section {
  padding: 60px 30px;
  text-align: center;
}

.cta-section h2 {
  font-size: 40px;
  margin-bottom: 20px;
}

.cta-section p {
  font-size: 20px;
  max-width: 600px;
  margin: 0 auto 40px;
  color: var(--foreground);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
}

.hero-visual {
  margin-top: 30px;
  margin-bottom: 30px;
  border-radius: 8px;
  box-shadow: none;
  border: none;
}

/* Global link styles - no hover color change by default */
a {
  color: var(--accent-blue);
  text-decoration: none;
}

a:hover {
  /* No color change - keeps same color */
  text-decoration: none;
}

/* Footer spacing */
.content > *:last-child {
  margin-bottom: 60px;
}

/* Navbar styling - centered layout */
.navbar {
  background: var(--background);
  font-size: 16px;
  padding: 12px 30px;
  border-bottom: 1px solid var(--foreground-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-logo {
  display: block;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 0;
}

.nav-logo img {
  display: block;
  height: 48px;
  width: auto;
  border-radius: 4px !important;
  box-shadow: none !important;
}

/* Center navigation links */
.nav-center {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.nav-center a {
  color: var(--muted-text);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 14px;
  white-space: nowrap;
}

.nav-center a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

/* Right side - GitHub + Auth */
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-github {
  color: var(--muted-text);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.nav-github:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.nav-login-btn {
  background: var(--accent-blue);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-login-btn:hover {
  background: #35acf0;
}

/* User profile in navbar (when logged in) */
.nav-user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-user-profile:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nav-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-user-name {
  color: white;
  font-size: 14px;
  font-weight: 500;
}

/* Legacy nav-links support */
.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted-text);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 14px;
  white-space: nowrap;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

/* Fix image hover - remove weird transform effects */
img {
  max-width: 100%;
  height: auto;
  transition: none !important;
}

figure img:hover,
img:hover {
  transform: none !important;
  opacity: 1 !important;
}

.hero-visual {
  margin-top: 25px;
  margin-bottom: 25px;
  border-radius: 8px;
  box-shadow: none;
  border: none;
  transition: none !important;
}

.hero-visual.hero-image {
  margin-top: 25px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: none;
  border: none;
  max-width: 900px;
}

.lesson-image {
  transition: none !important;
}

.lesson-image:hover {
  transform: none !important;
}

/* Mastery Path Grid - 4 column cards with descriptions */
.mastery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Fix for Pandoc wrapping inline elements in <p> */
.mastery-grid p {
  display: contents;
}

.mastery-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 1.25rem;
  background: var(--card-bg, #41454e);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
  text-align: left;
  min-height: 140px;
}

.mastery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  filter: brightness(1.1);
}

.mastery-title {
  color: white;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}

.mastery-desc {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .mastery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .mastery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .mastery-card {
    padding: 1rem;
    min-height: 120px;
  }
  .mastery-title {
    font-size: 14px;
  }
  .mastery-desc {
    font-size: 12px;
  }
}

/* Footer link hover styles */
.site-footer a:hover {
  color: white;
  text-decoration: none;
}

/* Remove hover effects from gallery cards and other content */
.gallery-card:hover,
.feature:hover,
.hub-card:hover {
  /* Keep transform but no color changes */
  transform: translateY(-4px);
}

.gallery-card a:hover,
.feature a:hover,
.hub-card a:hover,
.gallery-link:hover {
  color: inherit;
  text-decoration: none;
}
