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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.main-nav {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-bottom: 20px;
    padding: 0;
}

.nav-link {
    color: #999;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #ccc;
}

.nav-link.active {
    color: #4a9eff;
}

h1 {
    color: #fff;
    margin-bottom: 30px;
    text-align: center;
}

h2 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.form-section {
    background: #2a2a2a;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #ccc;
    font-weight: 500;
}

input[type="file"] {
    width: 100%;
    padding: 8px 10px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 14px;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    background: #4a9eff;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

input[type="file"]::file-selector-button:hover {
    background: #3a8eef;
}

button {
    background: #4a9eff;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #3a8eef;
}

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

#generateBtn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    margin-top: 20px;
}

.hidden {
    display: none;
}

.background-options {
    margin-top: 40px;
    background: #2a2a2a;
    padding: 30px;
    border-radius: 8px;
}

.background-options h2 {
    text-align: center;
    margin-bottom: 30px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.preview-option {
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.preview-option:hover {
    border-color: #4a9eff;
    transform: translateY(-2px);
}

.preview-option.selected {
    border-color: #4a9eff;
    border-width: 3px;
    background: #2a3a4a;
}

.preview-option h3 {
    text-align: center;
    margin-bottom: 10px;
    color: #fff;
    font-size: 14px;
}

.preview-canvas {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}

.result {
    margin-top: 40px;
    background: #2a2a2a;
    padding: 30px;
    border-radius: 8px;
}

.result h2 {
    text-align: center;
    margin-bottom: 20px;
}

.result-container {
    text-align: center;
}

#artworkCanvas {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
    border: 1px solid #444;
    border-radius: 4px;
}

.download-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

#downloadBtnHighRes,
#downloadBtnWeb {
    padding: 12px 30px;
    font-size: 16px;
}

.loading {
    text-align: center;
    padding: 40px;
    margin-top: 40px;
}

.spinner {
    border: 4px solid #444;
    border-top: 4px solid #4a9eff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading p {
    color: #ccc;
    font-size: 18px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
}
