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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    opacity: 0.9;
    font-size: 1.1em;
}

.content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
    align-items: start;
}

.panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
}

.panel-left {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    position: sticky;
    top: 15px;
}

.panel-left::-webkit-scrollbar {
    width: 8px;
}

.panel-left::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.panel-left::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.panel-left::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.panel-right {
    position: sticky;
    top: 15px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: auto;
}

.panel h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.upload-area:hover {
    background: #f0f4ff;
    border-color: #764ba2;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

#imagePreview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    display: none;
    cursor: zoom-in;
    user-select: none;
    object-fit: contain;
}

/* Container para o zoom da imagem */
#imagePreview {
    transition: transform 0.2s ease;
}

#imagePreview:hover {
    cursor: zoom-in;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.control-group input[type="number"],
.control-group input[type="range"],
.control-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border 0.3s;
}

.control-group input:focus,
.control-group select:focus {
    outline: none;
    border-color: #667eea;
}

.control-group input[type="range"] {
    padding: 0;
}

.range-value {
    display: inline-block;
    margin-left: 10px;
    font-weight: bold;
    color: #667eea;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button.secondary {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

#canvasPreview {
    border-radius: 10px;
    background: white;
    display: none;
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
}

.stats {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    display: none;
}

.stats h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 600;
    color: #555;
}

.stat-value {
    color: #764ba2;
    font-weight: bold;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

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

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

@media (max-width: 1024px) {
    .content {
        grid-template-columns: 1fr;
    }

    .panel-left,
    .panel-right {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

