* {
    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;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 40px;
    max-width: 800px;
    width: 100%;
    position: relative;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

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

.header p {
    color: #666;
    font-size: 1.1em;
    line-height: 1.6;
}

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

.upload-area:hover, .upload-area.dragover {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: scale(1.02);
}

.upload-area::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.3s ease;
    opacity: 0;
}

.upload-area:hover::before {
    opacity: 1;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.upload-icon {
    font-size: 4em;
    color: #667eea;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.upload-area:hover .upload-icon {
    transform: scale(1.1) rotate(5deg);
}

.upload-text {
    color: #333;
    font-size: 1.2em;
    margin-bottom: 10px;
    font-weight: 600;
}

.upload-subtext {
    color: #666;
    font-size: 0.9em;
}

.file-input {
    display: none;
}

.feature-toggles {
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8efff 100%);
    border-radius: 15px;
    border: 2px solid #e0e6ff;
}

.feature-toggles h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1.3em;
}

.toggle-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
}

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

.toggle-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 2px solid #e0e6ff;
    transition: all 0.3s ease;
}

.toggle-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background: linear-gradient(45deg, #667eea, #764ba2);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.toggle-info {
    flex: 1;
}

.toggle-info h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1em;
    font-weight: 600;
}

.toggle-info p {
    margin: 0;
    color: #666;
    font-size: 0.85em;
    line-height: 1.3;
}

.settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 15px;
    border: 1px solid #e0e6ff;
}

.setting-group {
    display: flex;
    flex-direction: column;
}

.setting-group label {
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-group input, .setting-group select {
    padding: 12px;
    border: 2px solid #e0e6ff;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

.setting-group input:focus, .setting-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.process-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    display: none;
    position: relative;
    overflow: hidden;
}

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

.process-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.process-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.process-btn:hover:not(:disabled)::before {
    left: 100%;
}

.progress-container {
    display: none;
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e6ff;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

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

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, .2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, .2) 50%,
        rgba(255, 255, 255, .2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: move 2s linear infinite;
}

@keyframes move {
    0% { background-position: 0 0; }
    100% { background-position: 50px 50px; }
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    font-weight: 500;
}

.results {
    display: none;
    margin-top: 30px;
}

.result-item {
    background: #f8f9ff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.result-item h3 {
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
}

.result-info div {
    background: rgba(102, 126, 234, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
}

.download-btn {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 600;
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.error {
    background: #ffe6e6;
    border-left-color: #dc3545;
}

.error h3 {
    color: #721c24;
}

.error p {
    color: #721c24;
    margin: 10px 0;
}

.file-list {
    display: none;
    margin-top: 20px;
}

.file-item {
    background: #f8f9ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e0e6ff;
    transition: all 0.3s ease;
}

.file-item:hover {
    border-color: #667eea;
    transform: translateX(5px);
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-name {
    font-weight: 600;
    color: #333;
}

.file-size {
    color: #666;
    font-size: 0.9em;
}

.remove-file {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s ease;
}

.remove-file:hover {
    background: #c82333;
    transform: scale(1.05);
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e6ff;
    color: #666;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    .settings {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .result-info {
        grid-template-columns: 1fr;
    }
    
    .file-item {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    }
    
    .container {
        background: #1a202c;
        color: #e2e8f0;
    }
    
    .header h1 {
        color: #e2e8f0;
    }
    
    .header p {
        color: #a0aec0;
    }
    
    .upload-area {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .upload-text {
        color: #e2e8f0;
    }
    
    .upload-subtext {
        color: #a0aec0;
    }
    
    .settings {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .setting-group label {
        color: #e2e8f0;
    }
    
    .setting-group input, .setting-group select {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .file-item, .result-item {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .result-item h3 {
        color: #e2e8f0;
    }
    
    .progress-text {
        color: #a0aec0;
    }
    
    .footer {
        color: #a0aec0;
        border-color: #4a5568;
    }
}
