body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

#container {
    width: 100%;
    max-width: 600px;
    text-align: center;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

h1 {
    margin-top: 0;
    color: #1a1a1a;
}

p {
    color: #666;
    margin-bottom: 25px;
}

#controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

#prompt-input, #texture-prompt-input {
    flex: 1 1 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#prompt-input:focus, #texture-prompt-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

#generate-btn {
    flex-grow: 1;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#generate-btn:hover {
    background-color: #0056b3;
}

#download-btn {
    flex-grow: 1;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background-color: #28a745;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
}

#download-btn:hover {
    background-color: #218838;
}

#generate-btn:disabled, #download-btn:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

#viewer-container {
    position: relative;
    width: 100%;
    height: 400px;
    background-color: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

#viewer {
    display: block;
    width: 100%;
    height: 100%;
}

#loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s;
}

#loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #007bff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

#status-text {
    font-weight: bold;
    color: #333;
}

#info-text {
    font-size: 14px;
    color: #888;
    margin: 0;
}