* {
    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;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 40px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.setting-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.setting-group h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.size-mode {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.mode-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.mode-btn.active {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.size-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.size-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.size-input:focus {
    outline: none;
    border-color: #667eea;
}

.add-size-btn {
    width: 100%;
    padding: 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.add-size-btn:hover {
    background: #218838;
}

.size-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.size-tag {
    background: #667eea;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.size-tag .remove {
    cursor: pointer;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.size-tag .remove:hover {
    background: rgba(255,255,255,0.5);
}

.drop-zone {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    background: #f8f9ff;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 30px;
}

.drop-zone.dragover {
    border-color: #5a6fd8;
    background: #e8ebff;
    transform: scale(1.02);
}

.drop-zone-icon {
    font-size: 4em;
    color: #667eea;
    margin-bottom: 20px;
}

.drop-zone h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.drop-zone p {
    color: #666;
    font-size: 1.1em;
}

.file-input {
    display: none;
}

.results {
    margin-top: 30px;
}

.result-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-title {
    font-size: 1.3em;
    color: #333;
    font-weight: 600;
}

.download-all-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.download-all-btn:hover {
    background: #138496;
}

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

.result-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
}

.result-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.result-info {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.download-btn {
    width: 100%;
    background: #667eea;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.download-btn:hover {
    background: #5a6fd8;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.error-message {
    color: #dc3545;
    background: #f8d7da;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    border: 1px solid #f5c6cb;
}

.success-message {
    color: #155724;
    background: #d4edda;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    border: 1px solid #c3e6cb;
}

.nav-link {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.nav-link a {
    color: #667eea;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.nav-link a:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

.bulk-download-section {
    background: #f0f8ff;
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.bulk-download-header h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.bulk-download-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.3);
}

.bulk-download-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(220, 53, 69, 0.4);
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .settings {
        grid-template-columns: 1fr;
    }
    
    .size-inputs {
        flex-direction: column;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
}