body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 800px;
    background: #fff;
    padding: 20px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 5px;
}

h2 {
    color: #34495e;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
    margin-top: 30px;
}

p {
    text-align: center;
    color: #7f8c8d;
    margin-top: 0;
    margin-bottom: 30px;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

textarea#prompt-input {
    width: 100%;
    height: 80px;
    padding: 12px;
    border: 1px solid #dfe4ea;
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
    box-sizing: border-box;
}

textarea#prompt-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

button#generate-btn {
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button#generate-btn:hover {
    background-color: #2980b9;
}

button#generate-btn:disabled {
    background-color: #a9cce3;
    cursor: not-allowed;
}

.settings-section {
    margin-top: 20px;
    background: #fafafa;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 8px;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.settings-header h3 {
    margin: 0;
    color: #34495e;
}

#toggle-settings-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
}

#advanced-settings {
    margin-top: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

#advanced-settings.hidden {
    display: none;
}

.slider-group {
    display: flex;
    flex-direction: column;
}

.slider-group label {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #555;
}

.slider-group input[type="range"] {
    width: 100%;
}

.result-section {
    margin-top: 30px;
}

.image-preview-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 256px;
    background-color: #ecf0f1;
    border-radius: 8px;
    margin-top: 15px;
    position: relative;
    overflow: hidden;
}

.image-preview-placeholder p {
    color: #95a5a6;
    font-size: 1rem;
}

#image-preview img {
    max-width: 100%;
    max-height: 512px;
    border-radius: 8px;
    display: block;
}

#loading-spinner {
    border: 5px solid rgba(52, 152, 219, 0.2);
    border-top-color: #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

#loading-spinner.hidden {
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.history-section {
    margin-top: 30px;
}

#history-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.history-item {
    border-radius: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    background-color: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.history-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.history-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.history-item .prompt-text {
    font-size: 0.8rem;
    padding: 8px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #4b5563;
}

.hidden {
    display: none;
}

/* --- Custom Range Slider Styles --- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: #e5e7eb; /* bg-gray-200 */
  border-radius: 9999px;
  outline: none;
  opacity: 0.7;
  transition: opacity .2s;
}

input[type="range"]:hover {
  opacity: 1;
}

/* Thumb */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.25rem; /* 20px */
  height: 1.25rem; /* 20px */
  background: #3b82f6; /* bg-blue-600 */
  border-radius: 9999px;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

input[type="range"]::-moz-range-thumb {
  width: 1.25rem; /* 20px */
  height: 1.25rem; /* 20px */
  background: #3b82f6; /* bg-blue-600 */
  border-radius: 9999px;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
} 