:root {
    --bg-color: #0d1117;
    --sidebar-bg: rgba(22, 27, 34, 0.7);
    --panel-bg: rgba(22, 27, 34, 0.5);
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent-color: #58a6ff;
    --accent-hover: #79c0ff;
    --accent-glow: rgba(88, 166, 255, 0.2);
    --border-color: rgba(240, 246, 252, 0.1);
    --glass-blur: blur(12px);
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(88, 166, 255, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(201, 117, 255, 0.05), transparent 25%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--sidebar-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-color);
}

.shadow-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Sidebar */
.sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.logo .icon {
    font-size: 24px;
}

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

.subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
    margin-left: 36px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-menu {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px 16px;
}

.nav-section h3 {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-left: 12px;
}

.mt-4 { margin-top: 24px; }

.nav-menu ul {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 4px;
}

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all var(--transition-speed) ease;
}

.nav-icon {
    margin-right: 12px;
    font-size: 1.1rem;
    opacity: 0.8;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(4px);
}

.nav-menu a.active {
    background: var(--accent-glow);
    color: var(--accent-color);
    box-shadow: inset 2px 0 0 var(--accent-color);
}

.arrow {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.external-link:hover .arrow {
    transform: translate(2px, -2px);
    color: var(--accent-color);
}

.report-item {
    display: flex;
    flex-direction: column;
    padding: 12px !important;
    align-items: flex-start !important;
}

.report-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 4px;
    padding-left: 28px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.status-indicator {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pulse {
    width: 8px;
    height: 8px;
    background-color: #2ea043;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 0 0 rgba(46, 160, 67, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 160, 67, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(46, 160, 67, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 160, 67, 0); }
}

/* Main Content Area */
.content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-color);
    z-index: 5;
}

.topbar h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), #bc8cff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.scrollable-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 40px;
}

/* Markdown Body Styles */
#markdown-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 48px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.markdown-body {
    color: var(--text-primary);
    font-size: 1.05rem;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
    color: #fff;
    margin-top: 32px;
    margin-bottom: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.markdown-body h1 { font-size: 2.25rem; border-bottom: none; }
.markdown-body h2 { font-size: 1.75rem; }
.markdown-body h3 { font-size: 1.25rem; border-bottom: none; }

.markdown-body p { margin-bottom: 16px; }
.markdown-body a { color: var(--accent-color); text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }

.markdown-body ul, .markdown-body ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.markdown-body li { margin-bottom: 8px; }

.markdown-body code {
    background: rgba(240, 246, 252, 0.1);
    padding: 2px 6px;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
}

.markdown-body pre {
    background: #161b22;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
}

.markdown-body blockquote {
    color: var(--text-secondary);
    border-left: 4px solid var(--border-color);
    padding-left: 16px;
    margin-bottom: 16px;
    font-style: italic;
}

.markdown-body hr {
    height: 1px;
    background-color: var(--border-color);
    border: none;
    margin: 32px 0;
}

.loader {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 40px;
}

/* Mermaid Rendering Optimizations */
.mermaid {
    background: rgba(22, 27, 34, 0.3);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 32px;
    overflow-x: auto;
    width: 100%;
    /* Force left alignment for the generated SVG */
    display: flex;
    justify-content: flex-start;
}

.mermaid svg {
    max-width: none !important;
    height: auto !important;
    margin-left: 0 !important;
}

/* Allow markdown container to be wider for diagrams */
#markdown-container:has(.mermaid) {
    max-width: 95%;
    margin-left: 40px;
    margin-right: 40px;
}
