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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --success: #16a34a;
    --danger: #dc2626;
    --bg: #ffffff;
    --bg-secondary: #f8fafc;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-light: #64748b;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px 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);
}

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

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

h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.9;
}

main {
    background: var(--bg);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

/* Upload Section */
.upload-section {
    margin-bottom: 2rem;
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: #eff6ff;
    transform: translateY(-2px);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--primary);
    stroke-width: 2;
}

.upload-text {
    font-size: 1.1rem;
    color: var(--text-light);
}

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

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.file-name {
    font-weight: 600;
    color: var(--text);
}

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

/* Options Section */
.options-section h2,
.results-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.split-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-card {
    padding: 1.5rem;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-option input:checked + .mode-card {
    border-color: var(--primary);
    background: #eff6ff;
}

.mode-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.mode-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.mode-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.mode-desc {
    font-size: 0.875rem;
    color: var(--text-light);
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.input-group input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: white;
    margin-top: 0.4rem;
}

.input-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
}

.input-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.size-limit-group {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.9rem;
    background: #f8fafc;
}

.size-limit-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.size-limit-inputs {
    margin-top: 0.75rem;
}

.size-note {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

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

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

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border: 2px solid var(--border);
    margin-top: 1.5rem;
}

.btn-secondary:hover {
    background: white;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
}

.btn-clear:hover {
    color: var(--danger);
}

/* Results */
.results-grid {
    display: grid;
    gap: 1rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.result-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.result-icon {
    font-size: 2rem;
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.result-name {
    font-weight: 600;
    color: var(--text);
}

.result-meta {
    font-size: 0.875rem;
    color: var(--text-light);
}

.result-meta.warning {
    color: #b45309;
    font-weight: 600;
}

.btn-download {
    padding: 0.5rem 1rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-download:hover {
    background: #15803d;
    transform: translateY(-2px);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 2rem;
    color: white;
    opacity: 0.9;
    font-size: 0.875rem;
}

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

    h1 {
        font-size: 2rem;
    }

    main {
        padding: 1.5rem;
    }

    .split-modes {
        grid-template-columns: 1fr;
    }

    .result-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
