@font-face {
  font-family: 'Metropolis';
  src: url('Metropolis-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

:root {
  --primary-color: #6c5ce7;
  --bg-color: #f5f6fa;
  --text-color: #2d3436;
  --card-bg: white;
  --border-color: #ddd;
  --hover-color: rgba(108, 92, 231, 0.1);
}

[data-theme="dark"] {
  --primary-color: #a29bfe;
  --bg-color: #1a1a1a;
  --text-color: #f5f6fa;
  --card-bg: #2d2d2d;
  --border-color: #404040;
  --hover-color: rgba(162, 155, 254, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Metropolis', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

textarea, 
select,
.custom-input,
#output,
option {
  font-family: 'Metropolis', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
}

#themeToggle {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 50%;
  background-color: var(--card-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#themeToggle:hover {
  background-color: var(--hover-color);
}

.sun-icon, .moon-icon {
  fill: var(--text-color);
}

[data-theme="dark"] .sun-icon {
  display: none;
}

[data-theme="light"] .moon-icon {
  display: none;
}

.container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

h1 {
  display: none;
}

.text-area {
  margin-bottom: 2rem;
}

textarea {
  width: 100%;
  height: 200px;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  resize: vertical;
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.3s;
  background-color: var(--card-bg);
  color: var(--text-color);
}

textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.2s, opacity 0.2s;
}

button:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

button:active {
  transform: translateY(0);
}

.style-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.select-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.select-group select {
  width: 100%;
  padding: 0.5rem;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  background-color: var(--card-bg);
  color: var(--text-color);
  cursor: pointer;
  flex: 1;
}

.select-group select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.select-group select:hover {
  border-color: var(--primary-color);
}

.custom-input {
  padding: 0.5rem;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  background-color: var(--card-bg);
  color: var(--text-color);
  transition: border-color 0.3s;
}

.custom-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.custom-input.hidden {
  display: none;
}

.button-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

#removeGeneration {
  background-color: #e74c3c;
}

#removeGeneration:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.context-buttons, 
.prompt-buttons {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.context-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

#generateRandomContext,
#generateRandomPrompt {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: transform 0.2s, opacity 0.2s;
  margin-left: 0.5rem;
}

#generateBoth {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: transform 0.2s, opacity 0.2s;
}

#generateRandomContext:hover,
#generateRandomPrompt:hover,
#generateBoth:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.output-container {
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  min-height: 200px;
  transition: background-color 0.3s;
}

#output {
  white-space: pre-wrap;
}

#output .input-text {
  color: #e74c3c;
  font-weight: 500;
}

#output .generated-text {
  color: var(--text-color);
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.hidden {
  display: none;
}

.temperature-control {
  display: none;
}

.logo-container {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  max-width: 300px;
  height: auto;
}

.inspiration {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.7;
  font-style: italic;
}

.context-area {
  margin-bottom: 1rem;
}

#context {
  width: 100%;
  height: 100px;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  resize: vertical;
  font-size: 1rem;
  transition: border-color 0.3s;
  background-color: var(--card-bg);
  color: var(--text-color);
  margin-bottom: 1rem;
}

#context:focus {
  outline: none;
  border-color: var(--primary-color);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#regenerate {
  margin-top: 1rem;
}

.creator {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.7;
}

.creator-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}

.creator-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}