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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
  min-height: 100vh;
  color: #e0e0e0;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px 20px;
}

header {
  text-align: center;
  margin-bottom: 40px;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

h1 a {
  background: linear-gradient(90deg, #00d4ff, #7c3aed, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

h1 a:hover {
  opacity: 0.8;
}

.subtitle {
  color: #888;
  font-size: 1.1rem;
}

.subtitle a {
  color: #888;
  text-decoration: none;
  transition: color 0.3s;
}

.subtitle a:hover {
  color: #00d4ff;
}

.powered-by {
  color: #888;
  font-size: 0.9rem;
  margin-top: 8px;
}

.powered-by a {
  color: #888;
  text-decoration: none;
  transition: color 0.3s;
}

.powered-by a:hover {
  color: #00d4ff;
}

main {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 32px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#generate-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

textarea {
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.3s, box-shadow 0.3s;
}

textarea:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

textarea::placeholder {
  color: #666;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-row label {
  font-size: 0.95rem;
  color: #ccc;
  white-space: nowrap;
}

select {
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
}

select:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

select option {
  background: #1a1a2e;
  color: #fff;
}

button[type="submit"] {
  padding: 16px 32px;
  background: linear-gradient(90deg, #7c3aed, #00d4ff);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

button[type="submit"]:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

button[type="submit"]:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.button-group {
  display: flex;
  gap: 12px;
}

.button-group button[type="submit"] {
  flex: 1;
}

#reset-btn {
  padding: 16px 24px;
  background: linear-gradient(90deg, #7c3aed, #00d4ff);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

#reset-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

#result {
  margin-top: 32px;
  text-align: center;
}

#image-container {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

#generated-image {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.generation-time {
  color: #ccc;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.time-description {
  font-size: 0.75rem;
  color: #888;
}

.download-btn {
  display: inline-block;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.3s;
}

.download-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.error {
  margin-top: 20px;
  padding: 16px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 8px;
  color: #fca5a5;
}

footer {
  text-align: center;
  padding: 16px 20px;
  color: #888;
  font-size: 0.9rem;
}

footer a {
  color: #888;
  text-decoration: none;
  transition: color 0.3s;
}

footer a:hover {
  color: #00d4ff;
}
