:root {
    --bg: #f4f8ff;
    --bg-2: #eef4ff;
    --surface: rgba(255, 255, 255, 0.65);
    --surface-strong: rgba(255, 255, 255, 0.85);
    --border: rgba(148, 163, 184, 0.25);
    --text: #0f172a;
    --muted: #4b5563;
    --primary: #2563eb;
    --primary-2: #4f46e5;
    --accent: #06b6d4;
    --shadow: 0 18px 50px rgba(37, 99, 235, 0.10);
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    --glass-blur: blur(18px);
}

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-2);
}

h1, h2, h3, h4 {
    color: var(--text);
    font-weight: 700;
    margin-top: 0;
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(37, 99, 235, 0.1); }
    50% { box-shadow: 0 0 20px rgba(37, 99, 235, 0.3); }
    100% { box-shadow: 0 0 5px rgba(37, 99, 235, 0.1); }
}

@keyframes dataStream {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* Navbar */
.navbar {
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav-brand span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    color: white;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.75rem 2rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: var(--surface-strong);
    box-shadow: var(--shadow-soft);
}

/* Layout */
.page-container {
    padding-top: 80px; /* Offset for navbar */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex-grow: 1;
}

/* Components */
.glass-panel {
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: var(--shadow-soft);
}

.glass-panel:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

/* Landing Page Specific (fallback) */
.hero-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    background: radial-gradient(circle at center, rgba(238, 244, 255, 0.8) 0%, var(--bg) 100%);
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 900px;
    z-index: 2;
}

.hero-title {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--text-highlight), var(--twilight-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: float 6s ease-in-out infinite;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--twilight-accent);
    margin-bottom: 1rem;
}

.terminal-bg {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    opacity: 0.03;
    pointer-events: none;
    background-image: linear-gradient(var(--twilight-accent) 1px, transparent 1px),
    linear-gradient(90deg, var(--twilight-accent) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Blazor Error UI */
#blazor-error-ui {
    background: rgba(255, 0, 0, 0.8);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
    color: white;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Dashboard Sidebar Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--twilight-bg);
}

.dashboard-sidebar {
    width: 280px;
    background: rgba(11, 12, 16, 0.95);
    border-right: 1px solid var(--twilight-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--twilight-border);
}

.sidebar-nav {
    flex-grow: 1;
    padding: 2rem 0;
    overflow-y: auto;
}

.sidebar-nav a {
    display: block;
    padding: 1rem 2rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(102, 252, 241, 0.1);
    color: var(--twilight-accent);
    border-left-color: var(--twilight-accent);
}

.sidebar-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--twilight-border);
    background: rgba(0, 0, 0, 0.2);
}

.dashboard-main {
    flex-grow: 1;
    margin-left: 280px; /* offset for sidebar */
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

.grid-file {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(31, 40, 51, 0.6);
    border: 1px solid var(--twilight-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.grid-file:hover {
    background: rgba(102, 252, 241, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.file-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--twilight-accent);
}

.file-name {
    font-weight: 500;
    color: var(--text-highlight);
    text-align: center;
    word-break: break-all;
}

.file-meta {
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-top: 0.5rem;
}

/* OVER-THE-TOP UX EXTENSIONS */

/* Metric Cards */
.metric-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--border);
    border-left-width: 4px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s, box-shadow 0.2s;
    backdrop-filter: var(--glass-blur);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.metric-card.blue { border-left-color: var(--primary); }
.metric-card.green { border-left-color: #10b981; }
.metric-card.yellow { border-left-color: #f59e0b; }
.metric-card.purple { border-left-color: #8b5cf6; }

.metric-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

/* Sidebar Categories */
.sidebar-category {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary);
    padding: 1rem 2rem 0.5rem 2rem;
    font-weight: 800;
}

.sidebar-nav a {
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

/* Mock Bar Chart */
.chart-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    height: 250px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    justify-content: space-between;
}

.chart-bar {
    flex: 1;
    background: var(--border);
    border-radius: 4px 4px 0 0;
    transition: background 0.3s, height 1s ease-out;
}

.chart-bar.active {
    background: var(--accent);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* Right Sidebar Chat Overlay */
.right-sidebar {
    width: 300px;
    background: #0a0b0e;
    border-left: 1px solid var(--twilight-border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}