/* LexAlert Platform Styles */

:root {
    --alert-bg: #050505;
    --alert-sidebar: #0f0f10;
    --alert-panel: #141416;
    --alert-border: rgba(255, 255, 255, 0.08);
    --alert-accent: #00ff9d; /* Neon Green for Good */
    --alert-danger: #ff4d4d; /* Red for Drift */
    --alert-warning: #ffb86c; /* Amber for Warning */
    --alert-text: #f5f5f7;
    --alert-text-dim: #86868b;
    --font-mono: 'Space Mono', monospace;
}

body {
    background-color: var(--alert-bg);
}

/* Hide standard elements for app feel */
.lexalert-app nav, .lexalert-app footer {
    /* We might keep Nav for context, but style it to blend */
    background: var(--alert-bg);
    border-bottom: 1px solid var(--alert-border);
}

.lexalert-wrapper {
    padding-top: 80px;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- Sidebar --- */
.la-sidebar {
    width: 260px;
    background: var(--alert-sidebar);
    border-right: 1px solid var(--alert-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
}

.la-logo-area {
    margin-bottom: 2rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--alert-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.la-logo-area i { color: var(--alert-accent); }

.la-nav-group {
    margin-bottom: 2rem;
}

.la-nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--alert-text-dim);
    margin-bottom: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.la-nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.8rem;
    color: var(--alert-text-dim);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 0.2rem;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.la-nav-item:hover, .la-nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--alert-text);
}

.la-nav-item.active {
    border-left: 2px solid var(--alert-accent);
}

.la-nav-item i { width: 20px; text-align: center; }

/* --- Main Dashboard Area --- */
.la-main {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.la-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.la-title h1 {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.la-title p {
    color: var(--alert-text-dim);
    font-size: 0.9rem;
}

.la-controls {
    display: flex;
    gap: 1rem;
}

.la-btn {
    background: var(--alert-panel);
    border: 1px solid var(--alert-border);
    color: var(--alert-text);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.la-btn:hover { border-color: var(--alert-text-dim); }
.la-btn.primary { background: var(--alert-text); color: #000; font-weight: 600; border: none; }

/* --- KPI Grid --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.kpi-card {
    background: var(--alert-panel);
    border: 1px solid var(--alert-border);
    border-radius: 12px;
    padding: 1.2rem;
    position: relative;
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--alert-text-dim);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--alert-text);
    font-family: var(--font-mono);
}

.kpi-trend {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.trend-up { color: var(--alert-accent); }
.trend-down { color: var(--alert-danger); }

/* --- Main Analysis Split --- */
.analysis-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    min-height: 400px;
}

/* Chart Panel */
.chart-panel {
    background: var(--alert-panel);
    border: 1px solid var(--alert-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-title { font-size: 1rem; font-weight: 600; }

.chart-container {
    flex-grow: 1;
    position: relative;
    border-left: 1px solid var(--alert-border);
    border-bottom: 1px solid var(--alert-border);
    min-height: 250px;
    display: flex;
    align-items: flex-end;
    padding: 0 1rem 1rem 0;
}

/* CSS simulated chart lines */
.chart-line-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 49px, var(--alert-border) 50px);
}

.chart-path {
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 0;
}

.drift-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 70%;
    right: 10%;
    background: linear-gradient(to right, transparent, rgba(255, 77, 77, 0.1), transparent);
    border-left: 1px dashed var(--alert-danger);
}

.drift-label {
    position: absolute;
    top: 10px;
    left: 72%;
    color: var(--alert-danger);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Alert Feed Panel */
.alert-feed-panel {
    background: var(--alert-panel);
    border: 1px solid var(--alert-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.alert-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1rem;
    overflow-y: auto;
    max-height: 400px;
}

.alert-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--alert-border);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.alert-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(2px);
}

.alert-item.selected {
    border-color: var(--alert-danger);
    background: rgba(255, 77, 77, 0.05);
}

.alert-item.selected::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--alert-danger);
}

.alert-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.alert-type {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--alert-danger);
    text-transform: uppercase;
}

.alert-time { font-size: 0.75rem; color: var(--alert-text-dim); }

.alert-msg { font-size: 0.9rem; color: var(--alert-text); }

/* --- Evidence Inspector (Bottom Section) --- */
.evidence-inspector {
    background: var(--alert-panel);
    border: 1px solid var(--alert-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 0; /* Part of flex gap */
}

.evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.evidence-card {
    aspect-ratio: 4/3;
    background: #000;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--alert-border);
    group: group;
}

.evidence-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.evidence-card:hover img { opacity: 1; }

.evidence-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 0.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    font-size: 0.75rem;
    color: #fff;
    display: flex;
    justify-content: space-between;
}

.conf-score { font-family: var(--font-mono); color: var(--alert-warning); }

/* Responsive */
@media (max-width: 1024px) {
    .lexalert-wrapper {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    .la-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        border-bottom: 1px solid var(--alert-border);
        border-right: none;
    }
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
    .analysis-split {
        grid-template-columns: 1fr;
    }
}
