/* Reset and base styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-light: #f5f3ff;
    --primary-subtle: #ede9fe;
    --success-color: #10b981;
    --error-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-color);
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.description {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Main content */
main {
    flex: 1;
    position: relative;
}

/* Upload section */
.upload-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
}

.drop-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-color);
}

.drop-subtext {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.drop-divider {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.file-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.file-button:hover {
    background-color: var(--primary-hover);
}

/* Selected file info (shown after file selection) */
.selected-file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--primary-light);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    color: var(--primary-hover);
    font-size: 0.875rem;
    font-weight: 500;
}

.selected-file-info::before {
    content: '✓';
    font-weight: 700;
}

/* Preview section */
.preview-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

.file-type {
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-subtle);
    color: var(--primary-hover);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

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

.preview-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.row-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.column-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Pagination controls */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: var(--bg-color);
    border-radius: 8px;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    color: var(--text-color);
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 100px;
    text-align: center;
}

/* Table styles */
.table-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 60vh;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* Scroll indicator fade on right edge */
.table-wrapper.has-scroll-right::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.9));
    pointer-events: none;
    border-radius: 0 8px 8px 0;
}

.scroll-hint {
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-align: right;
    margin-bottom: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead {
    background-color: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 1;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

th {
    font-weight: 600;
    color: var(--text-color);
}

td {
    color: var(--text-muted);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background-color: #f8fafc;
}

.table-hint {
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

/* Raw Editor Section */
.editor-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.editor-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.editor-error p {
    color: #dc2626;
    font-size: 0.875rem;
    margin: 0;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    word-break: break-word;
}

.editor-container {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    height: 50vh;
}

.editor-line-numbers {
    background-color: #f1f5f9;
    padding: 0.75rem 0.5rem;
    text-align: right;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-muted);
    user-select: none;
    overflow-y: hidden;
    min-width: 3rem;
    white-space: pre;
    flex-shrink: 0;
}

.raw-editor {
    flex: 1;
    min-width: 0;
    padding: 0.75rem;
    border: none;
    resize: none;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--card-bg);
    overflow-y: auto;
    white-space: pre;
}

.raw-editor:focus {
    outline: none;
}

.editor-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.retry-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

.retry-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.editor-actions .reset-button {
    flex: 1;
}

/* Export Mode Selection */
.export-mode-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.mode-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.complexity-info {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.mode-next-step {
    color: var(--text-color);
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.mode-tip {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    padding: 0.5rem 0.75rem;
    background: var(--bg-color);
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.mode-tip code {
    background: var(--border-color);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.8125rem;
}

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

.mode-option {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-option:hover {
    border-color: var(--primary-color);
    background-color: #f8fafc;
}

.mode-option.selected {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.mode-option-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.mode-radio {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
}

.mode-option.selected .mode-radio {
    border-color: var(--primary-color);
}

.mode-option.selected .mode-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.mode-option strong {
    font-weight: 600;
    color: var(--text-color);
}

.mode-description {
    display: block;
    color: var(--text-color);
    font-size: 0.875rem;
    margin-left: 2.25rem;
}

.mode-note {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: 2.25rem;
    margin-top: 0.25rem;
}

.mode-actions {
    display: flex;
    gap: 0.75rem;
}

.proceed-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

.cancel-btn {
    padding: 0.75rem 1.5rem;
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Mode Comparison Visual */
.mode-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mode-example {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background: #fafafa;
}

.mode-example-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.mode-example-header strong {
    font-size: 0.9375rem;
    color: var(--text-color);
}

.mode-badge {
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.mode-example-visual {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.mini-table {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    font-size: 0.75rem;
}

.mini-table.wide {
    width: 100%;
}

.mini-table-title {
    background: var(--primary-subtle);
    color: var(--primary-hover);
    font-weight: 600;
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.mini-row {
    padding: 0.25rem 0.5rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-muted);
}

.mini-row.header {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.mode-best-for {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    font-style: italic;
}

@media (max-width: 640px) {
    .mode-comparison {
        grid-template-columns: 1fr;
    }
}

/* Convert section */
.convert-section {
    margin-bottom: 1.5rem;
}

.convert-label {
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.convert-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.convert-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.convert-btn:hover {
    filter: brightness(0.9);
}

.convert-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.convert-btn-secondary:hover {
    background-color: var(--success-color);
    color: white;
    filter: none;
}

.reset-button {
    width: 100%;
    padding: 0.75rem;
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-button:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Loading overlay */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error message */
.error-message {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--error-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 90%;
    text-align: left;
    z-index: 1001;
}

.error-message.hidden {
    display: none !important;
}

.error-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.error-close:hover {
    opacity: 1;
}

/* Focus-visible styles for accessibility */
button:focus-visible,
.file-button:focus-visible,
input:focus-visible,
textarea:focus-visible,
details summary:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.mode-btn:focus-visible {
    outline-offset: -2px;
}

.drop-zone:focus-visible {
    border-color: var(--primary-color);
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Footer */
footer {
    text-align: center;
    padding-top: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Disclaimer */
.disclaimer {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #166534;
    font-size: 0.8125rem;
}

.disclaimer p {
    margin: 0;
}

/* PWA Install Prompt */
.install-prompt {
    margin-bottom: 1.5rem;
    text-align: center;
}

.install-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.install-button:hover {
    background-color: var(--primary-hover);
}

.install-button:active {
    transform: scale(0.98);
}

.install-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* Feedback Section */
.feedback-section {
    margin-bottom: 1.5rem;
}

.feedback-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: underline;
    padding: 0;
}

.feedback-toggle:hover {
    color: var(--primary-hover);
}

.feedback-form-container {
    margin-top: 1rem;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
    margin: 0 auto;
}

.feedback-input,
.feedback-textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--card-bg);
}

.feedback-input:focus,
.feedback-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.feedback-textarea {
    min-height: 80px;
    resize: vertical;
}

.feedback-submit {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.feedback-submit:hover {
    background-color: var(--primary-hover);
}

.feedback-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Feedback success message */
.feedback-success {
    color: var(--success-color);
    font-size: 0.875rem;
    text-align: center;
    padding: 0.75rem;
}

/* Preview Mode Toggle */
.preview-mode-toggle {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    background: var(--card-bg);
}

.mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn:first-child {
    border-right: 1px solid var(--border-color);
}

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

.mode-btn:hover:not(.active) {
    background: #f1f5f9;
    color: var(--text-color);
}

.mode-btn-icon {
    flex-shrink: 0;
}

/* Multi-table Accordion */
.multi-table-accordion {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--card-bg);
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    background: #f8fafc;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}

.accordion-header:hover {
    background: #f1f5f9;
}

.accordion-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.accordion-header .table-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9375rem;
}

.accordion-header .row-count {
    color: var(--text-muted);
    font-size: 0.8125rem;
    background: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.accordion-header .chevron {
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.accordion-item.expanded .accordion-header .chevron {
    transform: rotate(180deg);
}

.accordion-content {
    display: none;
    border-top: 1px solid var(--border-color);
    max-height: 250px;
    overflow: auto;
}

.accordion-item.expanded .accordion-content {
    display: block;
}

.accordion-content table {
    width: 100%;
    font-size: 0.8125rem;
    border-collapse: collapse;
}

.accordion-content th,
.accordion-content td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.accordion-content th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-color);
    position: sticky;
    top: 0;
}

.accordion-content td {
    color: var(--text-muted);
}

.accordion-content tr:last-child td {
    border-bottom: none;
}

/* Features Section */
.features-section {
    margin-top: 2rem;
    text-align: center;
}

.features-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--primary-color);
}

.feature-icon svg {
    width: 100%;
    height: 100%;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* How It Works Section */
.how-it-works-section {
    margin-top: 2rem;
    text-align: center;
}

.how-it-works-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.steps-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.125rem;
}

.step-content {
    text-align: center;
}

.step-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.step-content p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.step-arrow {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
}

.step-arrow svg {
    width: 100%;
    height: 100%;
}

/* FAQ Section */
.faq-section {
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.faq-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 1.5rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.25rem;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 400;
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item summary:hover {
    background: var(--bg-color);
}

.faq-item p {
    padding: 0 1.25rem 1rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Responsive - Tablet and below */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .description {
        font-size: 0.8125rem;
    }

    .drop-zone {
        padding: 2rem 1rem;
    }

    .upload-icon {
        width: 36px;
        height: 36px;
    }

    .drop-text {
        font-size: 1rem;
    }

    /* Better touch targets for buttons */
    .file-button {
        padding: 0.875rem 1.75rem;
        min-height: 44px;
    }

    th, td {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .convert-buttons {
        flex-direction: column;
    }

    .convert-btn {
        width: 100%;
        text-align: center;
        min-height: 48px;
        padding: 0.875rem 1.5rem;
    }

    /* Preview mode toggle for mobile */
    .preview-mode-toggle {
        flex-direction: column;
        border-radius: 8px;
    }

    .mode-btn {
        padding: 0.875rem 1rem;
        min-height: 48px;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color);
    }

    .mode-btn:last-child {
        border-bottom: none;
    }

    /* File info responsive */
    .file-info {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .file-name {
        flex: 1 1 100%;
        word-break: break-all;
        font-size: 0.9375rem;
    }

    /* Pagination controls for mobile */
    .pagination-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .pagination-btn {
        min-height: 44px;
        padding: 0.625rem 1rem;
        flex: 1;
        min-width: 100px;
    }

    .page-info {
        flex: 1 1 100%;
        order: -1;
        margin-bottom: 0.25rem;
    }

    /* Table container for mobile */
    .table-container {
        max-height: 50vh;
    }

    /* Raw editor for mobile */
    .editor-container {
        height: 40vh;
    }

    .editor-line-numbers {
        min-width: 2.5rem;
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }

    .raw-editor {
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    .editor-actions {
        flex-direction: column;
    }

    .retry-btn,
    .editor-actions .reset-button {
        min-height: 48px;
    }

    /* Export mode section for mobile */
    .mode-card h3 {
        font-size: 1.125rem;
    }

    .mode-actions {
        flex-direction: column;
    }

    .proceed-btn,
    .cancel-btn {
        width: 100%;
        min-height: 48px;
    }

    /* Reset button */
    .reset-button {
        min-height: 48px;
    }

    /* Error message for mobile */
    .error-message {
        top: auto;
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        transform: none;
        max-width: none;
    }

    /* Features responsive */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-card {
        padding: 1.25rem;
    }

    .feature-icon {
        width: 40px;
        height: 40px;
    }

    /* How It Works responsive */
    .steps-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .step-arrow {
        transform: rotate(90deg);
    }

    .step {
        flex-direction: row;
        gap: 1rem;
    }

    .step-content {
        text-align: left;
    }

    /* FAQ responsive */
    .faq-item summary {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
        min-height: 48px;
    }

    .faq-item p {
        padding: 0 1rem 0.875rem;
        font-size: 0.875rem;
    }

    /* Accordion improvements for mobile */
    .accordion-header {
        padding: 0.75rem;
    }

    .accordion-header .table-name {
        font-size: 0.875rem;
    }

    .accordion-content {
        max-height: 200px;
    }

    .accordion-content th,
    .accordion-content td {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
        max-width: 120px;
    }

    /* Feedback form */
    .feedback-form {
        max-width: 100%;
    }

    .feedback-submit {
        min-height: 48px;
    }

    /* Disclaimer text */
    .disclaimer {
        font-size: 0.75rem;
        padding: 0.625rem 0.875rem;
    }
}

/* Responsive - Small phones */
@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }

    header {
        margin-bottom: 1.5rem;
    }

    header h1 {
        font-size: 1.375rem;
    }

    .subtitle {
        font-size: 0.9375rem;
    }

    .upload-section {
        padding: 1.25rem;
    }

    .drop-zone {
        padding: 1.5rem 0.75rem;
    }

    .drop-subtext {
        font-size: 0.8125rem;
    }

    /* Preview section spacing */
    .preview-section {
        padding: 1rem;
    }

    .preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .preview-header h2 {
        font-size: 1rem;
    }

    /* Even smaller table cells */
    th, td {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
        max-width: 100px;
    }

    /* Pagination on small screens */
    .pagination-btn {
        font-size: 0.8125rem;
        padding: 0.5rem 0.75rem;
    }

    /* Editor section */
    .editor-section {
        padding: 1rem;
    }

    .editor-error p {
        font-size: 0.8125rem;
    }

    /* Export mode section */
    .export-mode-section {
        padding: 1rem;
    }

    .mode-tip {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }

    .mode-example {
        padding: 0.75rem;
    }

    .mode-example-header strong {
        font-size: 0.875rem;
    }

    .mini-table {
        font-size: 0.6875rem;
    }

    /* Features and sections */
    .features-title,
    .how-it-works-title,
    .faq-title {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .step-content h3 {
        font-size: 0.9375rem;
    }

    .step-content p {
        font-size: 0.75rem;
    }

    /* Footer */
    footer {
        padding-top: 1.5rem;
        font-size: 0.8125rem;
    }
}

/* Responsive - Very small phones (iPhone SE, etc.) */
@media (max-width: 375px) {
    .container {
        padding: 0.5rem;
    }

    header h1 {
        font-size: 1.25rem;
    }

    .upload-section {
        padding: 1rem;
    }

    .drop-zone {
        padding: 1.25rem 0.5rem;
    }

    .file-button {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }

    .mode-btn {
        font-size: 0.8125rem;
    }

    .convert-btn {
        font-size: 0.9375rem;
    }

    .pagination-controls {
        padding: 0.375rem;
    }

    .pagination-btn {
        min-width: 80px;
        font-size: 0.75rem;
    }

    .page-info {
        font-size: 0.8125rem;
    }

    /* Accordion */
    .accordion-header-left {
        gap: 0.5rem;
    }

    .accordion-header .row-count {
        font-size: 0.6875rem;
        padding: 0.125rem 0.375rem;
    }
}
