:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success-color: #22c55e;
    --accent-color: #f59e0b;
    --tab-inactive: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-text {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
}

#file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    gap: 0.5rem;
    font-size: 1rem;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
    margin-top: 2rem;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.status-card {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 1rem;
    display: none;
}

.status-card.active {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.status-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: #f1f5f9;
    padding: 0.4rem;
    border-radius: 0.75rem;
}

.tab-btn {
    flex: 1;
    padding: 0.7rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.paste-area {
    width: 100%;
    height: 250px;
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 1rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    resize: none;
    background: #fcfcfc;
    transition: all 0.3s ease;
}

.paste-area:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.results {
    margin-top: 3rem;
    display: none;
}

.results.active {
    display: block;
}

.results h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: #f1f5f9;
    font-weight: 600;
    color: var(--text-muted);
}

tr:last-child td {
    border-bottom: none;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-v1 {
    background: #e0e7ff;
    color: #4338ca;
}

.badge-v2 {
    background: #fef3c7;
    color: #92400e;
}

footer {
    margin-top: auto;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    z-index: 9999;
    padding: 20px;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 1.5rem;
    max-width: 800px;
    margin: 50px auto;
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-scroll {
    overflow-y: auto;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    flex-grow: 1;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    header h1 {
        font-size: 2rem;
    }
}