@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-void: #060814;
    --bg-panel: rgba(10, 15, 30, 0.55);
    --bg-panel-solid: #0d1222;
    --border-glow: rgba(0, 210, 255, 0.15);
    --border-light: rgba(255, 255, 255, 0.05);
    
    --neon-green: #00e6b8;
    --neon-green-glow: rgba(0, 230, 184, 0.25);
    --neon-pink: #ff0077;
    --neon-pink-glow: rgba(255, 0, 119, 0.25);
    --neon-cyan: #00ccff;
    --neon-cyan-glow: rgba(0, 204, 255, 0.25);
    --neon-gold: #ffb300;
    --neon-gold-glow: rgba(255, 179, 0, 0.25);
    
    --text-primary: #f0f4f8;
    --text-secondary: #8fa0b5;
    --text-muted: #53647a;
    
    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    background-color: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 204, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 0, 119, 0.04) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(10, 15, 30, 0.2) 0%, transparent 100%);
    background-attachment: fixed;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(6, 8, 20, 0.5);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 204, 255, 0.2);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 204, 255, 0.4);
}

/* Glassmorphism Panel base */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    border-color: rgba(0, 204, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 204, 255, 0.05);
}

/* Layout Wrapper */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Sidebar navigation */
.sidebar {
    width: 250px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-light);
    background: rgba(6, 8, 20, 0.8);
    backdrop-filter: blur(20px);
    z-index: 100;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
}

.brand-icon {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 8px var(--neon-cyan));
    animation: rotateSlow 20s linear infinite;
}

.brand-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(to right, #fff, var(--neon-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    transition: var(--transition-smooth);
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
    background: rgba(0, 204, 255, 0.08);
    border-color: rgba(0, 204, 255, 0.15);
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.2);
}

.nav-item.active svg {
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 4px var(--neon-cyan));
}

/* Heartbeat Indicator in Sidebar Bottom */
.sidebar-bottom {
    padding: 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.heartbeat-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-light);
}

.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: inherit;
    animation: pingDot 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.heartbeat-info {
    display: flex;
    flex-direction: column;
}

.heartbeat-title {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.heartbeat-status {
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--neon-green);
}

/* Main Workspace */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header ticker tape */
.header-bar {
    height: 60px;
    border-bottom: 1px solid var(--border-light);
    background: rgba(10, 15, 30, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 90;
    flex-shrink: 0;
}

.ticker-tape {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-grow: 1;
    padding-right: 24px;
}

.ticker-tape::-webkit-scrollbar {
    display: none;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 13px;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
}

.ticker-symbol {
    font-weight: 700;
}

.ticker-price {
    color: var(--text-primary);
}

.ticker-change {
    font-weight: 500;
}

.ticker-change.up {
    color: var(--neon-green);
}

.ticker-change.down {
    color: var(--neon-pink);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(0, 204, 255, 0.08);
    border: 1px solid rgba(0, 204, 255, 0.15);
    font-family: var(--font-mono);
}

.status-badge i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--neon-cyan);
    box-shadow: 0 0 6px var(--neon-cyan);
}

/* Dashboard Panel Grid Router */
.panel-container {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    display: none; /* Controlled via active class */
    height: calc(100vh - 60px);
}

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

/* Dashboard Grid Layout (Terminal View) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto;
    gap: 20px;
}

/* Card components sizes */
.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-3 { grid-column: span 3; }

.grid-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title svg {
    color: var(--neon-cyan);
}

.card-actions {
    display: flex;
    gap: 8px;
}

/* Toggles & Tabs inside cards */
.pill-tab {
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.pill-tab:hover, .pill-tab.active {
    background: rgba(0, 204, 255, 0.1);
    border-color: var(--neon-cyan);
    color: var(--text-primary);
}

/* Chart Canvas container */
.chart-wrapper {
    position: relative;
    flex-grow: 1;
    min-height: 200px;
    width: 100%;
}

/* Live Options Flow / Whale log styling */
.log-container {
    flex-grow: 1;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    padding-right: 6px;
}

.log-item {
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.01);
    border-left: 3px solid var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideInLeft 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.log-item.bullish {
    border-left-color: var(--neon-green);
    background: rgba(0, 230, 184, 0.03);
}

.log-item.bearish {
    border-left-color: var(--neon-pink);
    background: rgba(255, 0, 119, 0.03);
}

.log-item.gold {
    border-left-color: var(--neon-gold);
    background: rgba(255, 179, 0, 0.03);
}

.log-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-time {
    color: var(--text-muted);
}

.log-tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
}

.log-tag.bull { background: var(--neon-green); color: #000; }
.log-tag.bear { background: var(--neon-pink); color: #fff; }
.log-tag.insider { background: var(--neon-gold); color: #000; }

.log-details {
    color: var(--text-primary);
}

.log-value {
    font-weight: 700;
}

/* AI Consensus Agent layout */
.agents-voting-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.agent-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
}

.agent-identity {
    display: flex;
    flex-direction: column;
}

.agent-name {
    font-weight: 600;
    font-size: 14px;
}

.agent-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

.agent-vote-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.agent-vote-badge.buy {
    background: rgba(0, 230, 184, 0.1);
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    box-shadow: 0 0 8px rgba(0, 230, 184, 0.2);
}

.agent-vote-badge.sell {
    background: rgba(255, 0, 119, 0.1);
    border: 1px solid var(--neon-pink);
    color: var(--neon-pink);
    box-shadow: 0 0 8px rgba(255, 0, 119, 0.2);
}

.agent-vote-badge.hold {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
}

.consensus-verdict-box {
    padding: 16px;
    border-radius: 8px;
    background: rgba(0, 204, 255, 0.03);
    border: 1px dashed var(--neon-cyan);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    text-align: center;
}

.consensus-title {
    font-size: 11px;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.consensus-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

/* Chat Co-Pilot styles */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 400px;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    max-width: 85%;
    line-height: 1.4;
    font-size: 14px;
}

.message.user {
    align-self: flex-end;
    background: rgba(0, 204, 255, 0.12);
    border: 1px solid rgba(0, 204, 255, 0.2);
    color: var(--text-primary);
}

.message.ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}

.message pre {
    background: #090d16;
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-input-row {
    display: flex;
    gap: 8px;
}

.chat-input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: var(--transition-smooth);
}

.chat-input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 204, 255, 0.15);
}

.chat-send-btn {
    background: var(--neon-cyan);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.chat-send-btn:hover {
    background: #00b3ff;
    box-shadow: 0 0 12px rgba(0, 204, 255, 0.4);
}

.chat-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.preset-chip {
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.preset-chip:hover {
    border-color: var(--neon-cyan);
    color: var(--text-primary);
    background: rgba(0, 204, 255, 0.05);
}

/* Order Execution proposals cards */
.proposal-box {
    margin-top: 10px;
    border: 1px solid rgba(0, 230, 184, 0.2);
    background: rgba(0, 230, 184, 0.02);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.proposal-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 13px;
}

.proposal-btn-row {
    display: flex;
    gap: 10px;
}

.proposal-btn {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: center;
}

.proposal-btn.approve {
    background: var(--neon-green);
    color: #000;
}

.proposal-btn.approve:hover {
    box-shadow: 0 0 12px rgba(0, 230, 184, 0.4);
}

.proposal-btn.reject {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.proposal-btn.reject:hover {
    background: rgba(255, 0, 119, 0.1);
    color: var(--neon-pink);
    border-color: var(--neon-pink);
}

/* Security Vault Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

.form-group.col-span-2 {
    grid-column: span 2;
}

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

input[type="text"], input[type="password"], input[type="number"], select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    transition: var(--transition-smooth);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 204, 255, 0.15);
}

.btn-primary {
    background: var(--neon-cyan);
    color: #000;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: center;
}

.btn-primary:hover {
    box-shadow: 0 0 15px rgba(0, 204, 255, 0.3);
}

/* Grid parameters sliders */
.slider-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-family: var(--font-mono);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--neon-cyan);
    cursor: pointer;
    box-shadow: 0 0 6px var(--neon-cyan);
    transition: 0.1s;
}

/* Heatmap container styles */
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    margin-top: 10px;
}

.heatmap-cell {
    aspect-ratio: 1.5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
}

.heatmap-label {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Animations */
@keyframes rotateSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pingDot {
    0% { transform: scale(1); opacity: 0.8; }
    70% { transform: scale(2.5); opacity: 0; }
    100% { transform: scale(2.5); opacity: 0; }
}

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

@keyframes flashGreen {
    0% { box-shadow: inset 0 0 15px rgba(0, 230, 184, 0.2); }
    100% { box-shadow: none; }
}

@keyframes flashRed {
    0% { box-shadow: inset 0 0 15px rgba(255, 0, 119, 0.2); }
    100% { box-shadow: none; }
}

.flash-up {
    animation: flashGreen 0.8s ease-out;
}

.flash-down {
    animation: flashRed 0.8s ease-out;
}

/* Mobile responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .col-8, .col-4, .col-6, .col-3 {
        grid-column: span 12;
    }
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
    .nav-links {
        flex-direction: row;
        overflow-x: auto;
        padding: 10px;
    }
    .main-content {
        height: auto;
        overflow-y: visible;
    }
    .panel-container {
        height: auto;
        overflow-y: visible;
    }
}
