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

:root {
    --primary-color: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #6366F1;
    --success-color: #10B981;
    --error-color: #EF4444;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --bg-primary: #F9FAFB;
    --bg-secondary: #FFFFFF;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
    color: var(--text-primary);
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo svg {
    color: white;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

/* Main Section */
main {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: #EEF2FF;
}

.file-upload-area.drag-over {
    border-color: var(--primary-color);
    background: #EEF2FF;
    transform: scale(1.02);
}

.upload-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.browse-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* File Info */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.file-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-details svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.file-text {
    text-align: left;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.file-size {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.remove-file {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.remove-file:hover {
    background: var(--error-color);
    color: white;
}

/* Quality Section */
.quality-section {
    margin: 2rem 0;
}

.section-label {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.quality-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quality-option {
    position: relative;
    cursor: pointer;
}

.quality-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.option-content {
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    background: var(--bg-primary);
    transition: all 0.2s;
}

.quality-option input[type="radio"]:checked + .option-content {
    border-color: var(--primary-color);
    background: #EEF2FF;
}

.quality-option:hover .option-content {
    border-color: var(--primary-light);
}

.option-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.option-title {
    font-weight: 600;
    color: var(--text-primary);
}

.option-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    background: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid var(--primary-color);
}

.option-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Compress Button */
.compress-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s;
    box-shadow: var(--shadow-md);
}

.compress-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.compress-btn:active {
    transform: translateY(0);
}

.compress-btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

/* Progress Section */
.progress-section {
    margin-top: 2rem;
}

.progress-bar {
    width: 100%;
    height: 0.5rem;
    background: var(--border-color);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 9999px;
    transition: width 0.3s ease;
    animation: progress-animation 1.5s ease-in-out infinite;
}

@keyframes progress-animation {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Result Section */
.result-section,
.error-section {
    margin-top: 2rem;
}

.result-card {
    text-align: center;
    padding: 2rem;
    background: var(--bg-primary);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.result-card.error {
    background: #FEF2F2;
    border-color: #FEE2E2;
}

.result-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-icon.success {
    background: var(--success-color);
    color: white;
}

.result-icon.error {
    background: var(--error-color);
    color: white;
}

.result-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.result-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 0.5rem;
}

.stat.highlight {
    background: #ECFDF5;
    border: 1px solid var(--success-color);
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.125rem;
}

.stat.highlight .stat-value {
    color: var(--success-color);
}

.error-message {
    color: var(--error-color);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.reset-btn {
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-btn:hover {
    background: var(--primary-dark);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 2rem;
    color: white;
}

footer p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.footer-note {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 640px) {
    body {
        padding: 1rem;
    }

    main {
        padding: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .file-upload-area {
        padding: 2rem 1rem;
    }

    .quality-options {
        gap: 0.5rem;
    }

    .option-content {
        padding: 0.875rem 1rem;
    }
}

