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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a26;
    --accent-primary: #ff6b35;
    --accent-secondary: #ff8c5a;
    --accent-glow: rgba(255, 107, 53, 0.3);
    --text-primary: #f5f5f7;
    --text-secondary: #8b8b9e;
    --text-muted: #5a5a6e;
    --border-color: #2a2a3a;
    --success: #4ade80;
    --error: #f87171;
    --warning: #fbbf24;
    --info: #60a5fa;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255, 107, 53, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(255, 140, 90, 0.08), transparent),
        radial-gradient(ellipse 50% 30% at 20% 80%, rgba(255, 107, 53, 0.05), transparent);
    pointer-events: none;
    z-index: -1;
}

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

/* Header */
header {
    padding: 1rem 0 2rem;
    animation: fadeInDown 0.6s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.logo svg {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 140, 90, 0.1));
    border: 1px solid rgba(255, 107, 53, 0.3);
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-primary);
    margin-left: auto;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Step Sections */
.step-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    opacity: 0.5;
    pointer-events: none;
    transition: all 0.3s ease;
}

.step-section.active {
    opacity: 1;
    pointer-events: all;
    animation: fadeIn 0.5s ease-out;
}

.step-section.completed {
    opacity: 0.7;
    pointer-events: all;
}

.step-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.step-section.completed .step-number {
    background: var(--success);
}

.step-info h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.step-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Upload Area */
.upload-area {
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-glow), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-area:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.upload-area:hover::before {
    opacity: 1;
}

.upload-area.dragover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
    transform: scale(1.02);
    box-shadow: 0 0 40px var(--accent-glow);
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
}

.upload-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.upload-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.file-type-badge {
    display: inline-block;
    background: rgba(255, 107, 53, 0.15);
    color: var(--accent-primary);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(255, 107, 53, 0.3);
}

.file-badges {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.file-type-badge.json {
    background: rgba(250, 204, 21, 0.15);
    color: #facc15;
    border-color: rgba(250, 204, 21, 0.3);
}

.file-type-badge.xml {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

/* Data Upload Area */
.data-upload-area {
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.data-upload-area:hover {
    border-color: var(--info);
}

.data-upload-area.dragover {
    border-color: var(--info);
    background: rgba(96, 165, 250, 0.1);
}

.upload-content.small {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-icon.small {
    width: 50px;
    height: 50px;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--info), #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: none;
}

.upload-content.small .upload-text {
    font-size: 1rem;
    margin-bottom: 0;
}

/* Uploaded Data File */
.uploaded-data-file {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--info);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    animation: slideIn 0.4s ease-out;
}

.uploaded-data-file .file-icon.data {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--info), #3b82f6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.7rem;
    color: white;
}

/* Data Preview */
.data-preview {
    margin-top: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.data-preview h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.data-preview-content {
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    padding: 0.75rem;
    border-radius: 8px;
}

.data-preview-content::-webkit-scrollbar {
    width: 6px;
}

.data-preview-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.data-preview-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.data-item {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-color);
}

.data-item:last-child {
    border-bottom: none;
}

.data-key {
    color: var(--info);
    font-weight: 500;
}

.data-value {
    color: var(--text-secondary);
    text-align: right;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Uploaded File */
.uploaded-file {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--success);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    animation: slideIn 0.4s ease-out;
}

.uploaded-file .file-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.uploaded-file .file-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.file-info {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
}

/* Context Input */
.context-input {
    margin-bottom: 1.5rem;
}

.context-input textarea {
    width: 100%;
    min-height: 120px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s ease;
}

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

.context-input textarea::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

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

.btn-secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    background: var(--bg-secondary);
}

/* Analysis Summary */
.analysis-summary {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.summary-icon {
    width: 40px;
    height: 40px;
    background: var(--info);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.summary-icon svg {
    color: white;
}

.analysis-summary p {
    color: var(--text-primary);
    line-height: 1.5;
    padding-top: 0.5rem;
}

/* Fields Container */
.fields-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 900px) {
    .fields-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .fields-container {
        grid-template-columns: 1fr;
    }
}

.field-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s ease;
    animation: fadeInUp 0.4s ease-out;
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

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

.field-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.field-name {
    font-weight: 600;
    font-size: 0.9rem;
    word-break: break-word;
    flex: 1;
    min-width: 0;
}

.field-type {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    background: rgba(255, 107, 53, 0.15);
    color: var(--accent-primary);
    flex-shrink: 0;
}

.import-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 50px;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
    margin-left: 0.5rem;
    font-weight: 500;
    vertical-align: middle;
}

.field-description {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.field-format {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.field-input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    margin-top: auto;
}

.field-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-primary);
}

.field-input::placeholder {
    color: var(--text-muted);
}

.field-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
}

.field-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.no-fields {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.no-fields svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-fields p {
    font-size: 1rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

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

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Notification */
.notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1001;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.notification.success {
    border-color: var(--success);
}

.notification.error {
    border-color: var(--error);
}

.notification.warning {
    border-color: var(--warning);
}

.notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification.success .notification-icon {
    background: var(--success);
}

.notification.error .notification-icon {
    background: var(--error);
}

.notification.warning .notification-icon {
    background: var(--warning);
}

.notification-text {
    font-weight: 500;
}

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

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

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

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 var(--accent-glow);
    }
    50% {
        box-shadow: 0 0 0 15px transparent;
    }
}

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

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

    .logo {
        font-size: 1.25rem;
        flex-wrap: wrap;
    }

    .ai-badge {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .step-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .upload-area {
        padding: 2rem 1.5rem;
    }

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

    .upload-icon svg {
        width: 26px;
        height: 26px;
    }

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

    .action-buttons button {
        width: 100%;
    }
}
