/* Custom CSS Stylesheet for LoanShield Premium UI */
:root {
    --primary: #A3E635;
    --secondary: #BEF264;
    --tertiary: #84CC16;
    --neutral: #0A0A0A;
    --bg-dark: #050505;
    --glass-bg: rgba(10, 10, 10, 0.75);
    --glass-border: rgba(255, 255, 255, 0.1);
    --neon-glow: 0 0 15px rgba(163, 230, 53, 0.4);
    --neon-glow-strong: 0 0 25px rgba(163, 230, 53, 0.8);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-round: 9999px;
    
    --transition-fast: 150ms ease;
    --transition-normal: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Globals */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, .logo-title, .panel-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
}

/* Three.js Canvas Backdrop */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Glass Panel Base */
.glassy-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: rgba(0, 0, 0, 0.5) 0px 25px 50px -12px, 
                rgba(163, 230, 53, 0.05) 0px 0px 0px 1px inset;
    padding: 24px;
    transition: var(--transition-normal);
}

.glassy-panel:hover {
    border-color: rgba(163, 230, 53, 0.25);
    box-shadow: rgba(0, 0, 0, 0.6) 0px 25px 50px -12px, 
                rgba(163, 230, 53, 0.15) 0px 0px 0px 1px inset;
}

/* Layout Frame */
.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: rgba(10, 10, 10, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    backdrop-filter: blur(4px);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(163, 230, 53, 0.6));
}

.logo-title {
    font-size: 24px;
    letter-spacing: 0.05em;
    color: #FFFFFF;
}

.logo-title span {
    color: var(--primary);
    font-weight: 700;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--primary);
    background: rgba(163, 230, 53, 0.1);
    padding: 6px 12px;
    border-radius: var(--radius-round);
    border: 1px solid rgba(163, 230, 53, 0.2);
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

/* Benchmark Grid */
.benchmark-section {
    background: rgba(10, 10, 10, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
}

.section-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.benchmark-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.benchmark-card {
    flex: 0 0 auto;
    background: rgba(20, 20, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
}

.benchmark-card:hover {
    border-color: var(--primary);
    background: rgba(163, 230, 53, 0.05);
    transform: translateY(-2px);
}

.benchmark-card.active {
    border-color: var(--primary);
    background: rgba(163, 230, 53, 0.12);
    box-shadow: var(--neon-glow);
}

.benchmark-title {
    font-size: 13px;
    font-weight: 600;
    color: #FFFFFF;
}

.benchmark-desc {
    font-size: 11px;
    color: #A3A3A3;
}

.benchmark-badge {
    align-self: flex-start;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: var(--radius-round);
    font-weight: 600;
    text-transform: uppercase;
}

.badge-prime { background: rgba(163, 230, 53, 0.15); color: var(--primary); border: 1px solid rgba(163, 230, 53, 0.3); }
.badge-thin { background: rgba(234, 179, 8, 0.15); color: #EAB308; border: 1px solid rgba(234, 179, 8, 0.3); }
.badge-reject { background: rgba(239, 68, 68, 0.15); color: #EF4444; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Main Columns */
.main-content {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.form-section {
    flex: 1 1 480px;
    min-width: 480px;
}

.visualizer-section {
    flex: 1 1 1068px;
    min-width: 1068px;
    display: flex;
    flex-direction: column;
    overflow-x: auto;
}

.panel-title {
    font-size: 20px;
    color: #FFFFFF;
    margin-bottom: 24px;
    border-left: 3px solid var(--primary);
    padding-left: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form Styles */
.app-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: #A3A3A3;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.form-group input, 
.form-group select {
    background: rgba(15, 15, 15, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: #FFFFFF;
    padding: 10px 14px;
    font-size: 14px;
    transition: var(--transition-fast);
    outline: none;
    width: 100%;
}

.form-group input:focus, 
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(163, 230, 53, 0.2);
    background: rgba(20, 20, 20, 0.95);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 12px;
}

.btn {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 14px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    outline: none;
}

.btn-primary {
    background-color: var(--primary);
    border: 1px solid var(--primary);
    color: var(--neutral);
    box-shadow: var(--neon-glow);
}

.btn-primary:hover {
    background-color: var(--secondary);
    border-color: var(--secondary);
    box-shadow: var(--neon-glow-strong);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    border-color: #FFFFFF;
    background: rgba(255, 255, 255, 0.05);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Workflow Visualizer Viewport */
.graph-viewport {
    position: relative;
    width: 100%;
    min-width: 1020px;
    height: 480px;
    background: rgba(5, 5, 5, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.graph-connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.connection-line {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 2;
    transition: var(--transition-normal);
}

.connection-line.active {
    stroke: url(#neon-grad);
    stroke-width: 3;
    stroke-dasharray: 8 4;
    animation: dash 30s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -1000;
    }
}

/* Graph Nodes */
.graph-node {
    position: absolute;
    width: 145px;
    height: 65px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    cursor: default;
    box-shadow: rgba(0, 0, 0, 0.4) 0px 8px 24px;
    transition: var(--transition-normal);
    padding: 6px 12px;
}

.graph-node:hover {
    transform: scale(1.03) translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

.node-icon {
    font-size: 16px;
    color: #A3A3A3;
    margin-bottom: 4px;
    transition: var(--transition-fast);
}

.node-label {
    font-size: 9px;
    font-weight: 600;
    text-align: center;
    color: #FFFFFF;
}

.node-status {
    font-size: 7px;
    color: #A3A3A3;
    margin-top: 2px;
}

/* Node Specific Layout Positions */
.node-start {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 0;
}

.node-small {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    padding: 0;
}

/* Active and Running states */
.graph-node.running {
    border-color: var(--primary);
    box-shadow: var(--neon-glow);
    animation: nodePulse 2s infinite ease-in-out;
}

.graph-node.running .node-icon {
    color: var(--primary);
}

.graph-node.completed {
    border-color: var(--primary);
    background: rgba(163, 230, 53, 0.08);
}

.graph-node.completed .node-icon {
    color: var(--primary);
}

.graph-node.failed {
    border-color: #EF4444;
    background: rgba(239, 68, 68, 0.08);
    animation: shake 0.5s ease-in-out;
}

.graph-node.failed .node-icon {
    color: #EF4444;
}

.graph-node.paused {
    border-color: #F59E0B;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
    animation: nodeAlertPulse 1.5s infinite ease-in-out;
}

.graph-node.paused .node-icon {
    color: #F59E0B;
}

@keyframes nodePulse {
    0%, 100% { box-shadow: 0 0 15px rgba(163, 230, 53, 0.4); }
    50% { box-shadow: 0 0 25px rgba(163, 230, 53, 0.8); }
}

@keyframes nodeAlertPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.8); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Bottom Results & Logs Area */
.results-and-logs {
    display: flex;
    gap: 24px;
}

.flex-2 { flex: 2; }
.flex-1 { flex: 1; }

.panel-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: #A3A3A3;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* TerminalLogs */
.terminal-body {
    background: #050505;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #00FF00;
    height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.log-line {
    white-space: pre-wrap;
    line-height: 1.5;
}

.log-line.warn { color: #FFA500; }
.log-line.error { color: #FF0000; }
.log-line.info { color: #00FF00; }

/* Metrics Panel */
.metrics-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    height: 180px;
    justify-content: center;
}

.score-circle-container {
    position: relative;
    width: 100px;
    height: 100px;
}

.score-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.score-ring.active {
    border-color: var(--primary);
    box-shadow: var(--neon-glow);
}

#metric-score {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: #FFFFFF;
}

.score-label {
    font-size: 8px;
    color: #A3A3A3;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.verdict-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.verdict-title {
    font-size: 10px;
    color: #A3A3A3;
    text-transform: uppercase;
}

.verdict-badge {
    padding: 6px 16px;
    border-radius: var(--radius-round);
    font-size: 12px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.05em;
}

.verdict-badge.neutral { background: rgba(255, 255, 255, 0.05); color: #A3A3A3; border: 1px solid rgba(255, 255, 255, 0.1); }
.verdict-badge.approve { background: rgba(163, 230, 53, 0.15); color: var(--primary); border: 1px solid var(--primary); box-shadow: var(--neon-glow); }
.verdict-badge.review { background: rgba(245, 158, 11, 0.15); color: #F59E0B; border: 1px solid #F59E0B; }
.verdict-badge.reject { background: rgba(239, 68, 68, 0.15); color: #EF4444; border: 1px solid #EF4444; }

/* HITL Action Overrides */
.hitl-panel {
    display: flex;
    flex-direction: column;
}

.hitl-controls-body {
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(10, 10, 10, 0.4);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 16px;
}

.hitl-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.2);
    text-align: center;
    font-size: 12px;
}

.hitl-empty-state i {
    font-size: 24px;
}

.hitl-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.hitl-card p {
    font-size: 12px;
    color: #FFFFFF;
    line-height: 1.4;
}

.hitl-options {
    display: flex;
    gap: 8px;
}

.hitl-btn {
    flex: 1;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    transition: var(--transition-fast);
}

.hitl-btn.btn-approve {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: var(--neutral);
}

.hitl-btn.btn-approve:hover {
    box-shadow: var(--neon-glow);
}

.hitl-btn.btn-reject {
    background: transparent;
    border: 1px solid #EF4444;
    color: #EF4444;
}

.hitl-btn.btn-reject:hover {
    background: rgba(239, 68, 68, 0.08);
}

/* Regulatory ECOA Notice */
.ecoa-section {
    margin-top: 12px;
}

.ecoa-letter-content {
    background: rgba(5, 5, 5, 0.85);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: 24px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #E5E5E5;
    max-height: 400px;
    overflow-y: auto;
}

.ecoa-letter-content h3 {
    margin-bottom: 12px;
    color: #FFFFFF;
}

/* Loading animations */
.loading-pulse {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--primary);
    margin-left: 4px;
    animation: loading-pulse 1s infinite alternate;
}

@keyframes loading-pulse {
    from { opacity: 0.2; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1.2); }
}

/* Modal Overlay & Card Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}
.modal-content {
    background: #0A0A0A;
    border: 1px solid rgba(163, 230, 53, 0.25);
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 0 40px rgba(163, 230, 53, 0.2);
}
.modal-content p {
    color: #A3A3A3;
    font-size: 13px;
    line-height: 1.5;
    margin: 12px 0 20px 0;
}
.modal-content input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

