/* Zero-Retention Gate styling */
:root {
    --bg-primary: #0b0f19;
    --bg-surface: rgba(22, 30, 49, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --color-blue: #3b82f6;
    --color-blue-glow: rgba(59, 130, 246, 0.5);
    --color-green: #10b981;
    --color-green-glow: rgba(16, 185, 129, 0.5);
    --color-purple: #d946ef;
    --color-purple-glow: rgba(217, 70, 239, 0.5);
    
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Ambient glow and grid lines background */
.background-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
}

.ambient-glow {
    position: absolute;
    top: 20%;
    left: 30%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* Top Nav styling */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.logo {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.secure-badge {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge-icon {
    width: 14px;
    height: 14px;
}

/* Dashboard structure */
.dashboard {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dashboard-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.dashboard-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media(min-width: 1024px) {
    .main-content {
        grid-template-columns: 4.5fr 5.5fr;
    }
}

.panel {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.header-icon {
    width: 20px;
    height: 20px;
}

.text-primary { color: var(--color-blue); }
.text-success { color: var(--color-green); }
.text-muted { color: var(--text-muted); }

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.panel-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
}

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

.input-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Scenarios configuration styling */
.scenarios-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

@media(min-width: 640px) {
    .scenarios-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.scenario-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 1rem 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s ease;
}

.scenario-btn i {
    width: 18px;
    height: 18px;
    transition: transform 0.25s ease;
}

.scenario-btn span {
    font-size: 0.8rem;
    font-weight: 500;
}

.scenario-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.scenario-btn:hover i {
    transform: translateY(-2px);
}

.scenario-btn.active {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.1);
}

/* Text area styling */
.text-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    line-height: 1.5;
    outline: none;
    resize: none;
    transition: border-color 0.25s ease;
}

.text-input:focus {
    border-color: var(--color-blue);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.15);
}

/* Routing protocols checklist styling */
.routing-toggles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toggle-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
}

.toggle-icon {
    width: 16px;
    height: 16px;
    margin-right: 10px;
}

.toggle-item span:nth-of-type(1) {
    flex: 1;
    color: var(--text-secondary);
}

.toggle-status {
    font-weight: 600;
    color: var(--color-green);
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Big execution button styling */
.execute-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: var(--color-blue);
    border: none;
    border-radius: 8px;
    color: white;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.execute-btn i {
    width: 16px;
    height: 16px;
}

.execute-btn:hover {
    background: #2563eb;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.execute-btn:active {
    transform: scale(0.98);
}

.execute-btn:disabled {
    background: var(--text-muted);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    box-shadow: none;
}

/* Telemetry stat cards styling */
.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    transition: color 0.3s ease;
}

.stat-value.text-primary {
    color: var(--color-blue);
    text-shadow: 0 0 10px var(--color-blue-glow);
}

.stat-value.text-success {
    color: var(--color-green);
    text-shadow: 0 0 10px var(--color-green-glow);
}

/* Interactive flow visualizer */
.viz-container {
    height: 120px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 1.5rem;
    position: relative;
}

.viz-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100px;
    z-index: 2;
    transition: all 0.3s ease;
}

.viz-node span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
}

.node-icon {
    width: 38px;
    height: 38px;
    background: #1e293b;
    border: 1.5px solid var(--border-color);
    border-radius: 50%;
    padding: 8px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Active visualization states */
.viz-node.active span {
    color: var(--text-primary);
}

#node-client.active .node-icon {
    color: #60a5fa;
    border-color: var(--color-blue);
    box-shadow: 0 0 15px var(--color-blue-glow);
    background: rgba(59, 130, 246, 0.1);
}

#node-gate.active .node-icon {
    color: #34d399;
    border-color: var(--color-green);
    box-shadow: 0 0 15px var(--color-green-glow);
    background: rgba(16, 185, 129, 0.1);
}

#node-llm.active .node-icon {
    color: #f472b6;
    border-color: var(--color-purple);
    box-shadow: 0 0 15px var(--color-purple-glow);
    background: rgba(217, 70, 239, 0.1);
}

/* Connector wires and flowing packets styling */
.viz-connector {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    position: relative;
    margin: 0 -10px;
    z-index: 1;
}

.viz-connector.active {
    background: linear-gradient(90deg, var(--border-color) 0%, var(--color-blue) 50%, var(--border-color) 100%);
}

.data-packet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-blue);
    position: absolute;
    top: -3px;
    left: 0;
    opacity: 0;
    box-shadow: 0 0 8px var(--color-blue);
}

/* Running packet animations */
@keyframes flowForward {
    0% { left: 0; opacity: 1; }
    90% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

.flow-packet-1 {
    animation: flowForward 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.flow-packet-2 {
    animation: flowForward 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    background: var(--color-purple);
    box-shadow: 0 0 8px var(--color-purple-glow);
}

/* Logs and Terminal window */
.logs-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--color-green);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-green);
    animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.logs-window {
    background: #060911;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 14px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.6;
    height: 170px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.log-entry {
    color: var(--color-blue);
    opacity: 0;
    animation: fadeInLog 0.2s forwards ease;
}

.log-entry.system-msg {
    color: var(--text-muted);
}

.log-entry.success-msg {
    color: var(--color-green);
}

.log-entry.warn-msg {
    color: #fbbf24;
}

.log-entry .log-time {
    color: var(--text-muted);
    margin-right: 6px;
}

@keyframes fadeInLog {
    to { opacity: 1; }
}

/* Footer branding */
.app-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}
