/* VSCode Dark Mode Theme */
:root {
    --bg-primary: #1e1e1e;
    --bg-secondary: #181818;
    --bg-tertiary: #2d2d30;
    --bg-hover: #2a2d2e;
    --bg-active: #094771;
    --border: #3e3e42;
    --text-primary: #cccccc;
    --text-secondary: #858585;
    --text-disabled: #5a5a5a;
    --accent: #007acc;
    --accent-hover: #0e639c;
    --accent-active: #1177bb;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header & Navigation */
header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    height: 36px;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: filter 0.3s ease;
}

header.blurred {
    filter: blur(4px);
    pointer-events: none;
}

nav {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 16px;
}

.nav-brand {
    display: flex;
    align-items: center;
    margin-right: 32px;
}

.ghul-icon {
    height: 32px;
    width: auto;
    margin-right: 8px;
    transition: filter 0.3s ease;
}

.ghul-icon:hover {
    filter: drop-shadow(0 0 4px #006600) drop-shadow(0 0 8px #006600) drop-shadow(0 0 12px #006600);
}

.ghul-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 4px;
    height: 100%;
    align-items: center;
}

.nav-links li {
    height: auto;
}

.nav-links a {
    display: flex;
    align-items: center;
    height: 24px;
    padding: 0 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    transition: background-color 0.15s, color 0.15s;
    border-radius: 4px;
    position: relative;
}

.nav-links a:hover {
    background-color: var(--bg-hover);
    color: var(--text-secondary);
}

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

/* Container Layout */
.container {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Sidebar */
aside {
    width: 24px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow: hidden;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    transition: width 0.3s ease;
    z-index: 1000;
    min-width: 24px;
}

aside.expanded {
    width: 250px;
    z-index: 1000;
}

.sidebar-toggle {
    position: fixed;
    left: 0px;
    top: 50vh; /* Position at 50% of viewport height, not sidebar height */
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001; /* Higher than sidebar to ensure visibility */
    padding: 0;
    transition: left 0.3s ease;
}

aside.expanded .sidebar-toggle {
    left: 225px !important;
}

/* Ensure sidebar can scroll if content is long */
aside {
    overflow-y: auto;
    overflow-x: hidden;
}

.toggle-icon {
    width: 12px;
    height: 12px;
    transition: filter 0.2s ease;
    user-select: none;
}

.sidebar-toggle:hover .toggle-icon {
    filter: drop-shadow(0 0 4px #00FF00) drop-shadow(0 0 8px #00FF00);
}

.toggle-icon-right {
    display: block;
}

.toggle-icon-left {
    display: none;
}

aside.expanded .toggle-icon-right {
    display: none;
}

aside.expanded .toggle-icon-left {
    display: block;
}

.sidebar-nav {
    padding: 8px 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    width: 250px;
    padding-left: 16px;
}

aside.expanded .sidebar-nav {
    opacity: 1;
    pointer-events: auto;
}

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

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: block;
    padding: 6px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    transition: background-color 0.15s, color 0.15s;
    cursor: pointer;
}

.sidebar-nav a:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background-color: var(--bg-active);
    color: var(--text-primary);
}

/* Main Content */
main {
    flex: 1;
    padding: 8px 16px 24px 32px;
    overflow-y: auto;
    background-color: var(--bg-primary);
    position: relative;
    z-index: 1;
    width: 100%;
    transition: filter 0.3s ease;
}

main.blurred {
    filter: blur(4px);
}

/* Blur Overlay */
.blur-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 999;
}

.blur-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

main section {
    max-width: 100%;
    margin: 0;
}

main h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

main h2 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

main p {
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

main ul {
    margin-left: 24px;
    margin-bottom: 16px;
}

main li {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

main a {
    color: var(--accent);
    text-decoration: none;
}

main a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Benchmark Display */
.benchmark-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.benchmark-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 16px;
    margin-bottom: 24px;
}

.benchmark-section {
    padding: 16px;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    border: 1px solid var(--border);
    overflow-y: auto;
}

.benchmark-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.benchmark-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.benchmark-section ul {
    margin-left: 20px;
    margin-top: 8px;
}

.benchmark-section li {
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

.benchmark-section li strong {
    color: var(--text-primary);
}

.benchmark-section p {
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

.storage-device {
    margin-bottom: 16px;
    padding: 12px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border);
}

.storage-device:last-child {
    margin-bottom: 0;
}

.storage-device h4 {
    margin-top: 0;
    margin-bottom: 8px;
}

.storage-device ul {
    margin-top: 8px;
    margin-bottom: 0;
}

/* View Switch */
.view-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.switch-btn {
    padding: 6px 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.switch-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.switch-btn.active {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent);
}

.view-content {
    display: none;
}

.view-content.active {
    display: block;
}

/* Sensor Graphs */
.sensor-graph-container {
    margin-bottom: 32px;
    padding: 16px;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    border: 1px solid var(--border);
}

.sensor-graph-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.sensor-graph {
    width: 100%;
    height: 250px;
    background-color: var(--bg-primary);
}

.sensors-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Hellfire Section */
.hellfire-section {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 2px solid var(--border);
}

.hellfire-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.hellfire-canvas {
    width: 100%;
}

.hellfire-test-section {
    margin-bottom: 32px;
}

.hellfire-test-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    text-transform: capitalize;
}

@media (max-width: 1200px) {
    .sensors-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive: 2 columns on smaller screens */
@media (max-width: 1200px) {
    .benchmark-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, auto);
    }
}

/* Responsive: 1 column on mobile */
@media (max-width: 768px) {
    .benchmark-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
}

/* Footer */
footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 8px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 11px;
    position: sticky;
    bottom: 0;
    z-index: 1000;
}

/* Scrollbar Styling (VSCode-like) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

/* Tooltip Styling */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    background-color: #1e1e1e;
    color: #00ff00;
    border: 1px solid #006600;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 14px;
    display: block;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    white-space: nowrap;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    border: 4px solid transparent;
    border-bottom-color: #006600;
    z-index: 10001;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    aside:not(.expanded) {
        width: 16px;
    }
    
    aside.expanded {
        width: 250px;
    }
    
    main {
        padding: 16px;
    }
    
    .nav-links {
        gap: 0;
    }
    
    .nav-links a {
        padding: 0 12px;
        font-size: 12px;
    }
}

