:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --dark-bg: #05050a;
    --darker-bg: #0d0d16;
    --card-bg: rgba(17, 17, 27, 0.92);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #c7c9d9;
    --text-muted: #9ca3af;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(circle at bottom, rgba(6, 182, 212, 0.12), transparent),
        var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
}

.wizard-shell {
    display: flex;
    min-height: 100vh;
}

.wizard-sidebar {
    width: 320px;
    background: rgba(13, 13, 25, 0.9);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.wizard-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.wizard-brand img {
    height: 80px;
    width: auto;
}

.wizard-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nav-link {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-color: transparent;
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.25);
}

.nav-link:hover:not(.active) {
    border-color: rgba(255, 255, 255, 0.25);
    color: white;
}

.nav-link--solve {
    margin-top: 0.25rem;
    border-color: rgba(16, 185, 129, 0.6);
    color: white;
    font-weight: 700;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.45);
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.file-ops h4 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.file-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ghost-btn:hover {
    border-color: var(--accent-color);
    color: white;
}

.file-btn {
    border-radius: 12px;
    border-width: 1px;
    border-style: solid;
    font-weight: 600;
}

.file-btn--upload {
    border-color: rgba(99, 102, 241, 0.6);
}

.file-btn--download {
    border-color: rgba(14, 165, 233, 0.6);
}

.file-btn--save {
    border-color: rgba(16, 185, 129, 0.6);
}

.file-btn--upload:hover {
    border-color: rgba(99, 102, 241, 1);
}

.file-btn--download:hover {
    border-color: rgba(14, 165, 233, 1);
}

.file-btn--save:hover {
    border-color: rgba(16, 185, 129, 1);
}

.file-name-label {
    display: block;
    margin: 1rem 0 0.35rem;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.file-ops input[type="text"] {
    width: 100%;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
}

.file-ops input[type="text"]:focus {
    border-color: var(--accent-color);
    outline: none;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .switch {
    position: relative;
    width: 46px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    transition: background 0.3s ease;
}

.toggle-switch .switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    transition: transform 0.3s ease;
}

.toggle-switch input:checked + .switch {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

.toggle-switch input:checked + .switch::after {
    transform: translateX(22px);
}

.toggle-switch .switch-label {
    letter-spacing: 0.5px;
}
.progress-stack {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.progress-value {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

.wizard-main {
    flex: 1;
    padding: 3rem;
    overflow-y: auto;
}

.wizard-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent-color);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.panel-header h1 {
    margin: 0;
    font-size: 2.4rem;
}

.panel-subtitle {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    max-width: 640px;
}

.panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
}

.primary-btn,
.secondary-btn {
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.35);
}

.secondary-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.primary-btn:hover,
.secondary-btn:hover {
    transform: translateY(-2px);
}

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

.summary-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

.summary-card span {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.summary-card h3 {
    margin: 0.5rem 0 0;
    font-size: 1.8rem;
}

.muted-text {
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.preview-block {
    background: rgba(17, 17, 27, 0.85);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 1.5rem;
}

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

.code-block {
    margin: 0;
    background: rgba(5, 5, 12, 0.85);
    border-radius: 14px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    max-height: 400px;
    overflow: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.code-block.small {
    max-height: 260px;
}

#jsonPreview {
    background: #ffffff;
    color: #111;
    border-color: #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.solution-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.status-pill {
    align-self: flex-start;
    border-radius: 999px;
    padding: 0.45rem 1.25rem;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.45);
}

.split-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}

.data-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.data-list li {
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.data-list.compact li {
    padding: 0.3rem 0;
}

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

.insights-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.solution-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.loading-modal .modal-content {
    background: rgba(13, 13, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
}

.modal-content {
    background: rgba(17, 17, 27, 0.95);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.modal-header,
.modal-footer {
    border-color: rgba(255, 255, 255, 0.08);
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.25rem;
}

.modal-header .btn-close,
.btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat !important;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    opacity: 1 !important;
    padding: 0.5rem;
    filter: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-header .btn-close:hover,
.btn-close:hover {
    background-color: rgba(239, 68, 68, 0.3) !important;
    border-color: rgba(239, 68, 68, 0.6) !important;
}

/* Modal form controls for dark theme */
.modal .form-control,
.modal .form-select {
    background-color: rgba(5, 5, 12, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.modal .form-control:focus,
.modal .form-select:focus {
    background-color: rgba(10, 10, 20, 0.9);
    border-color: var(--accent-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(6, 182, 212, 0.25);
}

.modal .form-control::placeholder {
    color: var(--text-muted);
}

.modal .form-label,
.modal label {
    color: var(--text-secondary);
}

/* Table input styling in modals */
.modal .table input,
.modal .table select {
    background-color: rgba(5, 5, 12, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
}

.modal .table input:focus,
.modal .table select:focus {
    background-color: rgba(10, 10, 20, 0.9);
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 0.15rem rgba(6, 182, 212, 0.25);
}

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

.step-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.step {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border-radius: 4px;
    margin: 0 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
}

.step.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
    border: 2px solid var(--primary-color);
}

.step.completed {
    background-color: var(--success-color);
    color: white;
}

.step::after {
    content: '';
    position: absolute;
    right: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.step.active::after {
    border-left-color: var(--primary-color);
}

.step.completed::after {
    border-left-color: var(--success-color);
}

.step:last-child::after {
    display: none;
}

.table {
    margin-bottom: 1rem;
    border-radius: 18px;
    overflow: hidden;
    color: var(--text-primary);
}

.table th {
    font-weight: 600;
    background-color: rgba(99, 102, 241, 0.3) !important;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(6, 182, 212, 0.3)) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

/* Override Bootstrap table-light for dark theme */
.table thead.table-light,
.table thead.table-light th,
.modal .table thead,
.modal .table thead th,
.table thead th,
thead th {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(6, 182, 212, 0.3)) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.table th,
.table td {
    padding: 0.85rem 0.9rem;
    border: none;
    font-size: 0.9rem;
}

.table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02);
}

@media (max-width: 1024px) {
    .wizard-shell {
        flex-direction: column;
    }

    .wizard-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .wizard-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .wizard-main {
        padding: 2rem;
    }
}

@media (max-width: 720px) {
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .wizard-sidebar {
        flex-direction: column;
    }
}



