:root {
  --primary: #2c3e50;
  --accent: #3498db;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #333;
  --border-radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.app-container {
  width: 100%;
  max-width: 800px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

header {
  text-align: center;
}

h1 {
  margin: 0;
  font-weight: 300;
  letter-spacing: 1px;
}

.subtitle {
  color: #666;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.mode-selector {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-btn {
  background: none;
  border: 1px solid #ddd;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.mode-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mode-btn.active {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent);
}

.input-group {
  display: flex;
  gap: 10px;
}

input[type="text"] {
  flex: 1;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 1rem;
  outline: none;
}

input[type="text"]:focus {
  border-color: var(--accent);
}

button#generate-btn {
  padding: 0 24px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

button#generate-btn:hover {
  background-color: #1a252f;
}

button#generate-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

#output-area {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hidden {
  display: none !important;
}

.text-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  line-height: 1.6;
  white-space: pre-wrap;
}

.image-card {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-height: 300px;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  transition: opacity 0.5s;
}

img.loaded {
  opacity: 1;
}

.loader {
  position: absolute;
  color: #666;
  font-size: 0.9rem;
}