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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f4f4f5;
    color: #18181b;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-width: 500px;
    width: 100%;
    text-align: center;
}

h1 {
    margin-bottom: 10px;
    color: #0f172a;
}

p {
    color: #64748b;
    margin-bottom: 24px;
    line-height: 1.5;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #475569;
    font-weight: 600;
    text-align: left;
}

textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
    resize: vertical;
    font-family: inherit;
}

textarea:focus {
    border-color: #f6821f;
}

button {
    background-color: #f6821f;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
}

button:hover {
    background-color: #e57211;
}

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

.hidden {
    display: none !important;
}

#resultContainer {
    margin-top: 24px;
    text-align: left;
}

#imageResult {
    display: block;
    width: 100%;
    border-radius: 8px;
}

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 15px;
}

button.secondary {
    color: #f6821f;
    background: #fff7ed;
    border: 1px solid #f6821f;
}

button.secondary:hover {
    background: #ffedd5;
}

.status {
    margin: 14px 0 0;
    color: #166534;
    text-align: center;
}

#resultContainer h3 {
    font-size: 14px;
    color: #475569;
    margin-bottom: 8px;
}

pre {
    background-color: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow-x: auto;
    font-size: 14px;
    color: #0f172a;
}

.error {
    margin-top: 20px;
    color: #ef4444;
    background-color: #fef2f2;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #fecaca;
    font-size: 14px;
}

/* Loading Spinner */
#loader {
    margin-top: 24px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #f6821f;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px auto;
}

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