:root {
    --bg-dark: #0a0e17;
    --bg-card: #111827;
    --bg-light: #1a2235;
    --accent: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text: #f1f5f9;
    --text-dim: #94a3b8;
    --text-muted: #64748b;
    --border: #1e293b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
    padding-top: 1rem;
}

.app-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 1rem);
    overflow: hidden;
    margin: 0 1rem;
    border-radius: 12px;
    overflow: hidden;
}

.top-header {
    height: 60px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-right {
    display: flex;
    gap: 1rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.top-header h1 {
    font-size: 1rem;
    font-weight: 700;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 0.75rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.stat-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.status-box .stat-num {
    font-size: 0.85rem;
}

.content-wrapper {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.sidebar {
    width: 180px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.stepper-vertical {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.vstep {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex: 1;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border);
}

.vstep:last-child {
    border-bottom: none;
}

.vstep:hover {
    background: var(--bg-light);
}

.vstep.active {
    background: var(--bg-light);
    border-left: 3px solid var(--accent);
}

.vstep.complete {
    border-left: 3px solid var(--success);
}

.vstep-num {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.vstep.active .vstep-num {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.vstep.complete .vstep-num {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.vstep-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dim);
}

.vstep.active .vstep-title {
    color: var(--accent);
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wizard-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wizard-page {
    display: none;
    flex-direction: column;
    height: 100%;
    padding: 2rem;
    overflow: hidden;
}

.wizard-page.active {
    display: flex;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.scroll-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 1.5rem;
}

.scroll-area::-webkit-scrollbar {
    width: 8px;
}

.scroll-area::-webkit-scrollbar-track {
    background: var(--bg-card);
}

.scroll-area::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.config-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.config-box {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.config-box h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.input-mini {
    margin-bottom: 0.75rem;
}

.input-mini:last-child {
    margin-bottom: 0;
}

.input-mini label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-dim);
}

.input-mini input, .input-mini select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.input-mini input:focus, .input-mini select:focus {
    outline: none;
    border-color: var(--accent);
}

.layer-controls {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

.layer-controls .input-mini {
    flex: 1;
    margin-bottom: 0;
}

.layer-buttons {
    display: flex;
    gap: 0.25rem;
}

.btn-layer {
    padding: 0.5rem 0.75rem;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-layer:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-layer:active {
    transform: translateY(0);
}

.neurons-scroll {
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.neurons-scroll::-webkit-scrollbar {
    width: 6px;
}

.neurons-scroll::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
}

.neurons-scroll::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

.neurons-scroll::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

.params-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.param-col {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.param-col h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.checkbox-scroll {
    max-height: 280px;
    overflow-y: auto;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.checkbox-scroll::-webkit-scrollbar {
    width: 6px;
}

.checkbox-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.check-item:last-child {
    border-bottom: none;
}

.check-item:hover {
    background: var(--bg-light);
}

.check-item input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent);
}

.check-item span {
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-dim);
}

.check-item input:checked + span {
    color: var(--text);
    font-weight: 600;
}

.btn-action {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border: none;
    border-radius: 10px;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    padding: 0.65rem 1.5rem;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid var(--accent);
    border-radius: 10px;
    color: var(--accent);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.btn-small {
    padding: 0.5rem 1rem;
    background: rgba(100, 116, 139, 0.3);
    border: 1px solid rgba(100, 116, 139, 0.5);
    border-radius: 8px;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: auto;
    display: inline-block;
}

.btn-small:hover {
    background: rgba(100, 116, 139, 0.4);
    border-color: rgba(100, 116, 139, 0.7);
    color: var(--text);
}

.btn-predict {
    padding: 0.65rem 1.5rem;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border: 2px solid var(--accent);
    border-radius: 10px;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-predict:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.top-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.button-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.button-row .btn-action {
    flex: 1;
    min-width: 150px;
}

.btn-tiny {
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
}

.btn-tiny:hover {
    color: var(--text);
    border-color: var(--accent);
}

.progress-card {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

#progress-percentage {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--success);
}

.progress-track {
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--accent));
    width: 0%;
    transition: width 0.3s;
}

.logs-card {
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.logs-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 600;
}

.logs-scroll {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
}

.logs-scroll::-webkit-scrollbar {
    width: 6px;
}

.logs-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.log-line {
    padding: 0.25rem 0;
    color: var(--text-dim);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.log-line.success { color: var(--success); font-weight: 600; }
.log-line.error { color: var(--danger); font-weight: 600; }
.log-line.warning { color: var(--warning); }
.log-line.step { 
    color: var(--accent); 
    font-weight: 700; 
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    padding-top: 0.5rem;
}

.empty-box {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-ico {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-box p {
    color: var(--text-muted);
}

.architecture-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.layer-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-dark);
    border-radius: 8px;
    border: 2px solid var(--border);
}

.layer-node.input { border-color: var(--accent); }
.layer-node.hidden { border-color: var(--warning); }
.layer-node.output { border-color: var(--success); }

.layer-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 700;
}

.layer-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.layer-arrow {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.metric-card {
    background: var(--bg-card);
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.metric-card h4 {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-dim);
}

.metric-item {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
}

.metric-item:last-child {
    border-bottom: none;
}

.metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.metric-value.good { color: var(--success); }
.metric-value.warning { color: var(--warning); }
.metric-value.bad { color: var(--danger); }

.section-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 1.25rem;
}

.section-card > h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text);
    font-weight: 600;
}

.plots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1rem;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.table-wrapper thead {
    background: var(--bg-dark);
}

.table-wrapper th {
    padding: 0.6rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    color: var(--text-dim);
}

.table-wrapper td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
}

.table-wrapper tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

#nn-canvas {
    display: block;
    margin: 0 auto;
    background: var(--bg-dark);
    border-radius: 8px;
    border: 1px solid var(--border);
}


.plot-wrapper {
    background: var(--bg-card);
    padding: 0.75rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.plot-wrapper h4 {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--text-dim);
}

.plot-wrapper img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
}

.predict-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-top: 0.75rem;
    position: relative;
    z-index: 1;
}

.predict-card h3 {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.predict-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.predict-input {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.predict-input label {
    font-size: 0.8rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.predict-input input {
    padding: 0.5rem 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.predict-input input:focus {
    outline: none;
    border-color: var(--accent);
}

.predict-out {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-darker);
    border-radius: 8px;
    border: 1px solid var(--accent);
}

.hidden {
    display: none !important;
}

.prediction-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.prediction-item:last-child {
    border-bottom: none;
}

.predict-input label {
    display: block;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    color: var(--text-dim);
}

.predict-input input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
}

.predict-out {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-dark);
    border-radius: 8px;
    border: 1px solid var(--success);
}

.predict-out.hidden {
    display: none;
}

.prediction-item {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
}

.prediction-item:last-child {
    border-bottom: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    margin-bottom: 1rem;
}

th {
    background: var(--bg-dark);
    padding: 0.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 1024px) {
    .config-row, .params-row, .predict-row {
        grid-template-columns: 1fr;
    }
}
