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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 1rem;
}

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

header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.logo {
    font-size: 2rem;
    text-decoration: none;
    transition: transform 0.3s;
    position: absolute;
    left: 0;
    top: 0;
    display: inline-block;
}

.logo:hover {
    transform: scale(1.2) rotate(10deg);
}

h1 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 0.5rem;
}

header p {
    color: #666;
}

.upload-box {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 3rem 2rem;
    text-align: center;
    background: #f8f9ff;
    transition: all 0.3s;
}

.upload-box:hover {
    border-color: #764ba2;
    background: #f0f2ff;
}

.upload-label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.upload-icon {
    font-size: 3rem;
}

.workspace {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 1.5rem;
    margin-top: 2rem;
}

.sidebar {
    background: #f8f9ff;
    padding: 1.5rem;
    border-radius: 10px;
    height: fit-content;
}

.sidebar h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
}

.left-sidebar {
    position: sticky;
    top: 1rem;
}

.right-sidebar {
    position: sticky;
    top: 1rem;
}

.main-content {
    min-width: 0;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.image-box {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 1rem;
    background: #fafafa;
    position: relative;
}

.image-box h3 {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #555;
}

.image-box img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: repeating-conic-gradient(#e0e0e0 0% 25%, transparent 0% 50%) 50% / 20px 20px;
}

.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    display: none;
}

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

.btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 0.75rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #4CAF50;
    color: white;
}

.btn-success {
    background: #2196F3;
    color: white;
}

.btn-new {
    background: #FF9800;
    color: white;
}

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

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

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
}

.control-group input[type="color"] {
    width: 100%;
    height: 45px;
    padding: 0.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    background: white;
}

.control-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.control-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.control-group input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 6px;
}

.control-group select,
.control-group input[type="file"] {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
}

.control-group input[type="file"] {
    padding: 0.4rem;
    cursor: pointer;
    background: white;
}

.control-group input[type="file"]::file-selector-button {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    cursor: pointer;
    margin-right: 0.5rem;
}

.control-group input[type="file"]::file-selector-button:hover {
    opacity: 0.9;
}

footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 0.9rem;
}

/* Tablet */
@media (max-width: 1024px) {
    .workspace {
        grid-template-columns: 200px 1fr 200px;
        gap: 1rem;
    }
    
    .sidebar {
        padding: 1rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .workspace {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .images-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 1rem;
        border-radius: 10px;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .upload-box {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }
    
    .container {
        padding: 0.75rem;
    }
    
    h1 {
        font-size: 1.25rem;
    }
    
    .sidebar h3 {
        font-size: 1rem;
    }
}
