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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    margin: 0;
    display: flex;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    padding: 20px;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.language-dropdown {
    margin-bottom: 30px;
}

.language-dropdown label {
    display: block;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.language-dropdown select {
    width: 100%;
    padding: 10px;
    border: 2px solid #667eea;
    border-radius: 5px;
    background: white;
    color: #333;
    font-size: 1em;
    cursor: pointer;
}

.toc {
    margin-top: 20px;
}

/* Back Link Styles */
.back-link {
    margin-bottom: 20px;
    padding: 0 !important;
}

.back-link a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
}

.back-link a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.back-link a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.back-link a:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.toc-section {
    margin-bottom: 20px;
}

.toc-title {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.toc-title.collapsible {
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toc-title.collapsible:hover {
    color: #5a67d8;
}

.toggle-icon {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.toc-content {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    max-height: 1000px;
    opacity: 1;
}

.toc-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

.toc-item {
    margin-bottom: 8px;
    padding-left: 20px;
}

.toc-item a {
    color: #555;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    padding: 5px 0;
}

.toc-item a:hover {
    color: #667eea;
}

.toc-item a.active {
    color: #667eea;
    font-weight: bold;
}

.toc-subsection {
    margin-top: 10px;
    padding-left: 20px;
}

.toc-subitem {
    margin-bottom: 5px;
    font-size: 0.9em;
}

.toc-subitem a {
    color: #777;
    text-decoration: none;
    transition: color 0.3s ease;
}

.toc-subitem a:hover {
    color: #667eea;
}

.toc-subitem a.active {
    color: #667eea;
    font-weight: bold;
}

/* Main Content Styles */
.main-content {
    margin-left: 280px;
    width: calc(100% - 280px);
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 10px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.level {
    background: white;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.level-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    font-size: 1.5em;
    font-weight: bold;
}

.section {
    padding: 30px;
    border-bottom: 1px solid #eee;
}

.section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 1.3em;
    color: #667eea;
    margin-bottom: 20px;
    font-weight: bold;
}

.concept {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.concept-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.explanation {
    margin-bottom: 15px;
    color: #555;
}

.analogy {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 3px solid #2196f3;
}

.analogy-title {
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 5px;
}

.code-container {
    margin-top: 20px;
}

/* Enhanced Code Snippet Language Selector */
.code-snippet-language-selector {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    position: relative;
    overflow: hidden;
}

.code-snippet-language-selector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.code-snippet-language-selector .selector-left {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-weight: 600;
    font-size: 0.95em;
}

.code-snippet-language-selector .language-title {
    white-space: nowrap;
    overflow: hidden;
}

.code-snippet-language-selector .language-icon {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
}

.code-snippet-language-selector .selector-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.code-snippet-language-selector .language-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.code-snippet-language-selector .language-tab {
    padding: 8px 16px;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 80px;
    text-align: center;
}

.code-snippet-language-selector .language-tab:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.code-snippet-language-selector .language-tab.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    font-weight: 600;
}

.code-snippet-language-selector .language-tab.active::before {
    content: '✓';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: bold;
    color: #4ade80;
    text-shadow: 0 0 4px rgba(74, 222, 128, 0.5);
    animation: tickAppear 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes tickAppear {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0.3) rotate(-180deg);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1) rotate(0deg);
    }
}

.code-snippet-language-selector .language-tab.active {
    padding-left: 28px;
}

.code-snippet-language-selector .language-tab:not(.active)::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.code-snippet-language-selector .language-tab:not(.active):hover::after {
    left: 100%;
}

.code-snippet-language-selector .copy-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.code-snippet-language-selector .copy-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.code-snippet-language-selector .copy-button.copied {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.5);
}

/* Enhanced code block styling */
.code-container[data-snippet-id] .code-block {
    border-radius: 0 0 12px 12px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.code-container[data-snippet-id] .code-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

/* Language transition animations */
.code-block {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(10px);
}

.code-block.active {
    opacity: 1;
    transform: translateY(0);
}

/* Improved language label */
.code-block .language-label {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: #e2e8f0;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: 600;
    margin-bottom: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.code-block .language-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .code-snippet-language-selector {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }
    
    .code-snippet-language-selector .selector-right {
        width: 100%;
        justify-content: center;
    }
    
    .code-snippet-language-selector .language-tabs {
        width: 100%;
        justify-content: center;
    }
    
    .code-snippet-language-selector .language-tab {
        flex: 1;
        text-align: center;
    }
}

.code-block {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 0 0 8px 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    margin-bottom: 10px;
    display: none;
}

/* When code container doesn't have individual selector */
.code-container:not([data-snippet-id]) .code-block {
    border-radius: 8px;
}

.code-block.active {
    display: block;
}

.code-block pre {
    margin: 0;
    white-space: pre-wrap;
}

.language-label {
    background: #4a5568;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 0.8em;
    margin-bottom: 10px;
    display: inline-block;
}

.key-points {
    background: #f0f9ff;
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
    border-left: 3px solid #0ea5e9;
}

.key-points h4 {
    color: #0369a1;
    margin-bottom: 10px;
}

.key-points ul {
    margin-left: 20px;
}

.key-points li {
    margin-bottom: 5px;
    color: #555;
}

.complexity-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.complexity-table th,
.complexity-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.complexity-table th {
    background: #667eea;
    color: white;
}

.complexity-table tr:nth-child(even) {
    background: #f9f9f9;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        margin-left: 250px;
        width: calc(100% - 250px);
    }
}

/* Visual Diagram Styles */
.visual-diagram {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #cbd5e0;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.diagram-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ascii-art {
    background: #1a202c;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    font-size: 0.85em;
    line-height: 1.4;
    overflow-x: auto;
    border: 1px solid #4a5568;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ascii-art pre {
    margin: 0;
    white-space: pre;
    color: #a0aec0;
}

/* Real-World Examples Styles */
.real-world-examples {
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
    border: 2px solid #68d391;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(104, 211, 145, 0.1);
}

.example-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #22543d;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.industry-examples {
    margin-bottom: 20px;
}

.example-item {
    background: white;
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: 8px;
    border-left: 4px solid #48bb78;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.example-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.example-item strong {
    color: #2f855a;
    font-weight: 600;
}

/* Performance Benchmark Styles */
.performance-benchmark {
    background: linear-gradient(135deg, #fef5e7 0%, #fed7aa 100%);
    border: 2px solid #f6ad55;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(246, 173, 85, 0.1);
}

.benchmark-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #c05621;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.benchmark-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.benchmark-table th {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
}

.benchmark-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9em;
}

.benchmark-table tr:nth-child(even) {
    background: #fafafa;
}

.benchmark-table tr:hover {
    background: #f7fafc;
}

/* Status indicators in benchmark table */
.benchmark-table td:last-child {
    font-weight: 600;
}

.benchmark-table td:last-child:contains("✅") {
    color: #38a169;
}

.benchmark-table td:last-child:contains("⚠️") {
    color: #d69e2e;
}

.benchmark-table td:last-child:contains("❌") {
    color: #e53e3e;
}

/* Tree Traversal Visualization Styles */
.tree-visualization {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    border: 2px solid #a0aec0;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.tree-node {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    line-height: 40px;
    margin: 5px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tree-node.visited {
    background: #48bb78;
    animation: nodeVisit 0.5s ease;
}

.tree-node.current {
    background: #ed8936;
    animation: nodePulse 1s infinite;
}

@keyframes nodeVisit {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes nodePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Graph Algorithm Visualization */
.graph-visualization {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #cbd5e0;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.graph-step {
    background: white;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.graph-step-title {
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 8px;
}

.graph-step-description {
    color: #4a5568;
    font-size: 0.95em;
}

/* Dynamic Programming Table Styles */
.dp-table-container {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.1);
}

.dp-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dp-table th,
.dp-table td {
    border: 1px solid #cbd5e0;
    padding: 8px 12px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.dp-table th {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    font-weight: 600;
}

.dp-table .dp-cell-filled {
    background: #dbeafe;
    font-weight: bold;
    color: #1e40af;
}

.dp-table .dp-cell-current {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    animation: cellHighlight 1s ease;
}

@keyframes cellHighlight {
    0%, 100% { background: #fef3c7; }
    50% { background: #fde68a; }
}

/* Memory Usage Comparison */
.memory-comparison {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    border: 2px solid #ec4899;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.1);
}

.memory-bar {
    background: #f3f4f6;
    height: 20px;
    border-radius: 10px;
    margin: 10px 0;
    overflow: hidden;
    position: relative;
}

.memory-fill {
    height: 100%;
    background: linear-gradient(90deg, #ec4899, #be185d);
    border-radius: 10px;
    transition: width 1s ease;
    position: relative;
}

.memory-label {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 0.8em;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Responsive Design for Visual Elements */
@media (max-width: 768px) {
    .visual-diagram,
    .real-world-examples,
    .performance-benchmark {
        padding: 15px;
        margin: 15px 0;
    }
    
    .ascii-art {
        font-size: 0.75em;
        padding: 15px;
    }
    
    .benchmark-table,
    .dp-table {
        font-size: 0.8em;
    }
    
    .benchmark-table th,
    .benchmark-table td,
    .dp-table th,
    .dp-table td {
        padding: 8px 6px;
    }
    
    .tree-node {
        width: 35px;
        height: 35px;
        line-height: 35px;
        font-size: 0.9em;
    }
}

/* Progress Tracking and Transition Styles */
.prerequisite-checklist {
    margin: 20px 0;
}

.checklist-category {
    margin-bottom: 25px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.checklist-category h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    user-select: none;
}

.checklist-item:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.prerequisite-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.prerequisite-checkbox:checked + .checkmark {
    background-color: #667eea;
    border-color: #667eea;
}

.prerequisite-checkbox:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.progress-indicator {
    margin: 25px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 8px;
    border: 1px solid #0ea5e9;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background-color: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 6px;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.2) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.2) 75%, transparent 75%);
    background-size: 20px 20px;
    animation: progressStripes 1s linear infinite;
}

@keyframes progressStripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: #0369a1;
    font-size: 0.9em;
}

.readiness-status {
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #cbd5e0;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.readiness-status.partial {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.readiness-status.almost {
    background: #dbeafe;
    border-left-color: #3b82f6;
}

.readiness-status.ready {
    background: #d1fae5;
    border-left-color: #10b981;
    animation: readyPulse 2s ease-in-out infinite;
}

@keyframes readyPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.status-message {
    font-weight: 500;
    color: #374151;
}

.readiness-status.partial .status-message {
    color: #92400e;
}

.readiness-status.almost .status-message {
    color: #1e40af;
}

.readiness-status.ready .status-message {
    color: #065f46;
}

/* Bridge Content Styles */
.bridge-example {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #fef7ff 0%, #f3e8ff 100%);
    border-radius: 12px;
    border: 2px solid #a855f7;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.1);
}

.bridge-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #7c3aed;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bridge-explanation {
    color: #6b46c1;
    margin-bottom: 20px;
    font-style: italic;
}

.bridge-insight {
    margin-top: 20px;
    padding: 15px;
    background: rgba(168, 85, 247, 0.1);
    border-radius: 8px;
    border-left: 4px solid #a855f7;
}

.bridge-insight strong {
    color: #7c3aed;
}

/* Level 2 Preview Styles */
.level2-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.preview-category {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.preview-category:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.preview-icon {
    font-size: 1.5em;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: white;
}

.preview-header h4 {
    color: #2d3748;
    margin: 0;
    font-size: 1.1em;
}

.preview-content p {
    margin: 8px 0;
    color: #4a5568;
    font-size: 0.9em;
    line-height: 1.5;
}

.preview-content strong {
    color: #2d3748;
    font-weight: 600;
}

/* Next Steps Styles */
.next-steps {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    border-radius: 12px;
    border: 2px solid #38b2ac;
    text-align: center;
}

.next-steps h4 {
    color: #234e52;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.next-steps p {
    color: #2c7a7b;
    margin-bottom: 20px;
}

.level2-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.level2-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #38b2ac 0%, #319795 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(56, 178, 172, 0.2);
}

.level2-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(56, 178, 172, 0.3);
    background: linear-gradient(135deg, #319795 0%, #2c7a7b 100%);
    color: white;
}

.link-icon {
    font-size: 1.2em;
}

.link-text {
    font-size: 0.95em;
}

/* Self-Assessment Quiz Styles */
.quiz-container {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border: 2px solid #fc8181;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
}

.quiz-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #c53030;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-question {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.question-text {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.quiz-option:hover {
    background-color: #f7fafc;
}

.quiz-option input[type="radio"] {
    accent-color: #fc8181;
}

.quiz-result {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    font-weight: 500;
    display: none;
}

.quiz-result.correct {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.quiz-result.incorrect {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Progress Tracking Styles */
.level-progress {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    border: 2px solid #48bb78;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.progress-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #22543d;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.progress-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #e2e8f0;
    transition: all 0.3s ease;
}

.progress-item.completed {
    border-left-color: #48bb78;
    background: #f0fff4;
}

.progress-item-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.progress-item-status {
    font-size: 0.9em;
    color: #4a5568;
}

.progress-item.completed .progress-item-status {
    color: #22543d;
    font-weight: 500;
}

.progress-item.completed .progress-item-title::after {
    content: ' ✓';
    color: #48bb78;
}

/* Responsive Design for New Elements */
@media (max-width: 768px) {
    .level2-preview {
        grid-template-columns: 1fr;
    }
    
    .level2-links {
        flex-direction: column;
        align-items: center;
    }
    
    .level2-link {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .checklist-category {
        padding: 15px;
    }
    
    .bridge-example {
        padding: 20px;
    }
    
    .progress-grid {
        grid-template-columns: 1fr;
    }
}

/* Certificate Modal Styles */
.certificate-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.certificate-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px) scale(0.9); }
    to { transform: translateY(0) scale(1); }
}

.certificate-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.certificate-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-modal:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.certificate-body {
    padding: 30px;
}

.certificate-badge {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border: 2px solid #0ea5e9;
}

.badge-icon {
    font-size: 3em;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: white;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.badge-text h3 {
    margin: 0 0 8px 0;
    color: #1e40af;
    font-size: 1.3em;
}

.badge-text p {
    margin: 4px 0;
    color: #3b82f6;
    font-size: 0.9em;
}

.certificate-message {
    text-align: center;
    margin-bottom: 25px;
    color: #4a5568;
    line-height: 1.6;
}

.certificate-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95em;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

/* Certificate Display Styles */
.certificates-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.certificate-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.certificate-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.certificate-item .certificate-icon {
    font-size: 2em;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: white;
    flex-shrink: 0;
}

.certificate-info {
    flex: 1;
}

.certificate-info h4 {
    margin: 0 0 8px 0;
    color: #2d3748;
    font-size: 1.1em;
}

.certificate-info p {
    margin: 2px 0;
    color: #4a5568;
    font-size: 0.85em;
}

.download-cert-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.download-cert-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

/* Overall Progress Styles */
.overall-progress {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #cbd5e0;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    text-align: center;
}

.overall-progress h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.overall-progress-bar {
    width: 0%;
    height: 16px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 8px;
    transition: width 0.8s ease;
    position: relative;
    margin-bottom: 15px;
}

.overall-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.2) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.2) 75%, transparent 75%);
    background-size: 20px 20px;
    animation: progressStripes 1s linear infinite;
    border-radius: 8px;
}

.overall-progress-text {
    font-weight: 600;
    color: #4a5568;
    font-size: 1.1em;
}

/* Level Status Styles */
.level-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.level-status.completed {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.level-status.in-progress {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

/* Progress Checkbox Styles */
.progress-checkbox {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
    cursor: pointer;
    margin-right: 10px;
}

.progress-item-container {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.progress-item-container:hover {
    background-color: #f7fafc;
}

.progress-item-container.completed {
    background-color: #f0fff4;
}

/* Statistics Dashboard */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 5px;
}

.stat-label {
    color: #4a5568;
    font-size: 0.9em;
    font-weight: 500;
}

/* Responsive Design for Progress Elements */
@media (max-width: 768px) {
    .certificate-content {
        width: 95%;
        margin: 20px;
    }
    
    .certificate-badge {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .certificate-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
    
    .certificates-container {
        grid-template-columns: 1fr;
    }
    
    .certificate-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .stats-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .stats-dashboard {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        box-shadow: none;
        border-bottom: 1px solid #eee;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    body {
        flex-direction: column;
    }
}
