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

/* Theme Variables - Default */
:root, [data-theme="default"] {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #fbbf24;
    --danger: #ef4444;
    --text: #1f2937;
    --text-light: #6b7280;
    --text-lighter: #9ca3af;
    --bg: #f9fafb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f3f4f6;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Dark Mode Theme */
[data-theme="dark"] {
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --primary-light: #a5b4fc;
    --secondary: #a78bfa;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --text: #f3f4f6;
    --text-light: #d1d5db;
    --text-lighter: #9ca3af;
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --border: #475569;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Forest Theme - Dark Green */
[data-theme="forest"] {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --secondary: #14b8a6;
    --success: #22c55e;
    --warning: #fbbf24;
    --danger: #ef4444;
    --text: #d1fae5;
    --text-light: #a7f3d0;
    --text-lighter: #6ee7b7;
    --bg: #064e3b;
    --bg-secondary: #065f46;
    --bg-tertiary: #047857;
    --border: #059669;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Sunset Theme - Dark Orange/Red */
[data-theme="sunset"] {
    --primary: #fb923c;
    --primary-dark: #f97316;
    --primary-light: #fdba74;
    --secondary: #f472b6;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #dc2626;
    --text: #fed7aa;
    --text-light: #fdba74;
    --text-lighter: #fb923c;
    --bg: #431407;
    --bg-secondary: #7c2d12;
    --bg-tertiary: #9a3412;
    --border: #c2410c;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Ocean Theme - Deep Blue */
[data-theme="ocean"] {
    --primary: #38bdf8;
    --primary-dark: #0ea5e9;
    --primary-light: #7dd3fc;
    --secondary: #22d3ee;
    --success: #2dd4bf;
    --warning: #fbbf24;
    --danger: #f87171;
    --text: #bae6fd;
    --text-light: #7dd3fc;
    --text-lighter: #38bdf8;
    --bg: #082f49;
    --bg-secondary: #0c4a6e;
    --bg-tertiary: #075985;
    --border: #0369a1;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Lavender Theme - Dark Purple */
[data-theme="lavender"] {
    --primary: #c084fc;
    --primary-dark: #a855f7;
    --primary-light: #d8b4fe;
    --secondary: #e879f9;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --text: #e9d5ff;
    --text-light: #d8b4fe;
    --text-lighter: #c084fc;
    --bg: #3b0764;
    --bg-secondary: #581c87;
    --bg-tertiary: #6b21a8;
    --border: #7e22ce;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Rose Theme - Dark Pink */
[data-theme="rose"] {
    --primary: #fb7185;
    --primary-dark: #f43f5e;
    --primary-light: #fda4af;
    --secondary: #f472b6;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #fca5a5;
    --text: #fecdd3;
    --text-light: #fda4af;
    --text-lighter: #fb7185;
    --bg: #4c0519;
    --bg-secondary: #881337;
    --bg-tertiary: #9f1239;
    --border: #be123c;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Monochrome Theme - Dark Gray */
[data-theme="monochrome"] {
    --primary: #a1a1aa;
    --primary-dark: #71717a;
    --primary-light: #d4d4d8;
    --secondary: #a1a1aa;
    --success: #d4d4d8;
    --warning: #e4e4e7;
    --danger: #71717a;
    --text: #f4f4f5;
    --text-light: #d4d4d8;
    --text-lighter: #a1a1aa;
    --bg: #18181b;
    --bg-secondary: #27272a;
    --bg-tertiary: #3f3f46;
    --border: #52525b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Cyberpunk Theme - Dark */
[data-theme="cyberpunk"] {
    --primary: #ff0080;
    --primary-dark: #cc0066;
    --primary-light: #ff33aa;
    --secondary: #00ffff;
    --success: #00ff88;
    --warning: #ffff00;
    --danger: #ff0055;
    --text: #e0e0ff;
    --text-light: #b8b8ff;
    --text-lighter: #8888cc;
    --bg: #0a0015;
    --bg-secondary: #1a0033;
    --bg-tertiary: #2d0052;
    --border: #ff0080;
    --shadow: 0 1px 3px rgba(255, 0, 128, 0.3);
    --shadow-lg: 0 0 20px rgba(255, 0, 128, 0.4);
}

/* Nature Theme - Dark Lime */
[data-theme="nature"] {
    --primary: #a3e635;
    --primary-dark: #84cc16;
    --primary-light: #bef264;
    --secondary: #2dd4bf;
    --success: #34d399;
    --warning: #fde047;
    --danger: #f87171;
    --text: #d9f99d;
    --text-light: #bef264;
    --text-lighter: #a3e635;
    --bg: #1a2e05;
    --bg-secondary: #365314;
    --bg-tertiary: #4d7c0f;
    --border: #65a30d;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow: hidden;
}

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

/* Header - Compact */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tag {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Theme Selector - Dropdown Style */
.theme-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-selector label {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

.theme-dropdown {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    color: var(--text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 160px;
    outline: none;
}

.theme-dropdown:hover {
    border-color: var(--primary);
}

.theme-dropdown:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.theme-dropdown option {
    background: var(--bg-secondary);
    color: var(--text);
    padding: 0.5rem;
}

.icon-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Main Content - Single Window Layout */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

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

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

.section h2 {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0;
}

.section h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    margin-top: 0.75rem;
    color: var(--text);
}

/* Collapsible Sections */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.collapsible-header:hover {
    color: var(--primary);
}

.toggle-icon {
    font-size: 0.75rem;
    transition: transform 0.3s;
}

.collapsible-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.collapsible-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible-content.collapsed {
    max-height: 0;
}

.info-content {
    max-height: 800px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.info-content.collapsed {
    max-height: 0;
}

/* Algorithm List */
.algorithm-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.algorithm-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    background: var(--bg);
    border: 1px solid transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    text-align: left;
    color: var(--text);
}

.algorithm-btn:hover {
    background: var(--primary-light);
    color: white;
    transform: translateX(4px);
}

.algorithm-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
}

.algo-icon {
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem;
    border-radius: 0.25rem;
}

.algo-name {
    font-weight: 500;
}

/* Info Panel */
.info-panel {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.description {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.description p {
    margin-bottom: 0.5rem;
}

.complexity {
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin: 0.75rem 0;
}

.complexity-item {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.8125rem;
}

.complexity-item:last-child {
    border-bottom: none;
}

.complexity-item .label {
    font-weight: 500;
    color: var(--text-light);
}

.complexity-item .value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--primary);
}

.pseudocode pre {
    background: var(--bg-tertiary);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    line-height: 1.5;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    margin-top: 0.5rem;
}

.use-cases ul, .key-points ul {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
}

.use-cases li, .key-points li {
    padding: 0.375rem 0;
    padding-left: 1.25rem;
    position: relative;
    color: var(--text-light);
    font-size: 0.8125rem;
}

.use-cases li::before, .key-points li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    position: relative;
    min-width: 0;
}

.canvas-controls {
    padding: 0.625rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.control-group {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    transition: all 0.2s;
}

.control-btn.compact {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
}

.control-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.control-btn.secondary {
    background: var(--bg-secondary);
}

.control-btn.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-group label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    cursor: pointer;
    color: var(--text-light);
}

.control-group input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

#graph-canvas {
    flex: 1;
    background: var(--bg-secondary);
    cursor: crosshair;
}

.visualization-controls {
    padding: 0.625rem 1rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.node-select {
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: var(--bg-secondary);
    font-size: 0.8125rem;
    cursor: pointer;
    color: var(--text);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s;
    background: var(--bg-secondary);
    color: var(--text);
}

.action-btn.compact {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.action-btn:active:not(:disabled) {
    transform: translateY(0);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.action-btn.primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.compact-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

.compact-slider {
    width: 80px;
}

.compact-value {
    font-weight: 600;
    color: var(--primary);
    min-width: 1.75rem;
    font-size: 0.8125rem;
}

/* Status Bar - Compact */
.status-bar {
    display: flex;
    gap: 1.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.status-bar.compact {
    gap: 1rem;
    padding: 0.375rem 1rem;
    font-size: 0.75rem;
}

.status-item {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

.status-item.status-main {
    flex: 1;
    justify-content: flex-end;
}

.status-label {
    color: var(--text-light);
    font-weight: 500;
}

#status-text {
    font-weight: 600;
    color: var(--primary);
}

.status-value {
    font-weight: 600;
    color: var(--text);
}

/* Legend - Compact */
.legend {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 1.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.legend-color {
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar,
.info-panel::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track,
.info-panel::-webkit-scrollbar-track {
    background: var(--bg);
}

.sidebar::-webkit-scrollbar-thumb,
.info-panel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.info-panel::-webkit-scrollbar-thumb:hover {
    background: var(--text-lighter);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .header {
        padding: 0.5rem 1rem;
    }
    
    .logo h1 {
        font-size: 1.125rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 40vh;
    }
    
    .canvas-controls, .visualization-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        width: 100%;
        justify-content: center;
    }
}

/* Sample Graphs Menu */
.templates-wrapper {
    position: relative;
}

.sample-graphs-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 160px;
    z-index: 1000;
    margin-top: 0.25rem;
}

.sample-graphs-menu.active {
    display: flex;
}

.sample-graphs-menu button {
    background: transparent;
    border: none;
    padding: 0.5rem 0.75rem;
    text-align: left;
    cursor: pointer;
    border-radius: 0.375rem;
    color: var(--text);
    font-size: 0.875rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.sample-graphs-menu button:hover {
    background: var(--primary);
    color: white;
}

/* Tutorial Overlay */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.tutorial-overlay.active {
    display: flex;
}

.tutorial-content {
    background: var(--bg-secondary);
    border: 2px solid var(--primary);
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 500px;
    position: relative;
    z-index: 10001;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.tutorial-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tutorial-close:hover {
    color: var(--danger);
}

.tutorial-content h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.tutorial-content p {
    color: var(--text);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.tutorial-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.tutorial-btn {
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: var(--bg-tertiary);
    color: var(--text);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.tutorial-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tutorial-btn.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tutorial-btn.primary:hover {
    background: var(--primary-dark);
}

.tutorial-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#tutorial-progress {
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
}

.tutorial-spotlight {
    position: absolute;
    border: 3px solid var(--primary);
    border-radius: 0.5rem;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.8);
    transition: all 0.3s ease;
}

/* Study Mode Panel */
.study-mode-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg);
    z-index: 9000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.study-mode-panel.active {
    display: flex;
}

.study-mode-header {
    background: var(--primary);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.study-mode-header h2 {
    font-size: 1.25rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.study-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.study-mode-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 0.25rem;
}

.study-mode-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.study-mode-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.study-tabs {
    display: flex;
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border);
    flex-shrink: 0;
}

.study-tab {
    flex: 1;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.2s;
}

.study-tab:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.study-tab.active {
    background: var(--bg-secondary);
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.study-tab-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.study-section {
    margin-bottom: 2rem;
}

.study-section h3 {
    color: var(--primary);
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

.study-section h4 {
    color: var(--text);
    font-size: 1rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.study-section p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.study-section ul, .study-section ol {
    color: var(--text-light);
    line-height: 1.7;
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.study-section li {
    margin-bottom: 0.5rem;
}

.study-code-block {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.study-code-block pre {
    margin: 0;
    color: var(--text);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.study-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.study-code-header span {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.study-copy-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.study-copy-btn:hover {
    background: var(--primary-dark);
}

.study-highlight-box {
    background: var(--primary);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    border-left: 4px solid var(--primary-dark);
}

.study-highlight-box h4 {
    margin-top: 0;
    color: white;
}

.study-info-box {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--primary);
    padding: 1rem;
    border-radius: 0.25rem;
    margin: 1rem 0;
}

.study-warning-box {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--warning);
    padding: 1rem;
    border-radius: 0.25rem;
    margin: 1rem 0;
}

.study-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.study-comparison-table th,
.study-comparison-table td {
    border: 1px solid var(--border);
    padding: 0.75rem;
    text-align: left;
}

.study-comparison-table th {
    background: var(--bg-tertiary);
    color: var(--primary);
    font-weight: 600;
}

.study-comparison-table td {
    color: var(--text-light);
}

.study-quiz-box {
    background: var(--bg-tertiary);
    border: 2px solid var(--primary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1rem 0;
}

.study-quiz-question {
    color: var(--text);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.study-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.study-quiz-option {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text);
}

.study-quiz-option:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.study-quiz-option.correct {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.study-quiz-option.incorrect {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

@media (max-width: 1400px) {
    .study-mode-panel {
        width: 60%;
    }
}

@media (max-width: 1024px) {
    .study-mode-panel {
        width: 80%;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulsing {
    animation: pulse 1s ease-in-out infinite;
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Print Styles */
@media print {
    .header, .sidebar, .canvas-controls, .visualization-controls, .status-bar, .legend {
        display: none;
    }
    
    #graph-canvas {
        width: 100%;
        height: 100vh;
    }
}
