* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--gray-900);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6366f1 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 40px 20px;
}

.section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--gray-200);
}

.section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--gray-900);
    font-weight: 600;
}

/* Upload Area */
.upload-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.upload-item {
    background: var(--gray-100);
    border: 2px dashed var(--gray-300);
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-item:hover {
    border-color: var(--primary-color);
    background: #eef2ff;
}

.upload-item h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--gray-900);
}

.upload-item .subtitle {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 15px;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-input-wrapper input[type="file"] {
    display: none;
}

.file-label {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.file-label:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.status {
    margin-top: 10px;
    font-size: 0.9rem;
    min-height: 20px;
}

.status.success {
    color: var(--secondary-color);
}

.status.error {
    color: var(--danger-color);
}

.status.loading {
    color: var(--gray-600);
}

/* Configuration Area */
.config-area {
    background: var(--gray-100);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.config-item {
    display: flex;
    flex-direction: column;
}

.config-item.checkbox {
    flex-direction: row;
    align-items: center;
}

.config-item label {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--gray-700);
}

.config-item.checkbox label {
    margin-bottom: 0;
    margin-left: 8px;
}

.config-item select,
.config-item input[type="checkbox"] {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 1rem;
    background: white;
}

.config-item select {
    cursor: pointer;
}

.config-item select:disabled {
    background: var(--gray-200);
    cursor: not-allowed;
    opacity: 0.6;
}

.config-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: var(--danger-color);
    color: white;
    margin-top: 20px;
}

.btn-secondary:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-download {
    background: var(--secondary-color);
    color: white;
    font-size: 0.9rem;
    padding: 8px 16px;
    margin-left: 10px;
}

.btn-download:hover {
    background: #059669;
}

/* Results List */
.results-list {
    background: var(--gray-100);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.result-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-info {
    flex-grow: 1;
}

.result-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 5px;
}

.result-size {
    font-size: 0.9rem;
    color: var(--gray-600);
}

.result-empty {
    text-align: center;
    color: var(--gray-600);
    padding: 20px;
}

/* Footer */
footer {
    background: var(--gray-100);
    padding: 20px;
    text-align: center;
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .upload-area {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 20px 15px;
    }

    .section {
        margin-bottom: 30px;
        padding-bottom: 30px;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-download {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}
