* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333;
  line-height: 1.6;
}

#app {
  max-width: 100%;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#input-container {
  text-align: center;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-width: 900px;
  margin: 0 auto;
}

h1 {
  color: #e07a5f;
  margin-bottom: 1rem;
  font-size: 2.5rem;
  background: linear-gradient(45deg, #e07a5f, #f4a261);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.input-group {
  display: flex;
  margin-top: 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.input-group:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

#topic-input {
  flex: 1;
  padding: 0.8rem 1rem;
  border: none;
  font-size: 1rem;
  transition: all 0.3s ease;
}

#topic-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(224, 122, 95, 0.3);
}

button {
  background-color: #e07a5f;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

button:hover {
  background-color: #d06a4f;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(224, 122, 95, 0.4);
}

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

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

#loading-container {
  text-align: center;
  padding: 2rem;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(224, 122, 95, 0.3);
  border-top: 4px solid #e07a5f;
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 20px rgba(224, 122, 95, 0.5);
}

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

#loading-message {
  font-size: 1.1rem;
  color: #666;
  margin-top: 1rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

#presentation-container {
  background-color: black;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.progress-bar {
  height: 8px;
  background: linear-gradient(90deg, rgba(50, 50, 50, 0.3), rgba(50, 50, 50, 0.6));
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

#progress-indicator {
  height: 100%;
  background: linear-gradient(90deg, #e07a5f, #f4a261);
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(224, 122, 95, 0.5);
}

.step-counter {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 0.9rem;
  color: white;
  z-index: 10;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 5px 10px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

.content-display {
  height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
}

.image-container {
  height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

#step-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.text-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.4));
  padding: 1.5rem;
  color: white;
  backdrop-filter: blur(5px);
}

#step-text {
  font-size: 1.3rem;
  line-height: 1.6;
  margin: 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  font-weight: 500;
  text-align: center;
  max-width: 80%;
  margin: 0 auto;
}

.controls {
  position: absolute;
  bottom: 80px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 1rem;
  z-index: 10;
}

.controls button {
  background-color: rgba(224, 122, 95, 0.8);
  border-radius: 5px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
  min-width: 80px;
}

.controls button:hover {
  background-color: rgba(224, 122, 95, 1);
  transform: translateY(-2px);
}

.hidden {
  display: none;
}

.options-group {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.options-group label {
  font-weight: 600;
  color: #555;
  min-width: 120px;
}

#tone-select, #art-style-input {
  padding: 0.5rem;
  border-radius: 5px;
  border: 2px solid #e1e5e9;
  background-color: white;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

#art-style-input {
  min-width: 300px;
}

#step-length-input {
  padding: 0.5rem;
  border-radius: 5px;
  border: 2px solid #e1e5e9;
  background-color: white;
  min-width: 150px;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

#tone-select:focus, #art-style-input:focus, #step-length-input:focus {
  border-color: #e07a5f;
  box-shadow: 0 0 0 3px rgba(224, 122, 95, 0.1);
  outline: none;
}

#history-container {
  margin-top: 2rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 1.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

#history-list {
  list-style: none;
  margin-top: 1rem;
}

#history-list li {
  padding: 0.8rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px;
  margin-bottom: 8px;
  background: rgba(249, 244, 239, 0.5);
}

#history-list li .history-text {
  flex-grow: 1;
  margin-right: 10px;
}

#history-list li .delete-btn {
  background: none;
  border: none;
  color: #e07a5f;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  transition: color 0.2s;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#history-list li .delete-btn:hover {
  color: #d06a4f;
  background-color: rgba(224, 122, 95, 0.1);
  transform: scale(1.1);
}

#history-list li:hover {
  background: rgba(224, 122, 95, 0.1);
  transform: translateX(5px);
}

input[type="number"] {
  width: 60px;
  padding: 0.5rem;
  border-radius: 5px;
  border: 1px solid #ddd;
}

.return-menu-container {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 10;
}

#return-to-menu-btn {
  background-color: rgba(129, 178, 154, 0.8);
  padding: 0.7rem 1.8rem;
  font-size: 0.95rem;
  border-radius: 5px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#return-to-menu-btn:hover {
  background-color: rgba(106, 154, 128, 0.9);
}

#toggle-tts-btn {
  background-color: rgba(100, 149, 237, 0.8);
  margin-left: 10px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#toggle-tts-btn:hover {
  background-color: rgba(70, 119, 207, 0.9);
}

/* New: Inspiration gallery styles */
#inspiration-gallery {
  margin: 2rem auto;
  max-width: 1100px;
  padding: 1rem;
  background: white;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

#inspiration-gallery h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #333;
  font-weight: 700;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.gallery-item {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  padding-bottom: 0.5rem;
  text-align: center;
}

.gallery-image {
  width: 100%;
  height: 60vh; /* Large view */
  object-fit: cover;
  display: block;
  border-bottom: 1px solid #eee;
}

.gallery-item figcaption {
  padding: 0.75rem 1rem;
  color: #444;
  font-size: 0.95rem;
  line-height: 1.3;
}

/* Responsive: two-column on wider screens */
@media (min-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .options-group {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .controls {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .controls button {
    min-width: 70px;
    padding: 0.6rem 1rem;
  }
  
  #step-text {
    font-size: 1.1rem;
    max-width: 95%;
  }
}