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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    padding: 2rem;
}

.hero-section {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

.gradient-text {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 700;
    background: linear-gradient(135deg, #FF006E, #8338EC, #3A86FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.25rem;
    color: #a0a0a0;
    font-weight: 300;
}

.upload-section {
    max-width: 600px;
    margin: 0 auto;
}

.upload-zone {
    border: 2px dashed #444;
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.upload-zone:hover {
    border-color: #FF006E;
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(255, 0, 110, 0.2);
}

.upload-zone.dragover {
    border-color: #3A86FF;
    background: rgba(58, 134, 255, 0.1);
}

.upload-icon {
    margin-bottom: 1.5rem;
    color: #666;
    transition: all 0.3s ease;
}

.upload-zone:hover .upload-icon {
    color: #FF006E;
    transform: scale(1.1);
}

.upload-btn {
    background: none;
    border: none;
    color: #3A86FF;
    font-size: 1.1rem;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.upload-btn:hover {
    color: #FF006E;
}

.editor-section {
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-out;
}

.editor-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    align-items: start;
}

.image-container {
    background: #1a1a1a;
    border-radius: 20px;
    padding: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

#imageCanvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

.controls-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
}

.controls-panel h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #a0a0a0;
    font-weight: 500;
}

.color-picker-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#colorPicker {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: none;
}

.color-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

select {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    color: #ffffff;
    font-size: 1rem;
    cursor: pointer;
}

select option {
    background: #1a1a1a;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #FF006E;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 0, 110, 0.5);
}

.custom-colors-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-colors-section h4 {
    font-size: 1rem;
    color: #a0a0a0;
    margin-bottom: 1rem;
}

.custom-colors {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.color-swatch {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 2px solid transparent;
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.remove-color {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #FF006E;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.color-swatch:hover .remove-color {
    opacity: 1;
}

.btn.small {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn.primary {
    background: linear-gradient(135deg, #FF006E, #8338EC);
    color: white;
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 0, 110, 0.4);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #a0a0a0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.hidden {
    display: none !important;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .editor-grid {
        grid-template-columns: 1fr;
    }
    
    .controls-panel {
        order: -1;
    }
}