/* ========================================
   PYTHON ESSENTIALS EBOOK - STYLES
   Mirrored from PowerShell eBook structure
   Primary: #3776ab (Python Blue)
   Secondary: #ffd43b (Python Yellow)
   Author: Mahammad Haneef
   Date: June 2026
======================================== */

/* ========================================
   GLOBAL STYLES & CSS VARIABLES
======================================== */
:root {
    --primary-blue: #3776ab;
    --primary-dark: #2c5f8a;
    --primary-light: #ffd43b;

    --bg-main: #FFFFFF;
    --bg-sidebar: #F8F9FA;
    --bg-header: linear-gradient(135deg, #1a3a5c 0%, #3776ab 100%);
    --bg-footer: #34495E;
    --bg-code: #1E1E1E;
    --bg-highlight: #FFF9C4;
    --bg-success: #E8F5E9;
    --bg-warning: #FFF3E0;
    --bg-info: #E3F2FD;

    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --text-light: #FFFFFF;
    --text-code: #D4D4D4;

    --success: #4CAF50;
    --warning: #FF9800;
    --error: #F44336;
    --info: #2196F3;

    --header-height: 80px;
    --sidebar-width: 300px;
    --transition-speed: 0.3s;
}

/* Dark Mode */
[data-theme="dark"],
body.dark-mode {
    --bg-main: #1E1E1E;
    --bg-sidebar: #252526;
    --bg-header: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --bg-footer: #252526;
    --text-primary: #E0E0E0;
    --text-secondary: #B0B0B0;
    --bg-success: #1B5E20;
    --bg-warning: #E65100;
    --bg-info: #01579B;
}

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* KEY: body overflow hidden — same as PowerShell eBook */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-main);
    overflow: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ========================================
   HEADER — exact same as PowerShell eBook
======================================== */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--bg-header);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--text-light);
    transition: transform 0.3s ease;
}
.logo:hover { transform: translateY(-2px); }

.logo-icon {
    font-size: 2.5em;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(255,212,59,0.5));
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-8px); }
}

.logo > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.logo > div > div:first-child {
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.book-title {
    font-size: 0.85em;
    opacity: 0.9;
    font-weight: 400;
    color: var(--primary-light);
    letter-spacing: 0.3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}
.header-nav a {
    color: var(--text-light);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95em;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.header-nav a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.header-nav a:hover::before { transform: translateY(0); }
.header-nav a:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.controls { display: flex; gap: 8px; }

.btn-control {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-light);
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.btn-control::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: translate(-50%,-50%);
    transition: width 0.6s, height 0.6s;
}
.btn-control:hover::before { width: 200px; height: 200px; }
.btn-control:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.4);
}
.btn-control:active { transform: translateY(-1px); }

/* Mobile menu toggle */
.mobile-menu-btn {
    display: none;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2em;
}

/* ========================================
   LAYOUT — KEY: fixed viewport, scroll inside content
======================================== */
.container {
    display: flex;
    height: calc(100vh - var(--header-height));
    margin-top: var(--header-height);
    overflow: hidden;
}

/* ========================================
   SIDEBAR
======================================== */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    transition: transform var(--transition-speed) ease,
                width var(--transition-speed) ease;
    flex-shrink: 0;
}

body.dark-mode .sidebar { border-right-color: #333; }

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
body.dark-mode .sidebar::-webkit-scrollbar-thumb { background: #555; }

/* Progress Bar */
.progress-container {
    padding: 15px 20px;
    background: linear-gradient(135deg, #3776ab, #2c5f8a);
    color: white;
}
.progress-bar {
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}
.progress-fill {
    height: 100%;
    background: var(--primary-light);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease;
}
.progress-text {
    font-size: 0.75em;
    opacity: 0.9;
}

/* Search in sidebar */
.search-container {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}
body.dark-mode .search-container { border-bottom-color: #333; }

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.9em;
    outline: none;
    transition: border-color 0.3s ease;
    background: var(--bg-main);
    color: var(--text-primary);
}
.search-input:focus { border-color: var(--primary-blue); }
body.dark-mode .search-input { border-color: #444; }

/* TOC */
.toc-section {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}
body.dark-mode .toc-section { border-bottom-color: #333; }

.toc-section h3 {
    padding: 8px 20px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.toc-chapters a,
.toc-section > a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.88em;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    line-height: 1.35;
}
.toc-chapters a:hover,
.toc-section > a:hover {
    background: rgba(55,118,171,0.08);
    border-left-color: var(--primary-blue);
    color: var(--primary-blue);
    padding-left: 25px;
}
.toc-chapters a.active,
.toc-section > a.active {
    background: rgba(55,118,171,0.12);
    border-left-color: var(--primary-blue);
    color: var(--primary-blue);
    font-weight: 600;
}
.toc-chapters a.completed { color: var(--success); }
.toc-chapters a.completed::after {
    content: ' ✓';
    color: var(--success);
    font-weight: bold;
    margin-left: auto;
}

.chapter-number {
    background: var(--primary-blue);
    color: white;
    font-size: 0.68em;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.toc-chapters a.active .chapter-number { background: var(--primary-dark); }
.toc-chapters a.completed .chapter-number { background: var(--success); }

.sidebar-footer {
    padding: 15px 20px;
    font-size: 0.78em;
    color: var(--text-secondary);
    border-top: 1px solid #e0e0e0;
    line-height: 1.8;
}
body.dark-mode .sidebar-footer { border-top-color: #333; }
.sidebar-footer a { color: var(--primary-blue); }

/* ========================================
   CONTENT AREA — KEY: overflow-y: auto, full height
======================================== */
.content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    padding: 40px 50px;
    background: var(--bg-main);
    transition: background 0.3s ease;
}

.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: #ccc; border-radius: 6px; }
body.dark-mode .content::-webkit-scrollbar-thumb { background: #555; }

/* ========================================
   CHAPTER SECTIONS
======================================== */
.chapter { display: none; }
.chapter.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Chapter Header */
.chapter-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--primary-blue);
}
.chapter-badge {
    display: inline-block;
    background: var(--primary-blue);
    color: white;
    font-size: 0.75em;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}
.chapter-header h1 {
    font-size: 2em;
    font-weight: 800;
    color: var(--primary-blue);
    line-height: 1.2;
    margin-bottom: 8px;
}
body.dark-mode .chapter-header h1 { color: var(--primary-light); }
.chapter-desc {
    color: var(--text-secondary);
    font-size: 1em;
}

/* Hero section (intro page) */
.chapter-hero {
    text-align: center;
    padding: 40px 20px 30px;
}
.chapter-hero-icon {
    font-size: 5em;
    margin-bottom: 15px;
    display: block;
    animation: float 3s ease-in-out infinite;
}
.chapter-hero h1 {
    font-size: 2.5em;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 10px;
}
body.dark-mode .chapter-hero h1 { color: var(--primary-light); }
.hero-subtitle {
    font-size: 1.1em;
    color: var(--text-secondary);
}

/* Headings */
h2 {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 30px 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}
body.dark-mode h2 { color: #90caf9; }

h3 {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--text-primary);
    margin: 20px 0 10px;
}

p { margin-bottom: 15px; }

ul, ol {
    padding-left: 25px;
    margin-bottom: 15px;
}
li { margin-bottom: 6px; }

code {
    background: rgba(55,118,171,0.1);
    color: var(--primary-blue);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
    font-size: 0.9em;
}
body.dark-mode code {
    background: rgba(255,212,59,0.12);
    color: var(--primary-light);
}

/* ========================================
   LEARNING OBJECTIVES
======================================== */
.learning-objectives {
    background: linear-gradient(135deg, rgba(55,118,171,0.08), rgba(255,212,59,0.08));
    border: 1px solid rgba(55,118,171,0.25);
    border-left: 5px solid var(--primary-blue);
    border-radius: 10px;
    padding: 20px 25px;
    margin-bottom: 30px;
}
.learning-objectives h3 {
    color: var(--primary-blue);
    margin-top: 0;
}
body.dark-mode .learning-objectives h3 { color: var(--primary-light); }
.learning-objectives ul { padding-left: 20px; }
.learning-objectives li { margin-bottom: 6px; }

/* ========================================
   CODE BLOCKS
======================================== */
.code-block {
    background: var(--bg-code);
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #3776ab, #2c5f8a);
    color: white;
}
.code-title {
    font-size: 0.85em;
    font-weight: 600;
}
.copy-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 600;
    transition: all 0.3s ease;
}
.copy-btn:hover {
    background: var(--primary-light);
    color: #1e293b;
    border-color: var(--primary-light);
}
.copy-btn.copied {
    background: var(--success);
    border-color: var(--success);
}
.code-block pre {
    padding: 20px 25px;
    overflow-x: auto;
    margin: 0;
}
.code-block pre code {
    background: none;
    color: #d4d4d4;
    font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
    font-size: 0.9em;
    line-height: 1.7;
    padding: 0;
}

/* ========================================
   EXERCISES
======================================== */
.exercises-section { margin: 30px 0; }

.exercise {
    background: var(--bg-success);
    border: 1px solid #c8e6c9;
    border-left: 5px solid var(--success);
    border-radius: 10px;
    padding: 20px 25px;
    margin-bottom: 15px;
}
body.dark-mode .exercise {
    background: rgba(76,175,80,0.1);
    border-color: rgba(76,175,80,0.3);
}
.exercise h3 {
    color: #2e7d32;
    margin-top: 0;
    font-size: 1em;
}
body.dark-mode .exercise h3 { color: #81c784; }
.exercise p { margin-bottom: 10px; }

.hint-btn {
    background: rgba(255,212,59,0.15);
    border: 1px solid var(--primary-light);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s ease;
}
.hint-btn:hover {
    background: var(--primary-light);
    color: #1e293b;
}

/* ========================================
   QUIZ
======================================== */
.quiz-section {
    background: var(--bg-info);
    border: 1px solid #bbdefb;
    border-radius: 10px;
    padding: 25px 30px;
    margin: 30px 0;
}
body.dark-mode .quiz-section {
    background: rgba(33,150,243,0.08);
    border-color: rgba(33,150,243,0.25);
}
.quiz-section > h2 {
    margin-top: 0;
    border-bottom-color: var(--primary-blue);
}

.quiz-question {
    background: var(--bg-main);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 12px;
}
body.dark-mode .quiz-question {
    background: rgba(255,255,255,0.04);
    border-color: #333;
}
.quiz-question p { margin-bottom: 10px; }

.show-answer {
    background: rgba(55,118,171,0.1);
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s ease;
}
.show-answer:hover {
    background: var(--primary-blue);
    color: white;
}

.quiz-answer {
    background: rgba(55,118,171,0.06);
    border-left: 4px solid var(--primary-blue);
    border-radius: 0 6px 6px 0;
    padding: 12px 16px;
    margin-top: 10px;
    font-size: 0.92em;
}
body.dark-mode .quiz-answer {
    background: rgba(55,118,171,0.12);
}
.quiz-answer code {
    background: rgba(55,118,171,0.1);
    color: var(--primary-blue);
}
body.dark-mode .quiz-answer code {
    background: rgba(255,212,59,0.1);
    color: var(--primary-light);
}

/* ========================================
   TAKEAWAYS / KEY POINTS
======================================== */
.takeaways-box {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
    color: white;
    border-radius: 10px;
    padding: 20px 25px;
    margin: 25px 0;
}
.takeaways-box h3 {
    color: var(--primary-light);
    margin-top: 0;
}
.takeaways-box ul { padding-left: 20px; }
.takeaways-box li { margin-bottom: 6px; opacity: 0.92; }
.takeaways-box code {
    background: rgba(255,255,255,0.15);
    color: var(--primary-light);
}

/* ========================================
   SPECIAL BOXES
======================================== */
.tip-box {
    background: var(--bg-success);
    border: 1px solid #c8e6c9;
    border-left: 5px solid var(--success);
    border-radius: 10px;
    padding: 18px 22px;
    margin: 20px 0;
}
body.dark-mode .tip-box {
    background: rgba(76,175,80,0.08);
    border-color: rgba(76,175,80,0.3);
}
.tip-box h3 { color: #2e7d32; margin-top: 0; }
body.dark-mode .tip-box h3 { color: #81c784; }
.tip-box kbd {
    background: var(--bg-code);
    color: var(--primary-light);
    padding: 2px 7px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85em;
    border: 1px solid #444;
}

.warning-box {
    background: var(--bg-warning);
    border: 1px solid #ffe0b2;
    border-left: 5px solid var(--warning);
    border-radius: 10px;
    padding: 18px 22px;
    margin: 20px 0;
}
body.dark-mode .warning-box {
    background: rgba(255,152,0,0.08);
    border-color: rgba(255,152,0,0.3);
}
.warning-box h3 { color: #e65100; margin-top: 0; }

/* ========================================
   FEATURE / INFO GRIDS
======================================== */
.feature-grid,
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin: 20px 0;
}
.feature-card,
.info-card {
    background: var(--bg-main);
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
body.dark-mode .feature-card,
body.dark-mode .info-card {
    background: rgba(255,255,255,0.04);
    border-color: #333;
}
.feature-card:hover,
.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.feature-icon,
.info-icon { font-size: 2em; margin-bottom: 8px; }
.feature-card h4,
.info-card h3 {
    font-size: 0.9em;
    color: var(--primary-blue);
    margin-bottom: 6px;
}
body.dark-mode .feature-card h4,
body.dark-mode .info-card h3 { color: var(--primary-light); }
.feature-card p,
.info-card p {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================
   COMPARISON TABLE
======================================== */
.comparison-table { overflow-x: auto; margin: 20px 0; }
.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-main);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.comparison-table th {
    background: var(--primary-blue);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.9em;
}
.comparison-table td {
    padding: 11px 16px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.88em;
}
body.dark-mode .comparison-table td { border-bottom-color: #333; }
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table tr:hover td { background: rgba(55,118,171,0.04); }

/* ========================================
   LEARNING PATH
======================================== */
.learning-path {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    justify-content: center;
}
.path-item { text-align: center; }
.path-badge {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85em;
    margin-bottom: 4px;
}
.path-badge.beginner     { background: rgba(76,175,80,0.12);  color: #2e7d32; border: 2px solid #4caf50; }
.path-badge.intermediate { background: rgba(55,118,171,0.12); color: var(--primary-blue); border: 2px solid var(--primary-blue); }
.path-badge.advanced     { background: rgba(156,39,176,0.12); color: #7b1fa2; border: 2px solid #9c27b0; }
.path-badge.practical    { background: rgba(255,152,0,0.12);  color: #e65100; border: 2px solid #ff9800; }
.path-item p { font-size: 0.78em; color: var(--text-secondary); margin: 0; }
.path-arrow { font-size: 1.5em; color: var(--text-secondary); }

/* ========================================
   COMING SOON
======================================== */
.coming-soon {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.cs-icon { font-size: 4em; margin-bottom: 15px; }
.coming-soon h2 {
    color: var(--primary-blue);
    border: none;
    display: block;
    margin-bottom: 10px;
}
body.dark-mode .coming-soon h2 { color: var(--primary-light); }
.coming-soon p { margin-bottom: 20px; }

/* ========================================
   CHAPTER NAVIGATION
======================================== */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}
body.dark-mode .chapter-nav { border-top-color: #333; }

.nav-btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 700;
    transition: all 0.3s ease;
}
.prev-btn {
    background: var(--bg-main);
    border: 2px solid #e0e0e0;
    color: var(--text-primary);
}
.prev-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}
body.dark-mode .prev-btn { border-color: #444; }

.next-btn {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(55,118,171,0.3);
}
.next-btn:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 18px rgba(55,118,171,0.4);
}
.mark-btn {
    background: rgba(76,175,80,0.1);
    border: 2px solid var(--success);
    color: var(--success);
}
.mark-btn:hover { background: var(--success); color: white; }
.mark-btn.done  { background: var(--success); color: white; }
.mark-btn:disabled { cursor: default; opacity: 0.8; }

/* ========================================
   SCROLL TO TOP BUTTON
======================================== */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2em;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(55,118,171,0.4);
    transition: all 0.3s ease;
    display: none;
    z-index: 500;
    align-items: center;
    justify-content: center;
}
.scroll-top-btn.visible { display: flex; }
.scroll-top-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ========================================
   NOTIFICATION TOAST
======================================== */
.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 22px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 0.9em;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    z-index: 9999;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid var(--primary-light);
    max-width: 320px;
}
.notification.success { background: linear-gradient(135deg, #3776ab, #2c5f8a); }
.notification.error   { background: linear-gradient(135deg, #f44336, #c62828); }
.notification.info    { background: linear-gradient(135deg, #2196f3, #1565c0); }

@keyframes slideInRight {
    from { transform: translateX(100px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}

/* ========================================
   RESPONSIVE — MOBILE
======================================== */
@media (max-width: 768px) {
    :root { --header-height: 60px; }

    .header { padding: 0 15px; }
    .header-nav { display: none; }
    .mobile-menu-btn { display: block; }
    .logo-icon { font-size: 1.8em; }
    .logo > div > div:first-child { font-size: 1.1em; }
    .book-title { display: none; }
    .controls { gap: 5px; }
    .btn-control { padding: 8px 10px; font-size: 0.95em; }

    /* Sidebar becomes off-canvas drawer */
    .sidebar {
        position: fixed;
        top: var(--header-height);
        left: 0;
        bottom: 0;
        z-index: 900;
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0,0,0,0.2);
    }
    .sidebar.open { transform: translateX(0); }

    /* Content fills full width */
    .content {
        padding: 20px 18px;
    }

    .chapter-header h1 { font-size: 1.5em; }
    .chapter-hero h1   { font-size: 1.8em; }
    .chapter-hero-icon { font-size: 3.5em; }

    .feature-grid,
    .info-grid { grid-template-columns: repeat(2, 1fr); }

    .learning-path { flex-direction: column; }
    .path-arrow { transform: rotate(90deg); }

    .chapter-nav { flex-direction: column; }
    .nav-btn { width: 100%; text-align: center; }

    .scroll-top-btn { bottom: 15px; right: 15px; }
}

@media (max-width: 480px) {
    .feature-grid,
    .info-grid { grid-template-columns: 1fr; }
    .content { padding: 15px 12px; }
    .btn-control { padding: 7px 9px; font-size: 0.88em; }
}