/* ═══════════════════════════════════════════════════════════════
   CSS Variables & Reset (Phase 1, Step 1 & 2)
═══════════════════════════════════════════════════════════════ */
:root {
    /* Color Palette - CSS Theme (Dark Default) */
    --bg-main: #0f172a;        
    --bg-surface: #1e293b;     
    --bg-surface-hover: #334155; 
    
    --text-main: #f8fafc;      
    --text-muted: #94a3b8;     
    
    --primary: #3b82f6;        /* CSS Official Blue */
    --primary-hover: #2563eb;  
    --accent: #ec4899;         /* Rose/Pink accent for CSS */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --border: #334155;
    --border-light: rgba(255, 255, 255, 0.1);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    
    /* Layout Dimensions */
    --sidebar-width: 320px;
    --header-height: 70px;
    --content-max-width: 900px;
    
    /* Transitions */
    --trans-fast: 0.2s ease;
    --trans-normal: 0.3s ease;
    --trans-theme: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    
    /* Typography */
    --font-en: 'Inter', system-ui, -apple-system, sans-serif;
    --font-code: 'JetBrains Mono', ui-monospace, monospace;
}

[data-theme="light"] {
    --bg-main: #f8fafc;        
    --bg-surface: #ffffff;     
    --bg-surface-hover: #f1f5f9; 
    
    --text-main: #0f172a;      
    --text-muted: #475569;     
    
    --border: #e2e8f0;         
    --border-light: rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: var(--font-en);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
    overflow: hidden; 
    transition: var(--trans-theme);
}

/* Typography Base */
h1, h2, h3, h4 { color: var(--text-main); font-weight: 700; line-height: 1.4; transition: var(--trans-theme); }
p { margin-bottom: 1.2rem; transition: var(--trans-theme); }
a { color: var(--primary); text-decoration: none; transition: color var(--trans-fast); }
a:hover { color: var(--primary-hover); }
.en-text { font-family: var(--font-en); direction: ltr; display: inline-block; }

code {
    font-family: var(--font-code);
    background-color: var(--bg-main);
    color: var(--accent); 
    padding: 0.2em 0.4em;
    border-radius: 6px;
    font-size: 0.85em;
    border: 1px solid var(--border);
    direction: ltr;
    display: inline-block;
    transition: var(--trans-theme);
}
[data-theme="light"] code { background-color: #f1f5f9; color: #db2777; }

/* Themes for elements */
.sidebar, .topbar, .lesson-card, .sidebar-header, .sidebar-footer {
    transition: var(--trans-theme);
}

[data-theme="light"] .topbar {
    background-color: rgba(255, 255, 255, 0.8);
}
.sidebar-search input { transition: var(--trans-theme); }

/* ═══════════════════════════════════════════════════════════════
   Main Layout Structure
═══════════════════════════════════════════════════════════════ */
.app-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: right var(--trans-normal);
    z-index: 50;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
}

.logo { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; }

.sidebar-search { padding: 20px; }
.sidebar-search input {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 8px;
    font-family: var(--font-en);
    font-size: 0.95rem;
    outline: none;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.nav-section { margin-bottom: 24px; }
.nav-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 700;
}
.sidebar-nav ul { list-style: none; }
.sidebar-nav li { margin-bottom: 4px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: var(--text-muted);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all var(--trans-fast);
}
.sidebar-nav a:hover { background-color: var(--bg-surface-hover); color: var(--text-main); }
.sidebar-nav li.active a {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    font-weight: 500;
}
.nav-icon { margin-left: 10px; font-size: 1.1rem; }

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    background-color: var(--border-light);
}
.progress-info { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.progress-bar { height: 6px; background-color: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background-color: var(--primary); border-radius: 3px; transition: width 0.5s ease; }

/* Main Area */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--header-height);
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 40;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.menu-toggle { display: none; background: none; border: none; color: var(--text-main); font-size: 1.5rem; cursor: pointer; }
.breadcrumbs { font-size: 0.9rem; color: var(--text-muted); display: flex; gap: 8px; }
.crumb.current { color: var(--primary); font-weight: 500; }

.topbar-actions { display: flex; gap: 12px; }
.icon-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 40px; height: 40px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all var(--trans-fast);
}
.icon-btn:hover { background: var(--bg-surface-hover); border-color: var(--text-muted); }

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 40px 30px;
    scroll-behavior: smooth;
}
.content-area::-webkit-scrollbar { width: 8px; }
.content-area::-webkit-scrollbar-track { background: var(--bg-main); }
.content-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.content-area::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.content-container { max-width: var(--content-max-width); margin: 0 auto; }
.chapter-badge { display: inline-block; background-color: rgba(236, 72, 153, 0.15); color: var(--accent); padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; margin-bottom: 16px; }
.page-title { font-size: 2.5rem; font-weight: 800; margin-bottom: 16px; }
.page-description { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 40px; }

/* ═══════════════════════════════════════════════════════════════
   Overlays and Media Queries (Foolproof Design)
═══════════════════════════════════════════════════════════════ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 45;
    opacity: 0;
    transition: opacity var(--trans-normal);
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        right: -320px; /* Hidden perfectly in RTL */
        top: 0;
        bottom: 0;
        box-shadow: none;
    }

    .sidebar.open {
        right: 0;
        box-shadow: -5px 0 25px rgba(0,0,0,0.5);
    }

    .menu-toggle { display: block; }
    .close-btn { display: flex !important; }
    
    .topbar { padding: 0 20px; }
    .content-area { padding: 30px 20px; }
}

@media (max-width: 576px) {
    .page-title { font-size: 1.8rem; }
    .breadcrumbs { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   The Ultimate Close Button
═══════════════════════════════════════════════════════════════ */
.close-btn {
    display: none;
    z-index: 2147483647;
    background: #e11d48 !important;
    border: none !important;
    color: white !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    font-size: 2rem !important;
    line-height: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
}

.close-btn:active {
    transform: scale(0.9) !important;
}
/* ═══════════════════════════════════════════════════════════════
   Live Code Editor (Phase 1, Step 4 & 5)
═══════════════════════════════════════════════════════════════ */
.live-editor { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin: 32px 0; box-shadow: var(--shadow-md); background: var(--bg-main); transition: var(--trans-theme); }
.le-header { display: flex; justify-content: space-between; align-items: center; background: var(--bg-surface); padding: 8px 20px; border-bottom: 1px solid var(--border); direction: ltr; transition: var(--trans-theme); }

.le-tabs { display: flex; gap: 4px; }
.le-tab { background: transparent; color: var(--text-muted); border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-family: var(--font-en); font-size: 0.85rem; font-weight: 600; transition: all var(--trans-fast); outline: none; }
.le-tab.active { background: rgba(37, 99, 235, 0.15); color: var(--primary); }
.le-tab:hover:not(.active) { background: var(--bg-surface-hover); color: var(--text-main); }

.le-actions { display: flex; gap: 8px; direction: ltr; }
.le-btn { display: flex; align-items: center; gap: 6px; background: var(--bg-main); color: var(--text-main); border: 1px solid var(--border); padding: 6px 12px; border-radius: 6px; font-family: var(--font-en); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all var(--trans-fast); }
.le-btn:hover { background: var(--bg-surface-hover); border-color: var(--text-muted); }
.le-btn:active { transform: scale(0.95); }
.le-btn.primary { background: var(--primary); color: white; border-color: var(--primary); }
.le-btn.primary:hover { background: var(--primary-hover); }

.le-body { display: flex; flex-direction: column; min-height: 350px; }
@media (min-width: 768px) { .le-body { flex-direction: row; height: 400px; } }

.le-code, .le-preview { flex: 1; display: flex; flex-direction: column; width: 100%; }
.le-code { border-bottom: 1px solid var(--border); position: relative; background: #0d1117; overflow: hidden; }
@media (min-width: 768px) { .le-code { border-bottom: none; border-right: 1px solid var(--border); } }

.le-editor-wrapper { position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.le-editor-wrapper.active { opacity: 1; pointer-events: auto; }

.le-textarea, .le-highlight { position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; padding: 20px; margin: 0; font-family: var(--font-code); font-size: 0.95rem; line-height: 1.6; tab-size: 4; white-space: pre; overflow-wrap: normal; overflow: auto; direction: ltr; border: none; outline: none; }
.le-textarea { color: transparent; background: transparent; caret-color: #f8fafc; z-index: 2; resize: none; }
.le-textarea::selection { background: rgba(121, 192, 255, 0.25); color: transparent; }
.le-code:focus-within { box-shadow: inset 0 0 0 2px var(--primary); }

.le-highlight { color: #c9d1d9; z-index: 1; pointer-events: none; }

/* CSS Syntax */
.css-hl .hl-selector { color: #ff7b72; }
.css-hl .hl-prop { color: #79c0ff; }
.css-hl .hl-val { color: #a5d6ff; }
.css-hl .hl-punct { color: #c9d1d9; }
.css-hl .hl-comment { color: #8b949e; font-style: italic; }

/* HTML Syntax */
.html-hl .hl-tag { color: #7ee787; }
.html-hl .hl-attr { color: #79c0ff; }
.html-hl .hl-string { color: #a5d6ff; }
.html-hl .hl-punct { color: #8b949e; }
.html-hl .hl-comment { color: #8b949e; font-style: italic; }

.le-preview { background: #fff; }
.le-iframe { flex: 1; width: 100%; height: 100%; border: none; }

/* ═══════════════════════════════════════════════════════════════
   Edu Boxes & Progress
═══════════════════════════════════════════════════════════════ */
.edu-box { display: flex; gap: 16px; padding: 20px; border-radius: 10px; margin: 24px 0; line-height: 1.7; position: relative; overflow: hidden; transition: var(--trans-theme); }
.edu-box::before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 4px; }
.edu-icon { font-size: 1.6rem; flex-shrink: 0; line-height: 1; }
.edu-content { flex: 1; }
.edu-title { display: block; font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }

.edu-info { background-color: rgba(16, 185, 129, 0.08); }
.edu-info::before { background-color: var(--success); }
.edu-info .edu-title { color: var(--success); }
[data-theme="dark"] .edu-info .edu-title { color: #34d399; }

/* Progress System */
.btn-complete { display: flex; align-items: center; gap: 8px; background: transparent; color: var(--text-muted); border: 1px solid var(--border); padding: 10px 24px; border-radius: 8px; font-family: var(--font-en); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all var(--trans-fast); }
.btn-complete:hover { border-color: var(--success); color: var(--success); }
.btn-complete.is-completed { background: rgba(5, 150, 105, 0.1); border-color: var(--success); color: var(--success); }
.btn-complete:active { transform: scale(0.96); }

.sidebar-nav li.is-completed a { color: var(--success); }
.sidebar-nav li.is-completed a::after { content: '✓'; margin-right: auto; font-weight: bold; font-size: 1.1em; }

.btn-nav { font-family: var(--font-en); font-size: 0.95rem; font-weight: 500; }
.btn-nav:hover { filter: brightness(1.1); }

.fade-enter { animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }


/* ═══════════════════════════════════════════════════════════════
   Quiz System (Phase 2)
═══════════════════════════════════════════════════════════════ */
.quiz-container { background-color: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; padding: 30px; margin: 40px 0; box-shadow: var(--shadow-md); transition: var(--trans-theme); }
.quiz-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px dashed var(--border); }
.quiz-icon { font-size: 2rem; }
.quiz-title { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.quiz-question { font-size: 1.15rem; font-weight: 600; margin-bottom: 20px; line-height: 1.6; }
.quiz-options { display: flex; flex-direction: column; gap: 12px; }
.quiz-option { display: flex; align-items: center; padding: 16px 20px; background-color: var(--bg-main); border: 2px solid var(--border); border-radius: 8px; cursor: pointer; transition: all var(--trans-fast); font-weight: 500; }
.quiz-option:hover:not(.answered) { border-color: var(--primary); background-color: rgba(37, 99, 235, 0.05); transform: translateX(-4px); }
.quiz-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--text-muted); margin-left: 16px; display: flex; justify-content: center; align-items: center; transition: all var(--trans-fast); }
.quiz-option:hover:not(.answered) .quiz-radio { border-color: var(--primary); }
.quiz-radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background-color: var(--primary); transform: scale(0); transition: transform var(--trans-fast); }
.quiz-option.selected .quiz-radio { border-color: var(--primary); }
.quiz-option.selected .quiz-radio::after { transform: scale(1); }
.quiz-option.correct { border-color: var(--success); background-color: rgba(16, 185, 129, 0.1); }
.quiz-option.correct .quiz-radio { border-color: var(--success); }
.quiz-option.correct .quiz-radio::after { background-color: var(--success); transform: scale(1); }
.quiz-option.wrong { border-color: var(--danger); background-color: rgba(239, 68, 68, 0.1); }
.quiz-option.wrong .quiz-radio { border-color: var(--danger); }
.quiz-option.wrong .quiz-radio::after { background-color: var(--danger); transform: scale(1); }
.quiz-feedback { margin-top: 20px; padding: 16px; border-radius: 8px; display: none; font-weight: 500; line-height: 1.6; animation: fadeIn 0.4s ease; }
.quiz-feedback.success { display: block; background-color: rgba(16, 185, 129, 0.1); color: var(--success); border-right: 4px solid var(--success); }
.quiz-feedback.error { display: block; background-color: rgba(239, 68, 68, 0.1); color: var(--danger); border-right: 4px solid var(--danger); }
.quiz-submit-wrapper { margin-top: 24px; display: flex; justify-content: flex-end; }
.btn-quiz-submit { background-color: var(--primary); color: white; border: none; padding: 12px 28px; border-radius: 8px; font-family: inherit; font-weight: 600; font-size: 1rem; cursor: pointer; transition: all var(--trans-fast); opacity: 0.5; pointer-events: none; }
.btn-quiz-submit.active { opacity: 1; pointer-events: auto; }
.btn-quiz-submit.active:hover { background-color: var(--primary-hover); transform: translateY(-2px); }


/* ═══════════════════════════════════════════════════════════════
   Modals & Enterprise Features (Phase 5/6)
═══════════════════════════════════════════════════════════════ */
.search-modal { position: fixed; top: 20%; left: 50%; transform: translateX(-50%) translateY(-20px); width: 90%; max-width: 600px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); z-index: 100; opacity: 0; visibility: hidden; transition: all 0.3s; display: flex; flex-direction: column; }
.search-modal.active { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.search-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(4px); z-index: 99; opacity: 0; visibility: hidden; transition: all 0.3s; }
.search-modal-overlay.active { opacity: 1; visibility: visible; }
.search-input-wrapper { position: relative; padding: 20px; border-bottom: 1px solid var(--border); }
.search-input-wrapper input { width: 100%; background: transparent; border: none; font-size: 1.2rem; color: var(--text-main); font-family: var(--font-en); outline: none; }
.search-results { max-height: 400px; overflow-y: auto; padding: 10px; }
.search-item { padding: 15px; border-radius: 8px; cursor: pointer; transition: background var(--trans-fast); }
.search-item:hover { background: rgba(37, 99, 235, 0.1); }
.search-item-badge { font-size: 0.75rem; background: var(--border); padding: 2px 8px; border-radius: 12px; margin-left: 8px; }
.search-item-title { font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.search-item-desc { font-size: 0.9rem; color: var(--text-muted); }
.search-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); }
.shortcut-hint { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); background: var(--bg-main); border: 1px solid var(--border); padding: 4px 8px; border-radius: 6px; font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-en); pointer-events: none; }

.bookmarks-panel { position: fixed; left: -320px; top: 0; bottom: 0; width: 320px; background: var(--bg-surface); border-right: 1px solid var(--border); z-index: 60; transition: all var(--trans-normal); display: flex; flex-direction: column; }
.bookmarks-panel.open { left: 0; box-shadow: 5px 0 25px rgba(0,0,0,0.5); }
.bookmarks-header { height: var(--header-height); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--border); font-weight: 700; }
.bookmarks-list { flex: 1; overflow-y: auto; padding: 10px; }
.bookmark-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 8px; cursor: pointer; transition: background var(--trans-fast); }
.bookmark-item:hover { background: var(--bg-main); border-color: var(--accent); }
.bookmark-remove { color: var(--danger); background: none; border: none; cursor: pointer; font-size: 1.2rem; padding: 4px; }

.cheat-sheet-btn { position: fixed; bottom: 30px; right: 30px; background: var(--accent); color: white; width: 60px; height: 60px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.8rem; box-shadow: 0 10px 15px -3px rgba(236, 72, 153, 0.4); cursor: pointer; z-index: 90; transition: all var(--trans-fast); border: none; outline: none; }
.cheat-sheet-btn:hover { transform: translateY(-5px) scale(1.05); background: #be185d; box-shadow: 0 20px 25px -5px rgba(236, 72, 153, 0.5); }
.cheat-sheet-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-main); z-index: 1000; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.cheat-sheet-modal.open { transform: translateY(0); }
.cs-header { background: var(--bg-surface); padding: 20px 30px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.cs-title { display: flex; align-items: center; gap: 15px; font-size: 1.5rem; font-weight: 800; color: var(--accent); }
.cs-close { background: var(--bg-main); border: 1px solid var(--border); color: var(--text-main); width: 40px; height: 40px; border-radius: 50%; font-size: 1.5rem; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: all var(--trans-fast); }
.cs-close:hover { background: var(--danger); color: white; border-color: var(--danger); transform: rotate(90deg); }
.cs-content { flex: 1; overflow-y: auto; padding: 30px; }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; max-width: 1400px; margin: 0 auto; }
.cs-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.cs-card h3 { color: var(--primary); border-bottom: 2px dashed var(--border); padding-bottom: 10px; margin-bottom: 15px; font-size: 1.1rem; }
.cs-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.cs-item:last-child { border-bottom: none; }
.cs-tag { font-family: var(--font-code); color: #7ee787; background: rgba(126, 231, 135, 0.1); padding: 2px 8px; border-radius: 4px; font-size: 0.9rem; direction: ltr; }
.cs-desc { color: var(--text-muted); font-size: 0.9rem; }

@media print {
    body * { visibility: hidden !important; }
    #certificateNode, #certificateNode * { visibility: visible !important; }
    #certificateNode { position: absolute; left: 0; top: 0; width: 100%; margin: 0; padding: 0; box-shadow: none; border: none; }
    .cert-border { border-color: #000; background: none; }
    .cert-name { color: #000; text-shadow: none; }
}


/* ═══════════════════════════════════════════════════════════════
   Toast Notification System (Bonus)
═══════════════════════════════════════════════════════════════ */
.toast-notification {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success);
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    z-index: 100000;
    transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: var(--font-en);
    font-weight: bold;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
    pointer-events: none;
}

.toast-notification.show {
    bottom: 30px;
}

/* Hover effects for cheat sheet items to show they are copyable */
.cs-item {
    cursor: pointer;
}
.cs-item:hover .cs-tag {
    background: rgba(126, 231, 135, 0.3);
}


.btn-bookmark-chapter {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 8px;
    font-family: var(--font-en);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--trans-fast);
}

.btn-bookmark-chapter:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.btn-bookmark-chapter.is-bookmarked {
    background: rgba(236, 72, 153, 0.1);
    color: var(--accent);
    border-color: var(--accent);
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
