:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #10b981;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    display: inline-block;
}

header h1 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.tagline {
    color: var(--text-light);
    font-size: 0.95rem;
}

.header-links {
    float: right;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--text);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background 0.2s;
}

.github-link:hover {
    background: var(--primary-dark);
}

/* Main Content */
main {
    padding: 2rem 0;
}

section {
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

/* Hero */
.hero {
    text-align: center;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

/* Main Grid - Side by side layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 968px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* Upload Section */
.upload-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.upload-box {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: 0.75rem;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-box:hover {
    border-color: var(--primary);
    background: #f0f9ff;
}

.upload-box.drag-over {
    border-color: var(--primary);
    background: #f0f9ff;
    transform: scale(1.01);
}

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

.upload-box h3 {
    margin-bottom: 0.25rem;
    font-size: 1.125rem;
}

.upload-box p {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

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

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

.btn-block {
    width: 100%;
    padding: 0.75rem 1.5rem;
}

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

.btn-text:hover {
    color: var(--primary);
}

.btn-help {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.75rem;
}

.btn-help:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0f9ff;
}

/* Files Section */
.files-section {
    background: var(--surface);
    padding: 1.25rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    max-height: 500px;
    display: flex;
    flex-direction: column;
}

.files-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.files-header h3 {
    margin: 0;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    flex: 1;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem;
    background: var(--background);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

.file-item:hover {
    border-color: var(--primary);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex: 1;
    min-width: 0;
}

.file-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.file-name {
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.file-remove {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.file-remove:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Info Box */
.info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
}

.info-box h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9375rem;
    color: var(--primary);
}

.info-box ul {
    margin: 0;
    padding-left: 1.25rem;
    list-style: none;
}

.info-box li {
    margin-bottom: 0.625rem;
    line-height: 1.5;
    position: relative;
}

.info-box li:last-child {
    margin-bottom: 0;
}

.info-box li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    position: absolute;
    left: -1rem;
}

.info-box code {
    background: rgba(37, 99, 235, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    color: var(--primary);
}

.info-box strong {
    color: var(--text);
}

/* Options */
.options-section {
    background: var(--surface);
    padding: 1.25rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
}

.options-compact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem;
    background: var(--background);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    font-size: 0.875rem;
    cursor: pointer;
}

.option-row:hover {
    border-color: var(--primary);
}

.option-row span {
    flex: 1;
}

.option-row input[type="number"] {
    width: 60px;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    text-align: center;
}

.option-row input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Progress */
.progress-section {
    background: var(--surface);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin: 1.5rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 999px;
    transition: width 0.3s;
    width: 0%;
}

#progressText {
    color: var(--text-light);
}

/* Results */
.results-section {
    background: var(--surface);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    padding: 1.5rem;
    background: var(--background);
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.download-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.download-links {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.download-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--background);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.download-link:hover {
    border-color: var(--primary);
    background: #f0f9ff;
    transform: translateX(4px);
}

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

.download-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-arrow {
    color: var(--primary);
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-light);
}

/* How It Works */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    text-align: center;
    padding: 2rem;
    background: var(--surface);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1.5rem;
}

.step p {
    color: var(--text-light);
}

/* CTA */
.cta {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--surface);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.cta h2 {
    margin-bottom: 0.5rem;
}

.cta p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Footer */
footer {
    background: var(--text);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

footer p {
    margin: 0.5rem 0;
}

footer a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

footer a:hover {
    opacity: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--surface);
    border-radius: 1rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--background);
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(80vh - 100px);
}

.help-section {
    margin-bottom: 2rem;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--primary);
}

.help-section p {
    margin: 0.75rem 0;
    line-height: 1.6;
    color: var(--text);
}

.help-section p:first-of-type {
    margin-top: 0;
}

.help-section strong {
    color: var(--text);
    font-weight: 600;
}

.help-section code {
    background: var(--background);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--primary);
}

.help-section ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.help-section li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    .header-links {
        float: none;
        margin-top: 1rem;
        display: flex;
        flex-wrap: wrap;
    }

    .hero {
        padding: 1rem 0;
    }

    .features-grid,
    .steps {
        grid-template-columns: 1fr;
    }

    .upload-box {
        padding: 2rem 1rem;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
        max-height: calc(90vh - 80px);
    }
}
