/* Abstract Warlock Labs - Optimized Stylesheet */

/* --- RESET & VARIABLES --- */
:root {
    --bg-body: #0d1117;
    --bg-sidebar: #161b22;
    --bg-card: #21262d;
    --bg-hover: #30363d;
    --border-color: #30363d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent-primary: #58a6ff;
    --accent-green: #3fb950;
    --accent-orange: #d29922;
    --accent-red: #f85149;
    --accent-purple: #bc8cff;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3);
    --radius-md: 6px;
    --radius-lg: 12px;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { text-decoration: underline; color: inherit; }
button { border: 0; background: none; cursor: pointer; color: inherit; font-family: inherit; }

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.5;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* --- UTILITIES --- */
.mb0 { margin-bottom: 0 !important; } .mt0 { margin-top: 0 !important; }
.mb8 { margin-bottom: 8px !important; } .mt8 { margin-top: 8px !important; }
.mb16 { margin-bottom: 16px !important; } .mt16 { margin-top: 16px !important; }
.mb24 { margin-bottom: 24px !important; } .mt24 { margin-top: 24px !important; }

.opaque-block { display: block; opacity: 0.8; }
.center { text-align: center !important; }
.greyedout, .grey-icon { color: grey; filter: grayscale(100%); opacity: 0.5; }

/* Colors & Borders */
.accent-primary { color: var(--accent-primary) !important; }
.accent-green { color: var(--accent-green) !important; }
.accent-orange { color: var(--accent-orange) !important; }
.accent-red { color: var(--accent-red) !important; }
.accent-purple { color: var(--accent-purple) !important; }
.text-black { color: #000 !important; }
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }

.border-primary { border-color: var(--accent-primary) !important; }
.border-green { border-color: var(--accent-green) !important; }
.border-orange { border-color: var(--accent-orange) !important; }
.border-red { border-color: var(--accent-red) !important; }
.border-purple { border-color: var(--accent-purple) !important; }
.border-warning { border-color: rgba(248, 81, 73, 0.2) !important; }

.bg-purple { background: rgba(188, 140, 255, 0.2) !important; }
.bg-warning { background: rgba(248, 81, 73, 0.2) !important; }
.bg-accentgreen { background: var(--accent-green) !important; }
.bg-accentred { background: var(--accent-red) !important; }

/* --- LAYOUT STRUCTURE --- */
.app-container { display: flex; width: 100%; height: 100%; }

/* --- SIDEBAR --- */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar a { text-decoration: none; }

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }

.brand-logo {
    width: 36px; height: 36px;
    background: var(--bg-body);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #fff; font-size: 18px;
    box-shadow: 0 0 10px rgb(13 17 23 / 60%);
    border: 1px solid rgb(255 255 255 / 14%);
}

.brand-text { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; color: var(--text-primary); }

.nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 24px; }

.nav-label {
    font-size: 11px; font-weight: 700; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 8px 12px;
}

.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 8px 12px;
    border-radius: var(--radius-md); color: var(--text-secondary);
    font-size: 14px; font-weight: 500; transition: all 0.2s ease; text-align: left;
}
.nav-item:hover { background-color: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background-color: rgba(56, 139, 253, 0.1); color: var(--accent-primary); font-weight: 600; }

.nav-icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; opacity: 0.8; }

.sidebar-footer {
    margin-top: auto; padding-top: 20px; border-top: 1px solid var(--border-color);
    font-size: 11px; opacity: 0.6; color: var(--text-secondary); text-align: center;
}
.sidebar-footer a { color: var(--accent-primary); }
.sidebar-footer span { color: #fff; }

/* --- MAIN CONTENT AREA --- */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }

.top-bar {
    height: 60px; padding: 0 32px;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(13, 17, 23, 0.85); backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: space-between; z-index: 10;
}

.top-bar .top-right { display: flex; align-items: center; gap: 12px; }
.breadcrumbs { font-size: 13px; color: var(--text-secondary); }
.breadcrumbs span { color: var(--text-primary); font-weight: 600; }

.status-badge {
    display: flex; align-items: center; gap: 6px; padding: 2px 8px;
    font-size: 11px; font-weight: 600; color: var(--accent-green); text-transform: uppercase;
    background: rgba(63, 185, 80, 0.1); border-radius: 100px; border: 1px solid rgba(63, 185, 80, 0.3);
}
.status-dot {
    width: 6px; height: 6px; background-color: var(--accent-green);
    border-radius: 50%; box-shadow: 0 0 5px rgba(63, 185, 80, 0.5);
}

.scroll-area { flex: 1; overflow-y: auto; padding: 24px; }
.scroll-area .sidebar-footer { display: none; }
.container { max-width: 960px; margin: 0 auto; }

/* Headers */
.header-large { margin-bottom: 24px; }
.header-large h1 { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0 8px; color: var(--text-primary); }
.header-large p { font-size: 18px; color: var(--text-secondary); line-height: 1.6; }
.header-large .tag { margin-bottom: 12px; display: inline-block; }

/* Grid Layouts */
.card-grid, .card-grid-duo, .card-grid-quad { display: grid; gap: 24px; margin-bottom: 28px; }
.card-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card-grid-duo { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.card-grid-quad { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.card-grid-quad-sm { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }

/* Cards & Feature Blocks */
.card, .feature-block {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}
.card { display: flex; flex-direction: column; gap: 16px; transition: all 0.2s ease; }
.card:hover { border-color: var(--text-secondary); transform: translateY(-2px); box-shadow: var(--shadow-md); background-color: #262c36; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; }

.feature-block { margin-bottom: 24px; }
.card-grid-duo .feature-block { margin-bottom: 0; }
.feature-block.warning { background: rgba(248, 81, 73, 0.05); border-color: rgba(248, 81, 73, 0.2); }
.feature-block.genesis { background: rgba(188, 140, 255, 0.05); border-color: rgba(188, 140, 255, 0.2); }
.feature-block.important { background: rgba(51, 39, 1, 0.4); border-color: rgba(255, 218, 106, 0.2); }
.feature-block h3 { margin-bottom: 16px; font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 12px; }

.card h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.card p, .step-content p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* Card Icons */
.card-icon, .card-icon-small {
    background-color: var(--bg-hover); border-radius: 8px;
    display: flex; align-items: center; justify-content: center; color: var(--text-primary);
}
.card-icon { width: 40px; height: 40px; font-size: 20px; }
.card-icon-small { width: 24px; height: 24px; font-size: 14px; }

/* Tags */
.tag { font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.05em; border: 1px solid transparent; }
.tag.blue { background: rgba(88, 166, 255, 0.1); color: var(--accent-primary); border-color: rgba(88, 166, 255, 0.2); }
.tag.green { background: rgba(63, 185, 80, 0.1); color: var(--accent-green); border-color: rgba(63, 185, 80, 0.2); }
.tag.orange { background: rgba(210, 153, 34, 0.1); color: var(--accent-orange); border-color: rgba(210, 153, 34, 0.2); }
.tag.red { background: rgba(248, 81, 73, 0.1); color: var(--accent-red); border-color: rgba(248, 81, 73, 0.2); }
.tag.purple { background: rgba(188, 140, 255, 0.1); color: var(--accent-purple); border-color: rgba(188, 140, 255, 0.2); }

/* Feature Lists */
.feature-list { margin-top: 0; margin-bottom: -12px; }
.feature-list li { display: flex; gap: 12px; margin-bottom: 12px; font-size: 14px; color: var(--text-secondary); align-items: flex-start; }
.feature-list li strong { color: var(--text-primary); font-weight: 600; margin-right: 4px; }
.icon-check, .icon-warn, .icon-magic { flex-shrink: 0; margin-top: 3px; }
.icon-check { color: var(--accent-green); }
.icon-warn { color: var(--accent-red); }
.icon-magic { color: var(--accent-purple); }

/* Blockquotes & Code Pills */
blockquote { border-left: 3px solid var(--accent-primary); padding-left: 16px; font-size: 18px; font-style: italic; color: var(--text-secondary); }
.concept-pill {
    background: var(--bg-body); border: 1px solid var(--border-color); padding: 12px 16px;
    border-radius: 6px; font-family: var(--font-mono); font-size: 14px; color: var(--text-secondary); margin-top: auto;
}
.concept-pill strong { color: var(--text-primary); display: block; margin-bottom: 4px; }

/* Steps */
.step-list { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.step-item { display: flex; gap: 16px; }
.step-number {
    width: 24px; height: 24px; background: var(--bg-hover); border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text-primary);
}
.st-inline .step-number { margin-top: 0; }
.step-content { font-size: 14px; color: var(--text-secondary); }
.step-content strong { display: block; color: var(--text-primary); margin-bottom: 4px; }
.step-list.st-inline .step-content strong { display: inline; margin-bottom: 0; }

/* --- DROPDOWN MENU --- */
.dropdown-menu { position: relative; display: inline-block; }
.dropdown-toggle {
    background: var(--bg-hover); border: 1px solid var(--border-color); border-radius: 6px;
    color: var(--text-secondary); font-size: 18px; font-weight: 700;
    width: 32px; height: 32px; padding: 0;
    display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s ease;
}
.dropdown-toggle:hover { background: var(--bg-card); color: var(--text-primary); border-color: var(--text-secondary); }

.dropdown-content {
    display: none; position: absolute; right: 0; top: 40px; z-index: 1000; padding: 4px; min-width: 250px;
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 6px; box-shadow: var(--shadow-md);
}
.dropdown-content.show { display: block; }
.dropdown-content a { text-decoration: none; }
.dropdown-item {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px;
    background: transparent; border: 0; border-radius: 4px; color: var(--text-secondary);
    font-size: 14px; text-align: left; cursor: pointer; transition: all 0.2s ease;
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item span { font-size: 16px; }
.dropdown-divider { height: 1px; background: var(--border-color); margin: 4px 0; }

/* --- SOURCE VIEWER STYLES --- */
.source-header { padding: 0 20px 0 0; margin-top: 10px; }
.source-title, .source-meta, #source-content { font-family: var(--font-mono); }
.source-title { color: #0cca4a; font-size: 18px; font-weight: 600; margin-bottom: 0; }
.source-meta { color: #8b949e; font-size: 12px; }
.source-content-wrapper { background: #0d1117; border: 1px solid #30363d; border-radius: 6px; overflow: hidden; }
.source-code-area { padding: 20px; background: rgba(0, 0, 0, 0.2); overflow-x: hidden; }

#source-content {
    background: transparent; font-size: 14px; line-height: 1.4; color: #d0d0d0;
    white-space: pre-wrap; word-wrap: break-word; border: 0;
}

.source-code-area::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; }
.source-code-area::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* Syntax & Markdown Highlighting */
.hl-kw { color: #ff8c00; font-weight: 600; }
.hl-var { color: #9cdcfe; }
.hl-str { color: #ce9178; }
.hl-num { color: #b5cea8; }
.hl-tag { color: #c586c0; }
.hl-builtin, .hl-func { color: #dcdcaa; }
.hl-cls { color: #4ec9b0; }
.hl-cmt, .hl-mdi, .hl-mdquote { font-style: italic; }
.hl-cmt, .hl-mdquote { color: #6a9955; }
.hl-mdh1, .hl-mdh2, .hl-mdh3, .hl-mdh4, .hl-mdb { font-weight: 700; }
.hl-mdh1 { color: #ff8000; }
.hl-mdh2 { color: #ffa000; }
.hl-mdh3 { color: #ffd88f; }
.hl-mdh4 { color: #fff4c7; }
.hl-mdb { color: #fff; }
.hl-mdbullet { color: #89d6ff; }
.hl-mdcode { color: #d7ba7d; }
.hl-mdcodeblock { 
    color: #ce9178; background: rgba(206, 145, 120, 0.1); 
    display: block; padding: 12px; border-left: 3px solid #ce9178; margin: 8px 0; border-radius: 4px;
}
.hl-mdhr { color: #fff; }
.hl-mdlink { color: #58a6ff; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s ease; }
.hl-mdlink:hover { border-bottom-color: #58a6ff; }

/* Markdown Tables (viewer) */
.md-table-wrap { overflow-x: auto; margin: 12px 0; border-radius: var(--radius-md); border: 1px solid var(--border-color); }
.md-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 13px; }
.md-table thead { background: #000; }
.md-table .md-td { padding: 8px 12px; border: 1px solid var(--border-color); color: var(--text-secondary); vertical-align: top; line-height: 1.5; }
.md-table thead .md-td { color: var(--text-primary); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.md-table .md-tr:nth-child(even) { background: rgba(255,255,255,0.02); }
.md-table .md-tr:hover { background: var(--bg-hover); }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .scroll-area .sidebar-footer { display: block; }
    .scroll-area { padding: 24px 16px 60px 16px; }
    .header-large h1 { font-size: 24px; }
    .top-bar { padding: 0 16px; }
    .card-grid-duo { grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); }    
    .status-badge { display: none; }
    .source-title { font-size: 16px; }
    .source-code-area { padding: 16px 12px; }
    #source-content { font-size: 12px; }    
	.md-table { width:1000px; }
}