body {
  font-family: Arial, sans-serif;
  background-color: #0d1117;
  color: #c9d1d9;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

header {
  text-align: center;
  padding: 2rem 1rem;
  background-color: #161b22;
  border-bottom: 1px solid #30363d;
  position: relative;
}

h1,
h3 {
  margin-top: 0;
}

a {
  color: #58a6ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
}

.card {
  background-color: #161b22;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #30363d;
  display: flex;
  flex-direction: column;
}

.card p {
  flex-grow: 1;
}

pre {
  background-color: #0d1117;
  border: 1px solid #30363d;
  border-radius: 5px;
  padding: 1rem;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.9rem;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

button {
  background-color: #238636;
  color: white;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

button:hover {
  background-color: #2ea043;
}

footer {
  text-align: center;
  padding: 1rem;
  background-color: #161b22;
  border-top: 1px solid #30363d;
}

.btn-demo {
  background-color: #30363d;
  color: #c9d1d9;
}

.btn-demo:hover {
  background-color: #484f58;
}

.console-output {
  background-color: #010409;
  border: 1px solid #30363d;
  border-radius: 5px;
  margin-top: 1rem;
  padding: 1rem;
  font-family: 'Courier New', Courier, monospace;
  min-height: 70px;
}

.console-output .output-text {
  white-space: pre-wrap;
  word-break: break-all;
  color: #8b949e;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  font-size: 0.9rem;
}

.output-text:empty::before {
  content: "Click '▶️ Run Demo' to see the output here...";
  color: #6e7681;
  font-style: italic;
  font-family: Arial, sans-serif;
}

.cursor {
  display: inline-block;
  background-color: #c9d1d9;
  width: 8px;
  height: 1.2em;
  animation: blink 1s step-end infinite;
  vertical-align: bottom;
}

@keyframes blink {
  from,
  to {
    background-color: transparent;
  }
  50% {
    background-color: #c9d1d9;
  }
}

#search-section {
  text-align: center;
  margin: 1.5rem 0;
}

#searchInput {
  width: 60%;
  max-width: 500px;
  padding: 12px 18px;
  font-size: 16px;
  color: #c9d1d9;
  background-color: #0d1117;
  border: 2px solid #58a6ff;
  border-radius: 8px;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(88, 166, 255, 0.15);
}

#searchInput::placeholder {
  color: #8b949e;
  font-style: italic;
}

#searchInput:focus {
  border-color: #79c0ff;
  box-shadow: 0 0 12px rgba(121, 192, 255, 0.4);
  background-color: #161b22;
}

.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: 2px solid #30363d;
  padding: 0.5rem;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  color: #c9d1d9;
  transition: all 0.3s ease;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.theme-toggle:hover {
  transform: rotate(20deg);
  background-color: #30363d;
}

.theme-toggle:active {
  transform: scale(0.95); 
}

.light-mode {
  background-color: #ffffff;
  color: #0d1117;
}

.light-mode header,
.light-mode footer,
.light-mode .card,
.light-mode pre,
.light-mode .console-output {
  background-color: #f2f2f2;
  border-color: #d0d7de;
}

.light-mode #searchInput {
  background-color: #ffffff;
  color: #0d1117;
  border-color: #58a6ff;
}

.light-mode button {
  background-color: #238636;
  color: white;
}

.light-mode a {
  color: #0969da;
}

@media (max-width: 768px) {
  main {
    padding: 1rem;
    grid-template-columns: 1fr;
  }

  .card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .card-actions a {
    text-align: center;
  }

  button,
  .card-actions a {
    width: 100%;
  }

  theme-toggle {
    width: 42px;
    height: 42px;
    top: 15px;
    right: 15px;
  }
  
  h1 {
    padding-right: 50px;
  }
}

@media (max-width: 600px) {
  #searchInput {
    width: 80%;
    font-size: 15px;
  }

  .theme-toggle {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }
}

