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

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

.container {
    max-width: 100%;
    padding: 1rem;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

header p {
    opacity: 0.9;
    font-size: 0.9rem;
}

main {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.upload-section {
    text-align: center;
    margin-bottom: 2rem;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto 1rem;
    transition: transform 0.2s;
}

.upload-btn:hover {
    transform: translateY(-2px);
}

.upload-btn span {
    font-size: 1.2rem;
}

.upload-info {
    color: #666;
    font-size: 0.85rem;
}

.images-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.image-item {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 3/4;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-item .remove-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: rgba(255,0,0,0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-item .order {
    position: absolute;
    bottom: 0.25rem;
    left: 0.25rem;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
    font-size: 0.7rem;
}

.controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.generate-btn, .clear-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.generate-btn {
    background: #28a745;
    color: white;
}

.clear-btn {
    background: #dc3545;
    color: white;
}

.generate-btn:hover, .clear-btn:hover {
    transform: translateY(-1px);
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Desktop styles */
@media (min-width: 768px) {
    .container {
        max-width: 800px;
        margin: 0 auto;
        padding: 2rem;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    main {
        padding: 2rem;
    }
    
    .images-preview {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .controls {
        justify-content: center;
    }
    
    .generate-btn, .clear-btn {
        flex: none;
        min-width: 150px;
    }
}