.concepts-dashboard-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: calc(100vh - 80px);
}

/* Header Section */
.dashboard-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
    padding: 1.25rem 2rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.header-back .btn-back {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
}

.header-back .btn-back:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
    box-shadow: 0 0 10px var(--accent-glow);
}

.header-title h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.header-title .subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.header-actions .btn-action {
    padding: 0.6rem 1.4rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header-actions .btn-action:hover {
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Grid Layout */
.concepts-dashboard {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 1.5rem;
    height: 72vh;
}

/* Glass Panels */
.glass-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl, 16px);
}

.pane-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.pane-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Loading, Error and Empty States */
.loading-state, .error-state, .empty-dashboard-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    margin: auto;
    width: 100%;
    max-width: 480px;
    box-sizing: border-box;
}

.preloader-robot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.neon-pulse {
    color: var(--accent);
    filter: drop-shadow(0 0 10px var(--accent-glow));
    animation: robot-pulse 2s infinite ease-in-out;
}

@keyframes robot-pulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 10px var(--accent-glow)); }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 25px var(--accent-glow)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 10px var(--accent-glow)); }
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent);
    animation: scan 2s infinite linear;
    opacity: 0.8;
}

@keyframes scan {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

.loading-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 1rem;
    letter-spacing: 0.05em;
}

.error-icon, .dim-icon {
    margin-bottom: 1.5rem;
}

.error-icon {
    color: #ff4a4a;
    filter: drop-shadow(0 0 8px rgba(255, 74, 74, 0.4));
}

.dim-icon {
    color: var(--text-muted);
    opacity: 0.4;
}

.empty-dashboard-state h2, .error-state h3 {
    color: var(--text-main);
    margin: 0 0 0.75rem 0;
    font-weight: 600;
}

.empty-dashboard-state p, .error-state p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0 0 2rem 0;
}

/* Workspace Panels */
.workspace-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-glowing-brain {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-glow);
    border: 1px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 20px var(--accent-glow);
}

.workspace-empty h4 {
    margin: 0 0 0.75rem 0;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
}

.workspace-empty p {
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 320px;
    margin: 0;
}

.workspace-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.node-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.node-id {
    font-family: var(--nexus-font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
    border-radius: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-unlocked {
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.badge-locked {
    background: var(--bg-base);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.workspace-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
}

.workspace-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Scrollbar customization for workspace body */
.workspace-body::-webkit-scrollbar {
    width: 6px;
}
.workspace-body::-webkit-scrollbar-track {
    background: transparent;
}
.workspace-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
.workspace-body::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.locked-warning {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    background: rgba(217, 119, 6, 0.05);
    border: 1px solid rgba(217, 119, 6, 0.15);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-main);
}

.lock-warning-icon {
    color: #ffab00;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.locked-warning strong {
    font-size: 0.85rem;
    color: #ffab00;
    display: block;
    margin-bottom: 0.25rem;
}

.locked-warning p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.metadata-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-text {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-main);
}

.summary-box {
    background: var(--bg-base);
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    padding: 1rem;
    margin-top: 0.25rem;
}

.key-terms-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.term-pill {
    font-size: 0.75rem;
    background: var(--bg-base);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.term-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

.workspace-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 1024px) {
    .concepts-dashboard {
        grid-template-columns: 1fr;
        height: auto;
    }
    .concepts-dashboard-container {
        padding: 1rem;
    }
    .dashboard-header {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
    }
    .header-back, .header-actions {
        display: flex;
        justify-content: center;
    }
}

/* ============================================
   Light Theme Overrides — Warm Paper / Soft Sepia
   ============================================ */

/* Dashboard header — warm sepia shadow instead of pure black */
.theme-light .dashboard-header {
    box-shadow: 0 4px 30px rgba(139, 130, 115, 0.05);
}

/* Neon pulse icon — disable glow filter entirely */
.theme-light .neon-pulse {
    filter: none;
}

/* Override the neon pulse keyframe states in light mode */
.theme-light .neon-pulse {
    animation-name: robot-pulse-light;
}

@keyframes robot-pulse-light {
    0% { transform: scale(1); filter: none; }
    50% { transform: scale(1.08); filter: none; }
    100% { transform: scale(1); filter: none; }
}

/* Scan line — reduce glow intensity */
.theme-light .scan-line {
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
    opacity: 0.5;
}

/* Glowing brain empty state — subtle warm glow */
.theme-light .empty-glowing-brain {
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.1);
}

/* Error icon — reduce drop-shadow intensity */
.theme-light .error-icon {
    filter: drop-shadow(0 0 4px rgba(255, 74, 74, 0.2));
}

/* Back button hover — warm glow instead of neon */
.theme-light .header-back .btn-back:hover {
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.1);
}

/* Action button hover — warm glow */
.theme-light .header-actions .btn-action:hover {
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.1);
}

@media (max-width: 767px) {
    .concepts-dashboard-container {
        padding: 1rem 0.75rem calc(1.5rem + 72px + env(safe-area-inset-bottom, 0px)) !important;
        gap: 1rem;
    }
    .dashboard-header {
        padding: 1rem;
        gap: 0.75rem;
    }
    .header-title h1 {
        font-size: 1.25rem;
    }
}
