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

:root {
    --bg1: #667eea;
    --bg2: #764ba2;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #667eea;
    --primary2: #764ba2;
    --danger: #ef4444;
    --success: #10b981;
    --radius-lg: 12px;
    --radius-md: 8px;
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 2px 12px rgba(0, 0, 0, 0.06);
    --ring: 0 0 0 4px rgba(102, 126, 234, 0.16);

    --surface: rgba(255, 255, 255, 0.94);
    --surface-2: rgba(249, 250, 251, 0.97);
    --border-2: rgba(17, 24, 39, 0.08);

    --info: #3b82f6;
    --warning: #f59e0b;
    --success-2: #16a34a;
    --danger-2: #dc2626;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 100%);
    min-height: 100vh;
    padding: 18px;
    color: var(--text);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border-2);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.source-toggler {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(17, 24, 39, 0.10);
    border-radius: 14px;
    padding: 10px 12px;
}

.source-options {
    background: rgba(255, 255, 255, 0.65);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid rgba(17, 24, 39, 0.10);
}

.source-btn {
    border-radius: 10px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-weight: 700;
    transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.source-btn:hover {
    background: rgba(79, 70, 229, 0.10);
    transform: translateY(-1px);
}

.source-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary2) 100%);
    color: white;
    box-shadow: 0 10px 26px rgba(79, 70, 229, 0.22);
}

.preview-table-container,
.table-scroll-container,
.query-results-container {
    max-height: 360px;
    overflow: auto;
}

#advancedMappingRows,
#csvMappingRows,
#jsonMappingRows {
    max-height: 320px;
    overflow: auto;
}

html,
body {
    overflow-x: hidden;
}

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

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.02em;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}

.status-dot.disconnected {
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-5px);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.job-search-section {
    margin-bottom: 20px;
}

#card-uploads #uploadsBody {
    transition: max-height 0.25s ease, opacity 0.2s ease;
    max-height: 2000px;
    opacity: 1;
}

#card-uploads.collapsed #uploadsBody {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

#card-uploads .job-cards-container {
    max-height: 520px;
    overflow: auto;
    border-radius: 14px;
}

@media (max-width: 640px) {
    #card-uploads .job-cards-container {
        max-height: 420px;
    }
}

.job-search-section .input-wrapper input {
    min-width: 220px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.input-group textarea {
    min-height: 80px;
    max-height: 200px;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

input[type="text"],
input[type="url"],
textarea {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    background: #ffffff;
}

input[type="text"]:focus,
input[type="url"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
}

input[type="text"]:focus-visible,
input[type="url"]:focus-visible,
textarea:focus-visible,
button:focus-visible,
select:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

textarea {
    width: 100%;
    min-height: 100px;
    resize: vertical;
}

.btn {
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary2) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f9fafb;
    color: #374151;
    border-color: var(--border);
}

.btn-secondary:hover {
    background: #f3f4f6;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    padding: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.info-box {
    background: #f9fafb;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.info-box label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}

.info-box .value {
    font-family: 'Courier New', monospace;
    color: #1f2937;
    font-size: 0.9rem;
    word-break: break-all;
}

.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: var(--radius-lg);
    padding: 34px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    background: rgba(249, 250, 251, 0.9);
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(243, 244, 246, 0.95);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.file-info {
    margin-top: 15px;
    padding: 15px;
    background: #eef2ff;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(102, 126, 234, 0.25);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
    word-wrap: break-word;
    box-shadow: var(--shadow-md);
}

.notification.success {
    background: #10b981;
}

.notification.error {
    background: #ef4444;
}

.notification.info {
    background: #3b82f6;
}

@media (max-width: 640px) {
    .notification {
        left: 12px;
        right: 12px;
        top: 12px;
        max-width: none;
        border-radius: 12px;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.hidden {
    display: none;
}

.schema-section {
    margin-top: 15px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.job-status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.job-status.completed {
    background: #d1fae5;
    border-left-color: #10b981;
}

.job-status.failed {
    background: #fee2e2;
    border-left-color: #ef4444;
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.db-url-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    color: #374151;
    word-break: break-all;
}

.api-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.api-label {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.api-boxes {
    display: flex;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    padding: 2px 0;
    max-width: 100%;
}

.api-boxes::-webkit-scrollbar {
    height: 4px;
}

.api-boxes::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.api-boxes::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.api-boxes::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.api-box {
    padding: 8px 50px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 120px;
    text-align: center;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.api-box:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.api-box.selected {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.4);
    font-weight: 700;
    transform: scale(1.05);
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    margin: 4px 6px 0 0;
}

.pill.match {
    border-color: #10b981;
    background: #d1fae5;
    color: #065f46;
}

.pill.mismatch {
    border-color: #ef4444;
    background: #fee2e2;
    color: #7f1d1d;
}

/* Source Toggler */
.source-toggler {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f9fafb;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.source-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
    white-space: nowrap;
}

.source-options {
    display: flex;
    gap: 10px;
    flex: 1;
}

.source-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    color: #6b7280;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.source-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.source-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Connection Status */
.connection-status {
    margin-top: 10px;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-indicator.connected {
    background: #d1fae5;
    color: #065f46;
}

.status-indicator.disconnected {
    background: #fee2e2;
    color: #7f1d1d;
}

.status-icon {
    font-weight: 700;
}

/* Query Results */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.query-results-container {
    max-height: 400px;
    overflow: auto;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

/* Source Sections */
.source-section {
    animation: slideDown 0.3s ease;
}

.source-section.hidden {
    display: none;
}

.mapping-section {
    margin-top: 16px;
    padding: 15px;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.mapping-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 10px;
    background: white;
    border: 1px solid #e5e7eb;
    margin-top: 10px;
}

.mapping-row label {
    margin: 0;
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 700;
}

select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    font-size: 0.95rem;
    font-family: 'Courier New', monospace;
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.preview-card {
    margin-top: 12px;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.preview-table th,
.preview-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.preview-table td {
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640px) {
    .preview-table td {
        max-width: 220px;
    }
}

.preview-table th {
    background: #f9fafb;
    position: sticky;
    top: 0;
}

.preview-table tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.preview-table tr:hover {
    background-color: #f3f4f6;
}

.preview-table tr.selected {
    background-color: #eef2ff;
    border-left: 3px solid #667eea;
}

.preview-table tr.selected:hover {
    background-color: #e0e7ff;
}

.row-checkbox {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
}

.selected-counter {
    color: #667eea;
    font-weight: 600;
}

.job-cards-container {
    margin-top: 20px;
    position: relative;
    padding-bottom: 10px;
}

.job-card {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
    backdrop-filter: blur(10px);
}

.job-cards-container.stacked .job-card {
    position: absolute;
    left: 0;
    right: 0;
    margin-bottom: 0;
}

.job-card:hover {
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.job-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-weight: 700;
    line-height: 1.25;
}

.job-card-title .job-id-badge {
    flex-shrink: 0;
}

.job-card-header > div:last-child {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.job-id-badge {
    align-self: flex-start;
}

.job-card-status {
    font-size: 0.85rem;
}

.job-card-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: var(--surface-2);
    font-weight: 700;
}

.job-status-processing {
    color: #1f2937;
}

.job-status-completed {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.25);
    color: #065f46;
}

.job-status-failed {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.25);
    color: #7f1d1d;
}

.job-progress-section {
    margin-top: 14px;
}

.job-progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(17, 24, 39, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

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

.job-error {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(220, 38, 38, 0.10);
    border: 1px solid rgba(220, 38, 38, 0.18);
    color: #7f1d1d;
    font-family: 'Courier New', monospace;
    word-break: break-word;
}

.job-progress-info {
    font-size: 0.8rem;
}

.job-details {
    font-size: 0.75rem;
    padding: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-2);
    color: var(--muted);
    line-height: 1.35;
}

@media (max-width: 640px) {
    .job-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .job-card-header > div:last-child {
        width: 100%;
        justify-content: space-between;
    }
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.75);
    color: #374151;
    border-color: rgba(17, 24, 39, 0.10);
}

@media (max-width: 640px) {
    .input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .mapping-row {
        grid-template-columns: 1fr;
    }

    .file-info {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .db-url-display {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 768px) {
    .job-card {
        width: 100%;
        align-items: stretch;
        gap: 12px;
    }

    .db-url-display {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Button Variants */
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.1rem;
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Advanced Preview Section */
.advanced-preview-section {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    background: #fafafa;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.preview-stats {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #6b7280;
}

.preview-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    min-height: 32px;
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 12px;
}

.table-scroll-container {
    max-height: 300px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: 12px;
}

.card-footer-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.upload-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 8px;
}

/* File Stats */
.file-stats {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #6b7280;
}

.file-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Schema Display */
.schema-display {
    margin-top: 20px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.schema-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.schema-header h4 {
    font-size: 1.2rem;
    color: #1f2937;
    margin: 0;
}

.schema-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #fee2e2;
    color: #991b1b;
}

.schema-badge.loaded {
    background: #d1fae5;
    color: #065f46;
}

.info-box.primary {
    border-left: 4px solid #667eea;
}

.attributes-list {
    margin-top: 15px;
}

.attributes-list label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #374151;
}

/* Mapping Section */
.mapping-info {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 10px;
}

.mapping-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mapping-validation {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
}

.validation-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #92400e;
}

.validation-status.valid {
    background: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}

/* Preview Tabs */
.preview-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

.preview-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.preview-tab:hover {
    background: #f3f4f6;
    color: #374151;
}

.preview-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.preview-panel {
    display: none;
}

.preview-panel.active {
    display: block;
}

.preview-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.preview-stats-bar {
    display: flex;
    gap: 20px;
    align-items: center;
}

.match-badge {
    padding: 6px 12px;
    border-radius: 20px;
    background: #d1fae5;
    color: #065f46;
    font-weight: 600;
}

.preview-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.preview-table-container {
    max-height: 400px;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.preview-actions-footer {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

/* Job Search */
.job-filters {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    min-height: 40px;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* Job Stats */
.job-stats-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f9fafb;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.stat-label {
    font-size: 0.85rem;
    color: #6b7280;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .status-dot {
        animation: none !important;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1180px;
    }

    .card {
        padding: 32px;
    }

    .card-title {
        font-size: 1.4rem;
    }
}

@media (hover: none) {
    .card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }
}

@media (max-width: 900px) {
    body {
        padding: 14px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .status-badge {
        padding: 10px 14px;
    }

    .api-selector {
        flex-wrap: wrap;
        justify-content: center;
    }

    .api-box {
        padding: 8px 18px;
        min-width: 56px;
    }

    .card {
        border-radius: 16px;
        padding: 20px;
    }

    input[type="text"],
    input[type="url"],
    textarea {
        font-size: 0.95rem;
    }

    .preview-table {
        font-size: 0.8rem;
    }
}

@media (max-width: 640px) {
    .header {
        margin-bottom: 18px;
    }

    .header h1 {
        font-size: 1.6rem;
        line-height: 1.15;
    }

    .status-badge {
        width: 100%;
        justify-content: center;
    }

    .api-selector {
        width: 100%;
        padding: 10px 12px;
        gap: 10px;
    }

    .source-toggler {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .source-options {
        flex-wrap: wrap;
    }

    .source-btn {
        flex: 1 1 120px;
        padding: 12px 14px;
    }

    .preview-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .preview-stats-bar {
        justify-content: space-between;
        width: 100%;
        gap: 10px;
    }

    .preview-buttons {
        width: 100%;
    }

    .preview-buttons .btn {
        flex: 1 1 auto;
    }

    .query-results-container,
    .preview-table-container {
        border-radius: 12px;
    }

    .query-results-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .preview-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .job-stats-bar {
        gap: 12px;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .stat-item {
        flex: 1 1 45%;
    }
}