body {
  font-family: 'Roboto', Arial, sans-serif;
  background-color: #0D1117; /* Dark background */
  color: #C9D1D9; /* Light primary text */
  margin: 0;
  padding: 20px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Add circuit board background overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(to right, rgba(48, 201, 226, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(48, 201, 226, 0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  z-index: -2;
  pointer-events: none;
}

/* Add circuit wires */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(48, 201, 226, 0.03) 0%, transparent 80%),
    radial-gradient(circle at 10% 30%, rgba(248, 81, 73, 0.03) 0%, transparent 60%),
    linear-gradient(45deg, transparent 48%, rgba(48, 201, 226, 0.1) 49%, rgba(48, 201, 226, 0.1) 51%, transparent 52%),
    linear-gradient(135deg, transparent 48%, rgba(248, 81, 73, 0.1) 49%, rgba(248, 81, 73, 0.1) 51%, transparent 52%);
  background-size: 100% 100%, 100% 100%, 120px 120px, 120px 120px;
  z-index: -1;
  pointer-events: none;
}

/* Add floating circuit components */
.circuit-component {
  position: fixed;
  width: 30px;
  height: 30px;
  background-color: transparent;
  border: 1px solid rgba(48, 201, 226, 0.15);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(48, 201, 226, 0.2);
}

.circuit-line {
  position: fixed;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(48, 201, 226, 0.3), transparent);
  z-index: -1;
  pointer-events: none;
  animation: pulse 3s infinite alternate;
}

@keyframes pulse {
  0% { opacity: 0.3; }
  100% { opacity: 0.7; }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.container {
  background-color: rgba(22, 27, 34, 0.95); /* Slightly transparent background */
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 
              0 0 15px rgba(48, 201, 226, 0.15); /* Added teal glow */
  width: 100%;
  max-width: 800px;
  margin-top: 20px;
  border: 1px solid #21262D; /* Subtle border */
  position: relative;
  overflow: hidden;
}

/* Container tech edge effect */
.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(48, 201, 226, 0.7), 
    rgba(248, 81, 73, 0.7), 
    transparent
  );
  z-index: 1;
  animation: scan 4s infinite linear;
}

@keyframes scan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

h1 {
  color: #C9D1D9; /* Light text, though image is primary content */
  text-align: center;
  margin-bottom: 10px;
  font-weight: 500;
  display: flex; 
  justify-content: center; 
  align-items: center; 
  height: 250px; 
  position: relative;
}

h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(48, 201, 226, 0.5),
    rgba(48, 201, 226, 0.5),
    transparent
  );
}

h1 img {
  max-height: 100%; 
  max-width: 100%; 
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(48, 201, 226, 0.3));
}

/* Futuristic button styles */
.action-button {
  margin-top: 15px;
  padding: 12px 25px;
  font-size: 1.1em;
  font-weight: 500;
  cursor: pointer;
  background-color: rgba(48, 201, 226, 0.9); /* Teal accent */
  color: #0D1117; /* Dark text on bright button */
  border: none;
  border-radius: 8px;
  transition: all 0.3s, transform 0.1s;
  display: block;
  width: 100%;
  box-shadow: 0 4px 10px rgba(48, 201, 226, 0.2), 0 0 15px rgba(48, 201, 226, 0.1);
  position: relative;
  overflow: hidden;
}

.action-button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
  transform: rotate(30deg);
  transition: transform 0.5s;
  opacity: 0;
}

.action-button:hover {
  background-color: #25A8BD; /* Darker Teal */
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(48, 201, 226, 0.3), 0 0 20px rgba(48, 201, 226, 0.2);
}

.action-button:hover::after {
  transform: rotate(30deg) translate(10%, 10%);
  opacity: 0.1;
}

.action-button:active {
  transform: translateY(0px);
  box-shadow: 0 2px 5px rgba(48, 201, 226, 0.2);
}

.action-button:disabled {
  background-color: #30363D; /* Muted dark gray */
  color: #8B949E; /* Muted light text */
  cursor: not-allowed;
  box-shadow: none;
  transform: translateY(0);
}

.action-button.secondary {
  background-color: #21262D; /* Darker gray button */
  color: #C9D1D9;
  border: 1px solid #30363D;
}
.action-button.secondary:hover {
  background-color: #30363D;
  border-color: #30C9E2;
}
.action-button.tertiary {
  background-color: transparent;
  color: #F85149; /* Red accent */
  border: 1px solid #F85149;
}
.action-button.tertiary:hover {
  background-color: rgba(248, 81, 73, 0.1);
  color: #FF6B6B;
}

/* Enhanced settings panel with tech theme */
#settings {
  margin: 25px 0;
  padding: 25px;
  border: 1px solid #30363D; /* Darker border */
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(22, 27, 34, 0.97), rgba(13, 17, 23, 0.97)); /* Gradient background */
  box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* Softer shadow for dark */
  position: relative;
  overflow: hidden;
}

#settings::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background-image: radial-gradient(circle, rgba(48, 201, 226, 0.05) 10%, transparent 70%);
  pointer-events: none;
}

/* Tech-themed slider tracks */
.slider-container input[type="range"] {
  flex-grow: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: linear-gradient(90deg, #1a1f26, #30363D, #1a1f26); /* Gradient track */
  border-radius: 5px;
  outline: none;
  cursor: pointer;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.5);
}

p.intro {
  text-align: center;
  color: #8B949E; /* Muted light text */
  margin-bottom: 25px;
  font-size: 1.1em;
}

#inputText, #contextArea, #continueInputEl {
  width: 100%;
  padding: 12px;
  font-size: 1em;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid #30363D; /* Darker border */
  background-color: #0D1117; /* Dark input background */
  color: #C9D1D9; /* Light text in input */
  transition: border-color 0.3s, box-shadow 0.3s;
  margin-bottom: 10px;
}
#inputText:focus, #contextArea:focus, #seedInput:focus, #continueInputEl:focus {
  border-color: #30C9E2; /* Teal accent */
  box-shadow: 0 0 0 3px rgba(48, 201, 226, 0.3); /* Teal glow */
  outline: none;
}
#inputText {
  height: 150px;
}
#contextArea {
  height: 100px;
  font-size: 0.95em;
}
#continueInputEl {
  height: 100px;
  margin-top: 15px;
}

#output {
  margin-top: 20px;
  background-color: rgba(1, 4, 9, 0.7); /* Very dark, slightly transparent */
  border-radius: 8px;
  padding: 10px; /* Padding for the container */
  border: 1px solid #1A2027;
}

.message-turn {
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 6px;
  line-height: 1.7;
  position: relative;
  overflow-wrap: break-word;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.message-turn:last-child {
  margin-bottom: 0;
}

.message-label {
  display: block;
  font-size: 0.85em;
  font-weight: 700;
  margin-bottom: 5px;
  opacity: 0.8;
}

.user-message {
  background-color: rgba(248, 81, 73, 0.1); /* Reddish tint for user */
  border-left: 4px solid #F85149;
  color: #FDCBC8;
}
.user-message .message-label {
  color: #F85149;
}

.assistant-message {
  background-color: rgba(48, 201, 226, 0.08); /* Bluish tint for AI */
  border-left: 4px solid #30C9E2;
  color: #A3ACB5;
}
.assistant-message .message-label {
  color: #30C9E2;
}

/* Style the number input container */
.input-container {
  display: flex;
  align-items: center;
  gap: 10px;
}
.input-container input[type="number"] {
  flex-grow: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #30363D; /* Darker border */
  background-color: #0D1117; /* Dark input background */
  color: #C9D1D9; /* Light text */
  font-size: 0.95em;
  transition: border-color 0.3s, box-shadow 0.3s;
  -moz-appearance: textfield; /* Firefox */
}
/* Hide arrows for number input in Chrome, Safari, Edge, Opera */
.input-container input[type="number"]::-webkit-outer-spin-button,
.input-container input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Style for the random seed button */
#randomSeedBtn {
  padding: 8px 10px;
  font-size: 1.1em;
  cursor: pointer;
  background-color: #21262D; /* Darker gray button */
  color: #C9D1D9; /* Light text */
  border: 1px solid #30363D; /* Mid gray */
  border-radius: 6px;
  transition: background-color 0.2s, border-color 0.2s;
}
#randomSeedBtn:hover {
  background-color: #30363D;
  border-color: #404852;
}

#advancedSettings {
  margin-top: 20px;
  border-top: 1px dashed #30363D; /* Darker dashed line */
  padding-top: 20px;
}
.toggle-advanced {
  background: none;
  border: 1px solid #30C9E2; /* Teal accent */
  color: #30C9E2; /* Teal accent */
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95em;
  padding: 8px 15px;
  margin-bottom: 15px;
  border-radius: 6px;
  transition: background-color 0.3s, color 0.3s;
  display: inline-block;
}
.toggle-advanced:hover {
  background-color: rgba(48, 201, 226, 0.15); /* Teal accent, semi-transparent */
  color: #57D4EA; /* Brighter Teal */
}

.select-container {
  display: flex;
  align-items: center;
  gap: 10px;
}
.select-container select {
  flex-grow: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #30363D; /* Darker border */
  background-color: #0D1117; /* Dark select background */
  color: #C9D1D9; /* Light text */
  font-size: 0.95em;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.select-container select:focus {
  border-color: #30C9E2; /* Teal accent */
  box-shadow: 0 0 0 3px rgba(48, 201, 226, 0.3); /* Teal glow */
  outline: none;
}
/* Style select dropdown arrow for dark theme (browser dependent) */
.select-container select {
  /* Basic styling for arrow visibility */
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23C9D1D9" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  appearance: none; /* Remove default arrow */
  -webkit-appearance: none;
  -moz-appearance: none;
}

.info-button {
  padding: 8px 10px;
  font-size: 1.1em;
  cursor: pointer;
  background-color: #21262D;
  color: #30C9E2;
  border: 1px solid #30363D;
  border-radius: 6px;
  transition: all 0.2s;
  min-width: 38px;
}
.info-button:hover {
  background-color: #30363D;
  border-color: #30C9E2;
  box-shadow: 0 0 8px rgba(48, 201, 226, 0.3);
}

#status {
  margin-top: 15px;
  font-style: italic;
  color: #8B949E; /* Muted light text */
  text-align: center;
  min-height: 1.5em; /* Reserve space to prevent layout shift */
}

/* WEBSIM link in bottom right corner */
.websim-link {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
}

.follow-text {
  color: #30C9E2; /* Teal accent to match theme */
  font-size: 0.9em;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-shadow: 0 0 5px rgba(48, 201, 226, 0.5);
  opacity: 0.8;
  transition: all 0.3s;
  background: rgba(13, 17, 23, 0.7);
  padding: 5px 10px;
  border-radius: 5px;
  border-left: 2px solid #30C9E2;
}

.websim-link:hover .follow-text {
  opacity: 1;
  text-shadow: 0 0 8px rgba(48, 201, 226, 0.8);
}

.websim-link img {
  width: 120px;
  height: auto;
  transition: all 0.3s;
  filter: drop-shadow(0 0 5px rgba(48, 201, 226, 0.5));
  border-radius: 8px;
}

.websim-link img:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 8px rgba(48, 201, 226, 0.8));
}

/* Add styles for preset buttons */
.preset-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 5px;
}

.preset-btn {
  background-color: #21262D;
  color: #C9D1D9;
  border: 1px solid #30363D;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.preset-btn:hover {
  background-color: #30363D;
  border-color: #30C9E2;
  transform: translateY(-1px);
}

.preset-btn.active {
  background-color: rgba(48, 201, 226, 0.25);
  color: #57D4EA;
  border-color: #30C9E2;
  box-shadow: 0 0 8px rgba(48, 201, 226, 0.3);
}

/* Tech pulse effect */
.tech-pulse {
  animation: tech-pulse 0.7s ease;
}

@keyframes tech-pulse {
  0% { box-shadow: 0 0 0 0 rgba(48, 201, 226, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(48, 201, 226, 0); }
  100% { box-shadow: 0 0 0 0 rgba(48, 201, 226, 0); }
}

/* Combined preset modes section */
.preset-modes-container {
  margin-top: 25px;
  border-top: 1px dashed #30363D;
  padding-top: 15px;
}

.preset-modes-container h3 {
  font-size: 1.1em;
  font-weight: 500;
  color: #C9D1D9;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}

.preset-modes-container h3::before, 
.preset-modes-container h3::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(48, 201, 226, 0.3), transparent);
  margin: 0 15px;
}

.preset-modes {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.preset-mode-btn {
  flex: 1;
  background: linear-gradient(160deg, #1D2127, #0D1118);
  color: #C9D1D9;
  border: 1px solid #30363D;
  border-radius: 6px;
  padding: 10px;
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  min-width: 100px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.preset-mode-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, 
    transparent 49.5%, 
    rgba(48, 201, 226, 0.3) 49.5%, 
    rgba(48, 201, 226, 0.3) 50.5%,
    transparent 50.5%);
  background-size: 10px 10px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 0;
  border-radius: 5px;
}

.preset-mode-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.preset-mode-btn:hover::before {
  opacity: 0.3;
}

.preset-mode-btn.active {
  background: linear-gradient(160deg, rgba(48, 201, 226, 0.15), rgba(48, 201, 226, 0.05));
  border-color: #30C9E2;
  color: #57D4EA;
  box-shadow: 0 0 15px rgba(48, 201, 226, 0.2);
}

.preset-mode-btn.active::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 20%;
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(48, 201, 226, 0.7),
    rgba(48, 201, 226, 0.7),
    transparent
  );
}

#continuationControls {
  margin-top: 10px;
}
.continuation-buttons {
  display: flex;
  gap: 10px;
  margin-top: 0px; /* Reduced from 10px to 0px since textarea has margin-bottom */
}
.continuation-buttons .action-button {
  flex: 1; /* Make buttons share space */
}
#resetConversationBtn {
  margin-top: 20px;
}

#retryGenerationBtn {
  margin-top: 10px;
  background-color: #F85149; /* Red accent for retry */
  color: white;
  border: 1px solid #F85149;
}

#retryGenerationBtn:hover {
  background-color: #FF6B6B;
  border-color: #FF6B6B;
  transform: translateY(-1px);
}

#retryGenerationBtn:disabled {
  background-color: #30363D;
  color: #8B949E;
  border-color: #30363D;
}