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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #111;
    color: #fff;
    line-height: 1.6;
    overflow-x: hidden;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 2px solid #333;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

header p {
    font-size: 0.875rem;
    color: #aaa;
}

/* Main Content */
main {
    flex: 1;
    padding: 1rem;
    max-width: 100%;
}

section {
    margin-bottom: 1.5rem;
}

/* Controls Section */
#controls-section {
    background: #1a1a1a;
    padding: 1.5rem;
    border-radius: 8px;
}

#controls-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #fff;
}

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

.parameter {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.parameter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.parameter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #ddd;
}

.parameter-value {
    font-size: 0.875rem;
    color: #888;
    font-family: monospace;
}

.parameter-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #333, #555);
    outline: none;
}

.parameter-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
}

.parameter-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
}

/* Submit Section */
#submit-section {
    text-align: center;
}

.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 400px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn:disabled {
    background: #555;
    cursor: not-allowed;
    box-shadow: none;
}

#status-message {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #aaa;
    min-height: 1.5rem;
}

#status-message.success {
    color: #4ade80;
}

#status-message.error {
    color: #f87171;
}

/* Footer */
footer {
    padding: 1.5rem 1rem;
    text-align: center;
    background: #1a1a1a;
    border-top: 1px solid #333;
    font-size: 0.75rem;
    color: #666;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#loading-overlay.hidden {
    display: none;
}

.spinner {
    border: 4px solid #333;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

/* Success Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #1a1a1a;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-content.preview-modal {
    max-width: 900px;
    width: 95%;
    text-align: left;
    padding: 1.25rem;
}

.preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #333;
}

.preview-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.preview-subtitle {
    margin: 0.25rem 0 0 0;
    color: #aaa;
    font-size: 0.875rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.preview-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
}

.preview-close:hover {
    color: #fff;
}

.preview-body {
    padding-top: 1rem;
}

.preview-frame {
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #333;
    position: relative;
    height: 0;
    padding-bottom: 70.8%; /* landscape default */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

#preview-artwork-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.preview-hint {
    margin-top: 0.75rem;
    color: #888;
    font-size: 0.875rem;
}

.preview-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.modal-content p {
    margin-bottom: 0.5rem;
    color: #aaa;
}

.modal-content .artwork-id {
    margin: 1rem 0;
    padding: 0.75rem;
    background: #222;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.875rem;
}

.modal-content .artwork-id span {
    color: #667eea;
    font-weight: 600;
}

/* Responsive */
@media (min-width: 768px) {
    main {
        max-width: 800px;
        margin: 0 auto;
    }
}

.hidden {
    display: none !important;
}
