:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(17, 24, 39, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent-orange: #ff9800;
    --accent-blue: #3b82f6;
    --accent-purple: #a855f7;
    --accent-green: #10b981;
    --accent-pink: #ec407a;
    --glow-opacity: 0.15;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

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

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background: rgba(11, 15, 25, 0.98);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    flex-shrink: 0;
    height: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.logo-dot {
    width: 12px;
    height: 12px;
    background: var(--accent-blue);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-blue);
}

.brand h2 {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #9ca3af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-scroll {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
    padding-right: 4px;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-group h3 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-left: 8px;
    opacity: 0.6;
}

.system-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
}

.sidebar-footer {
    margin-top: auto;
}

.btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
}

.primary-btn {
    background: var(--accent-blue);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.primary-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Main Workspace */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 32px;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(30, 41, 59, 0.3), transparent);
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.title-area h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 600px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-indicator.stopped {
    background: rgba(239, 83, 80, 0.1);
    border-color: rgba(239, 83, 80, 0.2);
}

.status-indicator.stopped .pulse-dot {
    background: #ef5350;
    box-shadow: 0 0 8px #ef5350;
    animation: none;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

.status-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Workspace Grid */
.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    flex-grow: 1;
    min-height: 0;
}

/* Glass Panels */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.border-bottom {
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.hint-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.canvas-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background: radial-gradient(circle at center, rgba(17, 24, 39, 0.3) 0%, rgba(11, 15, 25, 0.8) 100%);
    position: relative;
}

/* Interactive SVG Styles */
svg {
    width: 100%;
    height: 100%;
    max-height: 480px;
}

/* Interactive Node Classes */
.interactive-node {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.interactive-node:hover {
    filter: drop-shadow(0px 0px 10px rgba(255, 255, 255, 0.25)) brightness(1.2);
}

.interactive-node.selected {
    stroke-width: 3px !important;
}

/* Connection flow animation */
.data-flow-line {
    stroke-dasharray: 8, 8;
    animation: flow 20s linear infinite;
    stroke-width: 3.5;
    filter: url(#neon-glow);
}

@keyframes flow {
    to {
        stroke-dashoffset: -400;
    }
}

/* Node Tags inside SVG */
.node-label {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 12px;
    fill: #ffffff;
    pointer-events: none;
}

.node-desc {
    font-family: var(--font-sans);
    font-size: 10px;
    fill: var(--text-secondary);
    pointer-events: none;
}

/* Inspector Panel */
.inspector-card {
    display: flex;
    flex-direction: column;
}

.node-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.node-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-orange);
}

.inspector-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex-grow: 1;
    overflow-y: auto;
}

.info-section h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.info-section p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
}

.tab-btn {
    padding: 8px 4px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.tab-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

.tab-content.hidden {
    display: none !important;
}

.code-wrapper {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    flex-grow: 1;
    overflow: auto;
    max-height: 280px;
}

.code-wrapper pre {
    margin: 0;
}

.code-wrapper code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.6;
    color: #38bdf8;
    white-space: pre-wrap;
    word-break: break-all;
}

/* System Details & Tech Stack Styles */
.system-details-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 12px;
}

.tech-stack-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.tech-stack-list::-webkit-scrollbar {
    width: 4px;
}

.tech-stack-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.tech-item {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tech-service {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tech-role {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.doc-section {
    margin-top: 8px;
}

.doc-link {
    display: block;
    text-align: center;
    width: 100%;
    padding: 10px 0;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #1e40af 100%);
    color: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.doc-link:hover {
    opacity: 0.9;
}

