:root {
  --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-size-body: 1rem;
  --line-height-body: 1.6;
  --text-color: #e0e0e0;
  --bg-color: #121212;
  --accent-color: #bb86fc;
  --button-bg: #03dac6;
  --button-hover: #018786;
  --alert-bg: #2c2c2c;
  --alert-border: #ff9800;
  --alert-text: #ffcc00;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 1.5rem;
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
}

.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

h1, h2, h3 {
  color: #ffffff;
  margin-top: 2rem;
}

a {
  color: #90caf9;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.notice {
  background-color: var(--alert-bg);
  color: var(--alert-text);
  border-left: 6px solid var(--alert-border);
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 4px;
}

.notice button {
  background-color: var(--button-bg);
  color: #000;
  border: none;
  padding: 0.3rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 4px;
  cursor: pointer;
}

.notice button:hover {
  background-color: var(--button-hover);
}


form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0;
}

label {
  font-weight: bold;
  color: var(--accent-color);
}

fieldset.sfb-section label {
  color: #d4af37;
}

input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #333;
  border-radius: 4px;
  background-color: #1f1f1f;
  color: var(--text-color);
  box-sizing: border-box;
}

button {
  background-color: var(--button-bg);
  color: #000;
  border: none;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  align-self: flex-start;
}

button:hover {
  background-color: var(--button-hover);
}

ul, ol {
  padding-left: 1.25rem;
  margin-top: 0.5rem;
}

ul li, ol li {
  background: #1e1e1e;
  margin-bottom: 0.5rem;
  padding: 0.75rem;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.responsive-img {
  width: 100%;
  max-width: 600px;
  height: auto;
  border: 1px solid #444;
  border-radius: 4px;
  margin: 1.5rem auto;
  display: block;
}

.step-content.collapsed {
  display: none;
}

.step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background-color: #1a1a1a;
  padding: 1rem;
  border-radius: 4px;
  margin-top: 2rem;
}

.step-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.step-header button {
  background-color: #444;
  color: white;
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 4px;
  cursor: pointer;
}

.step-header button:hover {
  background-color: #666;
}

.language-switcher {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
}

.language-switcher select {
  padding: 0.4rem 0.6rem;
  background-color: #1f1f1f;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 0.9rem;
}

.language-switcher select:focus {
  outline: none;
  border-color: #03dac6;
}

.visually-hidden {
  position: absolute;
  left: -9999px;
}

.copy-btn {
  background-color: var(--button-bg);
  color: #000;
  border: none;
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.copy-btn:hover {
  background-color: var(--button-hover);
}

.download-link {
  color: #90caf9;
  text-decoration: underline;
  font-weight: normal;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  display: inline;
}

.download-link:hover {
  color: #add8ff;
  text-decoration: none;
}

section.blocked .step-header button {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.modal {

  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #1f1f1f;
  margin: 10% auto;
  padding: 2rem;
  border: 1px solid #444;
  border-radius: 8px;
  width: 80%;
  max-width: 500px;
  color: var(--text-color);
  position: relative;
}

.modal .close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: #fff;
}

.hidden {
  display: none;
}

.language-switcher {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* FAQ collapsible styling */
.faq-content h2, .faq-content h3 {
  margin-top: 1.5rem;
}

/* FAQ collapsible styles with slide animation */
.faq-content h3.faq-question {
  cursor: pointer;
  color: #90caf9;
  margin: 1rem 0 0.3rem;
  position: relative;
  padding-left: 1.2rem;
  transition: color 0.3s ease;
}

.faq-content h3.faq-question::before {
  content: "▶";
  position: absolute;
  left: 0;
  top: 0.1rem;
  font-size: 0.9em;
  transition: transform 0.3s ease;
}

.faq-content h3.faq-question.open::before {
  content: "▼";
}

.faq-content h3.faq-question:hover {
  color: #ffffff;
  font-weight: bold;
  text-decoration: underline;
}

.faq-answer {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
}

.faq-answer.visible {
  max-height: 1000px; /* plenty of room */
  opacity: 1;
}

.faq-answer p {
  margin: 0.5rem 0;
}

/* Firmware section headings inside details */
.step-content details > summary {
  font-size: 1.1rem;
  font-weight: bold;
  padding: 0.75rem 1rem;
  background-color: #1f1f1f;
  border: 1px solid #555;
  border-radius: 5px;
  cursor: pointer;
  margin: 1.5rem 0 0.5rem;
  list-style: none;
}

.step-content details[open] > summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* Content inside <details> */
.step-content details > *:not(summary) {
  padding: 1rem;
  border: 1px solid #555;
  border-top: none;
  border-radius: 0 0 5px 5px;
  margin-bottom: 1.5rem;
}

/* Upload instructions should be flat, no border or extra margin */
.step-content .upload-instructions {
  border: none;
  padding: 0;
  margin: 0;
}

/* Separate SFB and Touchscreen sections more clearly */
.step-content .firmware-section + .firmware-section {
  margin-top: 2rem;
  border-top: 1px dashed #555;
  padding-top: 2rem;
}

.modal.hidden { display: none; }
/* Let the panel grow but not exceed the viewport */
.modal-content {
  width: min(90vw, 900px);   /* wider than 500px so videos fit; tweak if you like */
  max-height: 85vh;          /* fits within viewport */
  overflow: auto;            /* scroll inside panel instead of spilling out */
}

/* If you’re using native <video>, make sure it fits */
.help-videos video {
  width: 100%;
  height: auto;
  display: block;
}

/* If you’re embedding YouTube with a wrapper, keep it responsive */
.video-embed { 
  position: relative; 
  width: 100%; 
  aspect-ratio: 16/9; 
  background: #000; 
  border-radius: 8px; 
  overflow: hidden; 
}
.video-embed iframe { 
  position: absolute; 
  inset: 0; 
  width: 100%; 
  height: 100%; 
  border: 0; 
}