:root {
    --primary: #00f3ff;
    --secondary: #ff00ff;
    --bg-dark: #050b14;
    --panel-bg: rgba(15, 23, 42, 0.7);
    --text-main: #e2e8f0;
    --text-dim: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

/* Base Overrides */
body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

.mono { font-family: 'JetBrains Mono', monospace; }

/* Layout */
.library-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.library-sidebar {
    background: rgba(15, 23, 42, 0.9);
    border-right: 1px solid var(--border);
    padding: 20px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.sidebar-section { margin-bottom: 2rem; }
.sidebar-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Main Content */
.library-main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
    background: radial-gradient(circle at 50% 50%, #0f172a 0%, #020617 100%);
}

.library-header {
    height: 70px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
}

.library-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

/* View Modes */
.view-human { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.view-machine { display: none; background: #000; padding: 20px; font-family: 'JetBrains Mono', monospace; color: #0f0; border: 1px solid #333; }

/* Cards */
.intel-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.intel-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(0, 243, 255, 0.1);
}

.intel-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: var(--border);
    transition: background 0.3s;
}

.intel-card.type-DAILY_BRIEFING::before { background: var(--primary); }
.intel-card.type-NEWSLETTER::before { background: var(--warning); }
.intel-card.type-DEEP_DIVE::before { background: var(--secondary); }
.intel-card.type-MARKET_PULSE::before { background: var(--success); }

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    color: #fff;
}

.card-summary {
    font-size: 0.85rem;
    color: #cbd5e1;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 15px;
    margin-top: auto;
}

.sentiment-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    background: rgba(255,255,255,0.1);
}

/* Editor Styles */
.editor-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: 100%;
    gap: 20px;
}

.editor-meta {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 8px;
}

.editor-main {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.editor-toolbar {
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 10px;
    background: rgba(0,0,0,0.2);
}

.wysiwyg-area {
    flex: 1;
    padding: 30px;
    outline: none;
    color: #e2e8f0;
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    line-height: 1.6;
    overflow-y: auto;
}

.form-group { margin-bottom: 15px; }
.form-label { display: block; font-size: 0.75rem; color: var(--text-dim); margin-bottom: 5px; }
.form-input {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    padding: 8px;
    color: #fff;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}
.form-input:focus { border-color: var(--primary); outline: none; }

/* Utilities */
.btn-cyber {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 6px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-cyber:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 10px var(--primary);
}

.btn-cyber.secondary { border-color: var(--secondary); color: var(--secondary); }
.btn-cyber.secondary:hover { background: var(--secondary); box-shadow: 0 0 10px var(--secondary); }

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}
.toggle-input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 20px;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
.toggle-input:checked + .toggle-slider { background-color: var(--primary); }
.toggle-input:checked + .toggle-slider:before { transform: translateX(20px); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Terminal View Specifics */
.terminal-line { margin-bottom: 5px; }
.json-key { color: var(--primary); }
.json-string { color: #f59e0b; }
.json-number { color: #10b981; }
