/* Basic reset */
* { box-sizing: border-box; }

:root {
  --text: #0b1220;
  --muted: #4b5563;       /* slate-600 */
  --primary: #22c55e;     /* green-500 */
  --primary-dark: #16a34a;/* green-600 */
  --border: #e5e7eb;      /* gray-200 */
}

html .wy-nav-content {
  max-width: 1000px;
}

/* Poster image at top */
.rst-content .poster {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 16px 0;
  border: none;
  box-shadow: none;
}

/* Hero section: remove dark box; keep spacing */
.hero {
  background: transparent;
  color: var(--text);
  padding: 8px 0 16px 0;
  border-radius: 0;
  margin: 0 0 8px 0;
}
.hero .container { max-width: 1000px; margin: 0 auto; }
.hero h1 {
  font-size: 28px;
  line-height: 1.35;
  margin: 0 0 8px 0;
}
.hero .subtitle {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 12px 0;
}

/* CTA buttons on light background */
.cta-group { display: flex; gap: 12px; flex-wrap: wrap; }
.cta {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--primary);
  color: #051b0f;
  font-weight: 600;
  text-decoration: none;
}
.cta:hover { background: var(--primary-dark); color: #04140c; }
.cta.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.cta.secondary:hover { background: #f9fafb; }

/* Feature cards on white */
.features { margin-top: 8px; }
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
.card {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.card h3 { margin-top: 0; }
.card p { color: var(--muted); }

/* Improve base typography */
.rst-content p { color: var(--text); }
.rst-content h1, .rst-content h2, .rst-content h3 { color: var(--text); }

/* Larger paragraph font size override */
.wy-nav-content .rst-content p,
.rst-content p {
  font-size: 1.5em !important;
  line-height: 1.7 !important;
}

/* --- Font Size Control for Different Heading Levels --- */
/* H1 - Document Title */
h1 {
  font-size: 2.2em !important;
  margin-bottom: 1em !important;
}

/* H2 - Main Sections */
h2 {
  font-size: 1.8em;
  margin-top: 1.2em;
  margin-bottom: 0.8em;
}

/* H3 - Sub-sections */
h3 {
  font-size: 1.5em;
  margin-top: 1em;
  margin-bottom: 0.6em;
}

/* H4 - Details */
h4 {
  font-size: 1.2em;
  font-weight: bold;
  margin-top: 0.8em;
}

/* Base Body Text */
p, li, .wy-nav-content {
  font-size: 1em !important;
  line-height: 1.6 !important;
}

/* Responsive video container */
.video-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 */
  margin: 16px 0 24px;
  overflow: hidden;
}
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Larger primary CTA button */
.cta.big {
  padding: 12px 22px;
  font-size: 18px;
  border-radius: 10px;
}

/* Gray variant for CTA */
.cta.gray {
  background: #e5e7eb;            /* gray-200 */
  color: var(--text);
  border: 1px solid #d1d5db;      /* gray-300 */
}
.cta.gray:hover { background: #d1d5db; }

/* Smaller CTA size */
.cta.small {
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 6px;
}

/* Highlighted option lines */
.option-line {
  background: #f9fafb;                 /* light gray background */
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  font-weight: 500;
}
.option-line .label {
  font-weight: 700;
  color: var(--primary-dark);
  margin-right: 6px;
}

/* Centered red alert box */
.alert {
  display: inline-block;
  background: #ef4444;            /* red-500 */
  color: #ffffff;
  border: 1px solid #dc2626;      /* red-600 */
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.alert .icon {
  font-weight: 700;
  margin-right: 8px;
}

/* --- Upload Program Section Styles --- */
.upload-program-container {
  font-family: Arial, sans-serif;
  margin: 24px 0;
}
.upload-header {
  background-color: #E86A33;
  color: white;
  text-align: center;
  padding: 12px 20px;
  font-size: 28px;
  font-weight: bold;
  border-radius: 12px;
  position: relative;
  margin-bottom: 24px;
  margin-top: -30px; /* Pull the header up over the hidden title */
}
.upload-header h2 {
  font-size: 24px !important;
  margin: 0 !important;
  color: #ffffff !important;
}

.upload-header p {
  font-size: 24px !important;
  margin: 0 !important;
  color: #ffffff !important;
  font-weight: bold;
}

/* Hide the actual RST section titles but keep them in the TOC */
#introduction > h2, #introduction > h3, #introduction > h4,
#material-list > h2, #material-list > h3, #material-list > h4,
#resource-download > h2, #resource-download > h3, #resource-download > h4,
#remove-the-protective-film > h2, #remove-the-protective-film > h3, #remove-the-protective-film > h4,
#assemble-the-motor > h2, #assemble-the-motor > h3, #assemble-the-motor > h4,
#assemble-the-line-tracking > h2, #assemble-the-line-tracking > h3, #assemble-the-line-tracking > h4,
#assemble-the-copper-pillar > h2, #assemble-the-copper-pillar > h3, #assemble-the-copper-pillar > h4,
#assemble-the-uno-and-shield > h2, #assemble-the-uno-and-shield > h3, #assemble-the-uno-and-shield > h4,
#assemble-the-cell-box > h2, #assemble-the-cell-box > h3, #assemble-the-cell-box > h4,
#assemble-the-camera-holder > h2, #assemble-the-camera-holder > h3, #assemble-the-camera-holder > h4,
#assemble-the-ultrasonic-sensor > h2, #assemble-the-ultrasonic-sensor > h3, #assemble-the-ultrasonic-sensor > h4,
#assemble-the-camera-module > h2, #assemble-the-camera-module > h3, #assemble-the-camera-module > h4,
#assemble-the-sg90-servo > h2, #assemble-the-sg90-servo > h3, #assemble-the-sg90-servo > h4,
#ultrasonic-sensor-wiring > h2, #ultrasonic-sensor-wiring > h3, #ultrasonic-sensor-wiring > h4,
#camera-module-wiring > h2, #camera-module-wiring > h3, #camera-module-wiring > h4,
#line-tracking-module-wiring > h2, #line-tracking-module-wiring > h3, #line-tracking-module-wiring > h4,
#sg90-servo-wiring > h2, #sg90-servo-wiring > h3, #sg90-servo-wiring > h4,
#motor-wiring > h2, #motor-wiring > h3, #motor-wiring > h4,
#cell-box-wiring > h2, #cell-box-wiring > h3, #cell-box-wiring > h4,
#complete-wiring > h2, #complete-wiring > h3, #complete-wiring > h4,
#assemble-the-acrylic-plate > h2, #assemble-the-acrylic-plate > h3, #assemble-the-acrylic-plate > h4,
#assemble-the-tires > h2, #assemble-the-tires > h3, #assemble-the-tires > h4,
#assembly-completed > h2, #assembly-completed > h3, #assembly-completed > h4,
#assemble-the-battery > h2, #assemble-the-battery > h3, #assemble-the-battery > h4,
#upload-program > h2, #upload-program > h3, #upload-program > h4,
#play-3-control-methods > h2, #play-3-control-methods > h3, #play-3-control-methods > h4,
#on-board-switch-control > h2, #on-board-switch-control > h3, #on-board-switch-control > h4,
#line-tracking-mode > h2, #line-tracking-mode > h3, #line-tracking-mode > h4,
#obstacle-avoidance-mode > h2, #obstacle-avoidance-mode > h3, #obstacle-avoidance-mode > h4,
#auto-follow-mode > h2, #auto-follow-mode > h3, #auto-follow-mode > h4,
#infrared-remote-control > h2, #infrared-remote-control > h3, #infrared-remote-control > h4,
#app-control > h2, #app-control > h3, #app-control > h4 {
  display: none;
}
.upload-header .car-icon {
  position: absolute;
  right: 20px;
  bottom: -5px;
  height: 80px; 
}
.text-orange {
  color: #E86A33 !important;
  font-size: 22px;
  font-weight: bold;
  margin-top: 24px;
  margin-bottom: 8px;
}
.text-blue {
  color: #0066cc !important;
  font-size: 18px;
  font-weight: bold;
  line-height: 1.4;
  margin-bottom: 12px;
}
.text-blue a {
  color: #E86A33;
  text-decoration: none;
}
.boards-layout {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-top: 40px;
  flex-wrap: wrap;
}
.board-group {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.board-img {
  max-width: 250px;
  height: auto;
}
.status-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.check-icon {
  width: 50px;
  height: 50px;
  background-color: #28a745;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 30px;
  font-weight: bold;
  margin-bottom: 10px;
}
.check-icon::after {
  content: "✔";
}
.text-green {
  color: #28a745 !important;
  font-weight: bold;
  font-size: 18px;
  line-height: 1.2;
}
.footer-icon {
  margin-top: 40px;
  width: 50px;
}

/* Fix sidebar text color when forcefully expanded - Simple Blue & White Theme */
.wy-nav-side, .wy-menu-vertical ul {
  background-color: #ffffff !important;
}
.wy-menu-vertical a {
  color: #333333 !important;
  background-color: #ffffff !important;
}
.wy-menu-vertical a:hover {
  color: #2980b9 !important; /* RTD Default Blue */
  background-color: #f8f9fa !important;
}
.wy-menu-vertical li.current > a,
.wy-menu-vertical li.toctree-l1.current > ul > li.current > a {
  color: #2980b9 !important;
  background-color: #f0f4f8 !important;
}