/*
Theme Name: Jupyter Notes
Theme URI: https://learnoye.com
Author: Learnoye
Author URI: https://learnoye.com
Description: A Jupyter Notebook inspired dark theme for note-taking and learning documentation with automatic syntax highlighting. Optimized for mobile with app-like interface.
Version: 1.4.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jupyter-notes
Tags: dark, blog, education, code, notebook, syntax-highlighting, learning, mobile-friendly, responsive

This theme is inspired by Jupyter Notebook's dark mode interface with Atom One Dark syntax highlighting.
*/

/* Base Variables - Jupyter Dark + Material Teal Theme */
:root {
    /* Jupyter Notebook Dark Colors - with Teal accent */
    --notebook-bg: #1e1e1e;
    --cell-bg: #2b2b2b;
    --cell-border: rgba(0, 150, 136, 0.25);  /* Teal-tinted border instead of pure gray */
    --text-primary: #d4d4d4;
    --text-secondary: #858585;

    /* Material Design Teal Colors - Primary Theme */
    --teal-50: #e0f2f1;
    --teal-100: #b2dfdb;
    --teal-200: #80cbc4;
    --teal-300: #4db6ac;
    --teal-400: #26a69a;
    --teal-500: #009688;  /* Primary accent color */
    --teal-600: #00897b;
    --teal-700: #00796b;
    --teal-800: #00695c;
    --teal-900: #004d40;

    /* Primary colors - using Teal */
    --primary-color: var(--teal-500);
    --primary-light: var(--teal-400);
    --primary-dark: var(--teal-600);
    --accent-color: var(--teal-500);

    /* Legacy color variables (redirected to teal) */
    --accent-blue: var(--teal-500);
    --accent-green: #98c379;
    --prompt-color: var(--teal-500);

    /* Teal-tinted border and background colors */
    --cell-bg-teal: rgba(0, 150, 136, 0.05);
    --cell-border-teal: rgba(0, 150, 136, 0.2);

    /* Atom One Dark Code Colors */
    --atom-bg: #282c34;
    --atom-fg: #abb2bf;
    --atom-red: #e06c75;
    --atom-orange: #d19a66;
    --atom-yellow: #e5c07b;
    --atom-green: #98c379;
    --atom-cyan: #56b6c2;
    --atom-blue: #61afef;
    --atom-purple: #c678dd;
    --atom-gray: #5c6370;

    /* Spacing */
    --cell-padding: 16px;
    --cell-margin: 8px;

    /* Fonts */
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--notebook-bg);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-light);
    text-decoration: none;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.screen-reader-text:focus {
    clip: auto;
    height: auto;
    width: auto;
    margin: 0;
    padding: 10px;
    background: var(--primary-color);
    color: #ffffff;
    z-index: 1000;
}

/* Container Layout */
.site-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 0px !important;
    padding-bottom: 0px !important;
}

/* Two-Column Layout: Content + Sidebar */
.content-wrapper {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-main {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

@media (max-width: 968px) {
    .content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}

/* Header Styles - Teal App Bar */
.site-header {
    background: linear-gradient(135deg, var(--teal-600) 0%, var(--teal-500) 50%, var(--teal-400) 100%);
    border-bottom: none;
    padding: 6px 0;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.site-branding {
    flex-shrink: 0;
}

.site-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.site-title a {
    color: #ffffff;
}

.site-title a:hover {
    color: var(--teal-50);
    text-decoration: none;
}

.site-description {
    display: none;
}

/* Navigation - Horizontal */
.main-navigation {
    margin: 0;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    margin: 0;
}

.main-navigation a {
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 3px;
    transition: background-color 0.2s, color 0.2s;
    font-size: 13px;
    display: block;
    line-height: 1;
}

.main-navigation a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    text-decoration: none;
}

/* ============================================================================
   MEGA MENU STYLES
   ============================================================================ */

.menu-item {
    position: relative;
}

.menu-item-home {
    margin-right: 12px;
    padding-right: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* Menu with children indicator */
.menu-item-has-children > .menu-link::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 8px;
    vertical-align: middle;
    transition: transform 0.2s ease;
}

.menu-item-has-children > .menu-link:hover::after,
.menu-item-has-children:hover > .menu-link::after {
    transform: translateY(2px);
}

/* Menu icons */
.menu-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    font-size: 14px;
}

.menu-icon-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(0, 150, 136, 0.3);
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    color: #00998d;
    margin-right: 6px;
}

.menu-label {
    display: inline-block;
}

/* Mega Menu Submenu Container */
.mega-menu-submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    width: 680px;
    max-width: 95vw;
    background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
    border: 1px solid rgba(0, 150, 136, 0.2);
    border-top: 2px solid rgba(0, 150, 136, 0.4);
    border-radius: 8px;
    padding: 20px;
    margin-top: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Show mega menu on hover */
.menu-item-has-children:hover > .mega-menu-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Mega Menu Grid Layout */
.mega-menu-submenu .mega-menu-grid,
.main-navigation .mega-menu-grid {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-auto-rows: auto !important;
    gap: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    /* Explicitly disable flex properties */
    flex-direction: unset !important;
    flex-wrap: unset !important;
    align-items: unset !important;
    justify-content: unset !important;
}

/* Mega Menu Items */
.mega-menu-item {
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 0;
    box-sizing: border-box;
}

.mega-menu-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 80px;
    background: rgba(0, 150, 136, 0.05);
    border: 1px solid rgba(0, 150, 136, 0.1);
    box-sizing: border-box;
    width: 100%;
}

.mega-menu-link:hover {
    background-color: rgba(0, 150, 136, 0.15);
    color: #00998d;
    border-color: rgba(0, 150, 136, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 150, 136, 0.15);
}

/* Mega Menu Icons */
.mega-menu-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0;
    font-size: 20px;
    flex-shrink: 0;
}

.mega-menu-icon-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #00998d 0%, #26a69a 100%);
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-right: 0;
    flex-shrink: 0;
}

/* Mega Menu Label */
.mega-menu-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.3;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Mega Menu Count Badge */
.mega-menu-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    background: rgba(0, 150, 136, 0.3);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    color: #00998d;
    padding: 0 8px;
    margin-left: 0;
    margin-top: 4px;
    flex-shrink: 0;
}

.mega-menu-link:hover .mega-menu-count {
    background: rgba(0, 150, 136, 0.6);
    color: #ffffff;
}

/* Scrollbar styling for mega menu */
.mega-menu-submenu::-webkit-scrollbar {
    width: 6px;
}

.mega-menu-submenu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.mega-menu-submenu::-webkit-scrollbar-thumb {
    background: rgba(0, 150, 136, 0.3);
    border-radius: 3px;
}

.mega-menu-submenu::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 150, 136, 0.5);
}

@media (max-width: 768px) {
    .header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .main-navigation ul {
        flex-wrap: wrap;
        width: 100%;
    }
}

/* Notebook/Category Title */
.notebook-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    padding-left: var(--cell-padding);
}

.notebook-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding-left: var(--cell-padding);
    font-style: italic;
}

/* Cell (Post) Container */
.notebook-cell {
    background-color: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 4px;
    margin-bottom: var(--cell-margin);
    overflow: hidden;
    transition: border-color 0.2s;
}

.notebook-cell:hover {
    border-color: rgba(0, 150, 136, 0.4);
}

.notebook-cell.focused {
    border-color: rgba(0, 150, 136, 0.4);
    box-shadow: 0 0 0 1px #555555;
}

.accordion-cell {
    position: relative;
}

.accordion-cell.is-expanded {
    border-color: rgba(0, 150, 136, 0.4);
}

.accordion-cell .accordion-panel {
    display: block;
}

.accordion-cell.is-collapsed .accordion-panel {
    display: none;
}

.cell-accordion-toggle {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--cell-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s, transform 0.1s;
}

.cell-accordion-toggle:hover,
.cell-accordion-toggle:focus-visible {
    border-color: rgba(0, 150, 136, 0.4);
    color: #888888;
    background-color: rgba(85, 85, 85, 0.2);
    outline: none;
    transform: scale(1.05);
}

.cell-accordion-toggle:focus-visible {
    box-shadow: 0 0 0 2px rgba(85, 85, 85, 0.35);
}

.cell-accordion-toggle .toggle-icon {
    position: relative;
    width: 14px;
    height: 14px;
    display: block;
}

.cell-accordion-toggle .toggle-icon::before,
.cell-accordion-toggle .toggle-icon::after {
    content: '';
    position: absolute;
    background-color: currentColor;
    border-radius: 1px;
    transition: opacity 0.2s;
}

.cell-accordion-toggle .toggle-icon::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    transform: translateY(-50%);
}

.cell-accordion-toggle .toggle-icon::after {
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
}

.accordion-cell.is-expanded .cell-accordion-toggle .toggle-icon::after {
    opacity: 0;
}

/* Cell Header */
.cell-header {
    display: flex;
    align-items: center;
    padding: 12px var(--cell-padding);
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--cell-border);
    gap: 10px;
    min-height: 68px;
}

.cell-prompt {
    display: none; /* Hidden - not needed */
}

.cell-title {
    flex: 1;
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1.3;
    margin: 0;
    min-width: 0; /* Allow text to shrink */
    overflow: hidden;
}

.cell-title a {
    color: var(--primary-color);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cell-title a:hover {
    color: var(--primary-light);
}

/* Single post title - even bigger */
.single .cell-title {
    font-size: 28px;
    font-weight: 700;
}

.cell-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cell-meta {
    font-size: 10px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* Circular Audio Play Button */
.audio-play-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: background-color 0.2s, transform 0.1s;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.audio-play-btn-icon:hover {
    background-color: var(--primary-light);
    transform: scale(1.1);
}

.audio-play-btn-icon.playing {
    background-color: var(--accent-green);
    animation: pulse 2s ease-in-out infinite;
}

.audio-play-btn-icon.playing:hover {
    background-color: var(--atom-green);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }
    50% { box-shadow: 0 2px 8px rgba(152, 195, 121, 0.5); }
}

.audio-play-btn-icon .play-icon,
.audio-play-btn-icon .pause-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.audio-element {
    display: none;
}

/* Large Audio Play Button in Header */
.audio-play-btn-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-500), var(--teal-600));
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(0, 150, 136, 0.4);
    position: relative;
    flex-shrink: 0;
}

.audio-play-btn-large::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.audio-play-btn-large:hover {
    transform: scale(1.15);
    box-shadow: 0 5px 16px rgba(0, 150, 136, 0.6);
}

.audio-play-btn-large:hover::before {
    opacity: 0.5;
}

.audio-play-btn-large.playing {
    background: linear-gradient(135deg, var(--accent-green), var(--atom-green));
    animation: pulse-large 2s ease-in-out infinite;
}

.audio-play-btn-large.playing::before {
    opacity: 1;
    animation: ripple 2s ease-in-out infinite;
}

@keyframes pulse-large {
    0%, 100% {
        box-shadow: 0 3px 8px rgba(0, 150, 136, 0.4);
    }
    50% {
        box-shadow: 0 5px 16px rgba(152, 195, 121, 0.6);
    }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.audio-play-btn-large .play-icon-large,
.audio-play-btn-large .pause-icon-large {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 3px; /* Center the play triangle visually */
}

.audio-play-btn-large .pause-icon-large {
    padding-left: 0;
}

/* Cell Content */
.cell-content {
    padding: var(--cell-padding);
}

.cell-excerpt {
    color: var(--text-secondary);
    font-size: 13px;
    font-style: italic;
    margin-bottom: 12px;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--atom-gray);
    border-radius: 2px;
}

/* Code Blocks */
pre {
    background-color: var(--atom-bg) !important;
    border-radius: 4px;
    padding: 16px !important;
    overflow-x: auto;
    margin: 12px 0;
    border: 1px solid var(--cell-border);
    position: relative;
}

code {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
}

pre code {
    background: transparent;
    padding: 0;
    color: var(--atom-fg);
}

:not(pre) > code {
    background-color: var(--atom-bg);
    color: var(--atom-orange);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* Copy Button for Code Blocks */
.code-block-wrapper {
    position: relative;
}

.copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: var(--cell-border);
    color: var(--text-primary);
    border: 1px solid var(--cell-border);
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 11px;
    font-family: var(--font-mono);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
}

.code-block-wrapper:hover .copy-code-btn {
    opacity: 1;
}

.copy-code-btn:hover {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.copy-code-btn.copied {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
}

/* Markdown Content Styles */
.cell-content h1,
.cell-content h2,
.cell-content h3,
.cell-content h4,
.cell-content h5,
.cell-content h6 {
    color: var(--primary-color);
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

.cell-content h1 { font-size: 28px; font-weight: 700; }
.cell-content h2 { font-size: 24px; font-weight: 700; }
.cell-content h3 { font-size: 20px; font-weight: 600; }
.cell-content h4 { font-size: 18px; font-weight: 600; }
.cell-content h5 { font-size: 16px; font-weight: 600; }
.cell-content h6 { font-size: 14px; font-weight: 600; }

.cell-content p {
    margin-bottom: 12px;
}

.cell-content ul,
.cell-content ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

.cell-content li {
    margin-bottom: 4px;
}

.cell-content blockquote {
    border-left: 3px solid var(--accent-blue);
    padding-left: 16px;
    margin: 12px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.cell-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 12px 0;
}

.cell-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.cell-content table th,
.cell-content table td {
    border: 1px solid var(--cell-border);
    padding: 8px;
    text-align: left;
}

.cell-content table th {
    background-color: var(--atom-bg);
    font-weight: 600;
}

/* Cell Output */
.cell-output {
    margin-top: 16px;
    padding: 0;
    background-color: transparent;
    border-radius: 4px;
}

.output-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--cell-border);
}

.output-prompt {
    display: none; /* Hidden - not needed */
}

.output-label {
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Summary Audio Player */
.summary-audio {
    margin-bottom: 16px;
}

.audio-player {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--cell-border);
    border-radius: 4px;
    padding: 16px;
}

.audio-play-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background-color: var(--accent-blue);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.audio-play-btn:hover {
    background-color: var(--atom-blue);
}

.audio-play-btn.playing {
    background-color: var(--accent-green);
}

.audio-play-btn.playing:hover {
    background-color: var(--atom-green);
}

.audio-play-btn .play-icon,
.audio-play-btn .pause-icon {
    font-size: 14px;
}

.audio-element {
    display: none;
}

.audio-controls {
    margin-top: 12px;
    display: none;
}

.audio-controls.active {
    display: block;
}

.audio-progress {
    width: 100%;
    height: 6px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 8px;
}

.audio-progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--accent-blue);
    transition: width 0.1s linear;
}

.audio-time {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}

/* Summary Text */
.summary-text {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--cell-border);
    border-left: 3px solid var(--accent-green);
    border-radius: 4px;
    padding: 16px;
}

.summary-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-green);
    margin-bottom: 10px;
}

.summary-content {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.6;
}

.summary-content p {
    margin-bottom: 10px;
}

.summary-content p:last-child {
    margin-bottom: 0;
}

.summary-content ul,
.summary-content ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.summary-content li {
    margin-bottom: 4px;
}

/* ============================================================================
   FOOTER STYLES
   ============================================================================ */

.site-footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    color: var(--text-secondary);
    margin-top: 60px;
    border-top: 2px solid rgba(0, 150, 136, 0.3);
}

/* Main Footer Content */
.footer-main {
    padding: 60px 0 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.footer-column {
    display: flex;
    flex-direction: column;
}

.footer-column .widget-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(0, 150, 136, 0.4);
}

.footer-column .widget {
    margin-bottom: 0;
}

.footer-column .widget p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.footer-column .widget a {
    color: rgba(0, 150, 136, 0.8);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.8;
    transition: color 0.3s ease;
}

.footer-column .widget a:hover {
    color: rgba(0, 150, 136, 1);
    text-decoration: none;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 8px;
}

/* Footer Bottom / Copyright Section */
.footer-bottom {
    background-color: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(0, 150, 136, 0.2);
    padding: 25px 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-copyright p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* Footer Menu */
.footer-menu {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 30px;
    flex-wrap: wrap;
}

.footer-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s ease;
}

.footer-menu a:hover {
    color: rgba(0, 150, 136, 1);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    background-color: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 4px;
    color: var(--text-primary);
}

.pagination a:hover {
    background-color: var(--cell-border);
    text-decoration: none;
}

.pagination .current {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Responsive Design */
@media (max-width: 768px) {
    .site-container {
        padding: 10px;
    }

    .cell-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cell-prompt {
        margin-bottom: 5px;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 10px;
    }
}

/* Home Page Notebook Library */
.notebook-library {
    margin-top: 30px;
}

.category-group {
    margin-bottom: 40px;
}

.category-group:last-child {
    margin-bottom: 0;
}

.category-group-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--cell-border);
}

.category-group-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.category-group-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #00bfa5;
    background: rgba(0, 150, 136, 0.1);
    border: 1px solid rgba(0, 150, 136, 0.2);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.view-all-btn:hover {
    background: rgba(0, 150, 136, 0.2);
    border-color: rgba(0, 150, 136, 0.4);
    color: #00e5cc;
    transform: translateX(3px);
}

.category-icon {
    font-size: 24px;
}

.category-group-description {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
}

/* Notebook Cards - Vertical Grid Layout */
.notebooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.notebook-card {
    background: linear-gradient(135deg, var(--cell-bg) 0%, rgba(43, 43, 43, 0.8) 100%);
    border: 2px solid var(--cell-border);
    border-radius: 12px;
    padding: 0;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1 / 1;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.notebook-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 150, 136, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notebook-card:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 150, 136, 0.4);
    box-shadow: 0 12px 24px rgba(85, 85, 85, 0.2);
    text-decoration: none;
}

.notebook-card:hover::before {
    opacity: 1;
}

.notebook-card-icon {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 150, 136, 0.05) 0%, rgba(0, 150, 136, 0.15) 100%);
    position: relative;
}

.notebook-card-icon i {
    font-size: 80px;
    transition: transform 0.3s ease;
}

.notebook-card:hover .notebook-card-icon i {
    transform: scale(1.1);
}

/* Letter icon fallback */
.category-letter-icon {
    font-size: 80px;
    font-weight: 700;
    color: var(--primary-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notebook-card:hover .category-letter-icon {
    transform: scale(1.1);
    color: var(--primary-light);
}

.notebook-card-content {
    width: 100%;
    padding: 20px;
    text-align: center;
    background-color: var(--cell-bg);
    border-top: 1px solid var(--cell-border);
}

.notebook-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 8px 0;
    line-height: 1.3;
    transition: color 0.2s;
}

.notebook-card:hover .notebook-card-title {
    color: var(--primary-light);
}

.notebook-card-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notebook-card-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.cell-count {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    background: rgba(0, 150, 136, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.notebook-arrow {
    display: none;
}

/* Empty Library State */
.empty-library {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--cell-bg);
    border: 2px dashed var(--cell-border);
    border-radius: 8px;
    margin-top: 30px;
}

.empty-library-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-library h3 {
    color: var(--text-primary);
    font-size: 20px;
    margin-bottom: 10px;
}

.empty-library p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Sidebar Styles */
.sidebar {
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

.sidebar-inner {
    background-color: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 4px;
    padding: 20px;
}

.widget {
    margin-bottom: 30px;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.widget ul {
    margin-left: 15px;
    list-style: square;
}

.category-posts-list > li {
    list-style: none;
}

/* Search Form Styling */
.search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.search-form .search-field {
    flex: 1;
    background: var(--cell-bg);
    border: 1px solid var(--cell-border);
    color: var(--text-primary);
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 4px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.search-form .search-field:focus {
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.search-form .search-field::placeholder {
    color: var(--text-secondary);
}

.search-form .search-submit {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.search-form .search-submit:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.search-form .search-submit:active {
    transform: translateY(0);
}

/* Categories List in Sidebar */
.categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-item {
    margin-bottom: 0;
    padding: 0;
    list-style: none;
}

.category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 4px;
    background: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 4px;
    transition: all 0.2s;
    text-decoration: none;
}

.category-link:hover {
    background: var(--cell-border);
    border-color: rgba(0, 150, 136, 0.4);
    text-decoration: none;
}

.category-item.active .category-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.category-item.active .category-link .category-name {
    color: #ffffff;
    font-weight: 600;
}

.category-name {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    flex: 1;
}

.category-count {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    background: rgba(0, 150, 136, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

.category-item.active .category-count {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.2);
}

.no-categories {
    color: var(--text-secondary);
    font-size: 12px;
    font-style: italic;
}

/* Recent Cells Widget */
.widget-recent-cells {
    margin-bottom: 30px;
}

.recent-cells-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-cell-item {
    margin-bottom: 0;
    padding: 0;
    border-bottom: none;
}

.recent-cell-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-cell-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    padding: 10px 12px;
    margin-bottom: 4px;
    background: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 4px;
    transition: all 0.2s;
}

.recent-cell-link:hover {
    text-decoration: none;
    background: var(--cell-border);
    border-color: rgba(0, 150, 136, 0.4);
}

.recent-cell-title {
    display: block;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 2px;
    transition: color 0.2s;
}

.recent-cell-link:hover .recent-cell-title {
    color: var(--primary-color);
}

.recent-cell-category {
    display: inline-block;
    font-size: 10px;
    color: var(--primary-color);
    background-color: rgba(0, 150, 136, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
}

.recent-cell-date {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    margin-top: 4px;
    flex-shrink: 0;
}

.no-cells {
    color: var(--text-secondary);
    font-size: 12px;
    font-style: italic;
}

/* Widget Info/Tips */
.widget-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--cell-border);
}

.tips-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tips-list li {
    padding: 8px 0;
    padding-left: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    position: relative;
}

.tips-list li::before {
    content: "â–¸";
    position: absolute;
    left: 0;
    color: var(--accent-green);
}

/* Category Page - Always Expanded Posts */
.category .notebook-cell.category-cell-expanded .cell-content {
    display: block !important;
}

.category .notebook-cell.category-cell-expanded .cell-accordion-toggle {
    display: none;
}

/* Category/Post Sidebar Styles */
.category-sidebar,
.single-sidebar {
    position: sticky;
    top: 20px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.category-posts-list,
.related-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-post-item,
.related-post-item {
    margin-bottom: 0;
    padding: 0;
}

.category-post-link,
.related-post-link {
    display: block;
    padding: 12px 14px;
    margin-bottom: 6px;
    background: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 4px;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-primary);
}

.category-post-link:hover,
.related-post-link:hover {
    background: var(--cell-border);
    border-color: rgba(0, 150, 136, 0.4);
    text-decoration: none;
    transform: translateX(4px);
}

.category-post-link.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.category-post-link.active .category-post-title {
    color: #ffffff;
    font-weight: 600;
}

.category-post-title,
.related-post-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    display: block;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--notebook-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--cell-border);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ========================================
   MOBILE APP OPTIMIZATIONS
   ======================================== */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1000;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 24px;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Hamburger Animation */
.mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    /* Sticky Header for App Feel */
    .site-header {
        position: sticky;
        top: 0;
        z-index: 999;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        margin-bottom: 0;
        padding: 10px 0;
        background: linear-gradient(135deg, var(--teal-600) 0%, var(--teal-500) 50%, var(--teal-400) 100%);
    }

    .site-container {
        padding: 12px 16px;
    }

    .header-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .site-title {
        font-size: 18px;
    }

    /* Show hamburger menu */
    .mobile-menu-toggle {
        display: flex;
        order: 2;
    }

    /* Hide navigation by default on mobile */
    .main-navigation {
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        background: linear-gradient(180deg, var(--teal-700) 0%, var(--teal-800) 100%);
        border-bottom: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
        z-index: 998;
    }

    .main-navigation.active {
        max-height: calc(100vh - 53px);
        overflow-y: auto;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0;
        padding: 8px;
    }

    .main-navigation li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .main-navigation li:last-child {
        border-bottom: none;
    }

    .main-navigation a {
        padding: 14px 16px;
        font-size: 15px;
        border-radius: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: #ffffff;
    }

    .main-navigation a:hover {
        background-color: rgba(255, 255, 255, 0.15);
        color: #ffffff;
    }

    .main-navigation a::after {
        content: "â€º";
        font-size: 20px;
        color: rgba(255, 255, 255, 0.6);
    }

    .main-navigation a:hover::after {
        color: #ffffff;
    }

    /* Mobile Mega Menu Styles */
    .mega-menu-submenu {
        position: static;
        top: auto;
        left: auto;
        min-width: auto;
        background: rgba(0, 150, 136, 0.08);
        border: none;
        border-left: 3px solid rgba(0, 150, 136, 0.4);
        border-radius: 0;
        padding: 8px 0 8px 16px;
        margin: 0;
        margin-top: 8px;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        max-height: none;
        display: none;
    }

    /* Show mega menu when parent is active */
    .menu-item-has-children.menu-open > .mega-menu-submenu,
    .menu-item-has-children:hover > .mega-menu-submenu {
        display: block;
    }

    .mega-menu-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .mega-menu-link {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        padding: 12px;
        text-align: left;
        min-height: auto;
        background: rgba(0, 150, 136, 0.08);
        border: 1px solid rgba(0, 150, 136, 0.15);
        font-size: 14px;
    }

    .mega-menu-link:hover {
        padding-left: 14px;
        background-color: rgba(0, 150, 136, 0.15);
        transform: none;
    }

    .mega-menu-icon,
    .mega-menu-icon-letter {
        margin-right: 0;
        margin-left: 0;
    }

    .mega-menu-icon-letter {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .mega-menu-label {
        flex: 1;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mega-menu-count {
        margin-top: 0;
        margin-left: 8px;
    }

    .menu-item-has-children > .menu-link::after {
        border-left: 2px solid transparent;
        border-right: 2px solid transparent;
        border-top: 2px solid currentColor;
    }

    /* Site Content Spacing */
    .site-content {
        padding-top: 16px;
    }

    /* Optimize Cell Styles for Mobile */
    .notebook-cell {
        border-radius: 8px;
        margin-bottom: 16px;
    }

    .cell-header {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 12px 16px;
        flex-wrap: nowrap;
    }

    .cell-title {
        font-size: 16px;
        line-height: 1.4;
        flex: 1;
        min-width: 0;
    }

    .cell-title a {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cell-prompt {
        font-size: 12px;
    }

    .cell-header-right {
        gap: 8px;
    }

    /* Hide date on mobile to save space */
    .cell-meta {
        display: none;
    }

    /* Larger audio button on mobile */
    .audio-play-btn-large {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }

    .cell-accordion-toggle {
        width: 44px;
        height: 44px;
    }

    .cell-content {
        padding: 16px;
        font-size: 15px;
        line-height: 1.7;
    }

    /* Code Blocks Mobile Optimization */
    pre[class*="language-"] {
        font-size: 12px;
        border-radius: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .code-block-wrapper {
        margin: 16px 0;
    }

    /* Mobile Sidebar */
    .content-wrapper {
        flex-direction: column;
        padding: 0 16px;
    }

    .sidebar {
        width: 100%;
        position: static;
        margin-top: 24px;
        order: 2;
    }

    .site-main {
        order: 1;
    }

    /* Mobile Footer */
    .site-footer {
        padding: 24px 16px;
        font-size: 13px;
    }

    /* Pagination Mobile */
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
    }

    .pagination a,
    .pagination span {
        min-width: 44px;
        text-align: center;
    }

    /* Touch-Friendly Buttons */
    button,
    .btn,
    a.btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 20px;
        font-size: 15px;
        border-radius: 6px;
    }

    /* Notebook Cards Mobile */
    .notebooks-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
    }

    .notebook-card {
        border-radius: 10px;
    }

    .notebook-card-icon {
        padding: 20px;
    }

    .notebook-card-icon i {
        font-size: 60px;
    }

    .notebook-card-content {
        padding: 16px;
    }

    .notebook-card-title {
        font-size: 14px;
    }

    .notebook-card-description {
        font-size: 11px;
    }

    /* Category Title */
    .notebook-title {
        font-size: 24px;
        padding-left: 0;
        margin-bottom: 16px;
    }

    /* Search Form Mobile */
    .search-form {
        flex-direction: column;
        gap: 12px;
    }

    .search-form .search-field,
    .search-form .search-submit {
        width: 100%;
        padding: 14px 16px;
        font-size: 15px;
        border-radius: 6px;
    }

    /* Summary Section Mobile */
    .summary-text,
    .summary-audio {
        padding: 16px;
        border-radius: 6px;
    }

    .audio-player {
        height: 60px;
    }

    /* Improved Touch Targets */
    .category-link,
    .recent-cell-link {
        padding: 14px 16px;
        min-height: 52px;
        border-radius: 6px;
    }

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    /* Optimize Images */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Reduce animations on mobile for performance */
    * {
        animation-duration: 0.2s !important;
        transition-duration: 0.2s !important;
    }
}

/* Small Mobile Devices (< 480px) */
@media (max-width: 480px) {
    .site-title {
        font-size: 16px;
    }

    .site-container {
        padding: 12px;
    }

    .notebook-title {
        font-size: 20px;
    }

    .cell-header {
        padding: 10px 12px;
    }

    .cell-title {
        font-size: 15px;
    }

    .cell-header-right {
        gap: 6px;
    }

    .audio-play-btn-large {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .cell-accordion-toggle {
        width: 40px;
        height: 40px;
    }

    .cell-content {
        font-size: 14px;
        padding: 12px;
    }

    pre[class*="language-"] {
        font-size: 11px;
    }

    .notebook-card {
        padding: 12px;
    }

    .notebook-card-title {
        font-size: 14px;
    }

    .category-group-title {
        font-size: 18px;
    }

    .view-all-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Landscape Mobile (Small Screens) */
@media (max-width: 896px) and (orientation: landscape) {
    .site-header {
        padding: 6px 0;
        background: linear-gradient(135deg, var(--teal-600) 0%, var(--teal-500) 50%, var(--teal-400) 100%);
    }

    .main-navigation {
        top: 42px;
        background: linear-gradient(180deg, var(--teal-700) 0%, var(--teal-800) 100%);
    }

    .site-content {
        padding-top: 12px;
    }

    .notebook-cell {
        margin-bottom: 12px;
    }
}

/* PWA-Like Enhancements */
@media (display-mode: standalone) {
    /* When installed as PWA */
    .site-header {
        padding-top: env(safe-area-inset-top);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .site-content {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* iOS Safe Area Support */
@supports (padding: env(safe-area-inset-top)) {
    .site-header {
        padding-top: max(12px, env(safe-area-inset-top));
    }

    .site-content {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* ========================================
   PODCAST VIEW - Spotify-style Layout
   ======================================== */

.podcast-view {
    max-width: 100%;
    padding-bottom: 100px;
}

.podcast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 30px;
}

.podcast-card {
    background: transparent;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.podcast-card:hover {
    transform: none;
}

.podcast-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Podcast Thumbnail */
.podcast-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: linear-gradient(135deg, #2d2d2d 0%, #1e1e1e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.podcast-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.podcast-card:hover .podcast-thumbnail img {
    transform: scale(1.08);
}

/* Podcast Thumbnail Title Overlay */
.podcast-thumbnail-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.9) 50%);
    padding: 20px 12px 12px 12px;
    display: flex;
    align-items: flex-end;
    z-index: 5;
}

.podcast-thumbnail-title h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: white;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word;
}

.podcast-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    color: var(--primary-color);
    opacity: 0.3;
}

/* Podcast Play Button Overlay */
.podcast-play-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: scale(0);
    z-index: 10;
}

.podcast-card:hover .podcast-play-btn {
    opacity: 1;
    transform: scale(1);
}

.podcast-play-btn:hover {
    background: var(--primary-light);
    transform: scale(1.15);
}

.podcast-play-btn.playing {
    background: var(--accent-green);
    opacity: 1;
    transform: scale(1);
    animation: pulse 2s ease-in-out infinite;
}

.podcast-play-btn .play-icon,
.podcast-play-btn .pause-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding-left: 3px;
}

.podcast-play-btn .pause-icon {
    padding-left: 0;
}

/* Podcast Info */
.podcast-info {
    padding: 0;
    flex: 1;
    display: none;
    flex-direction: column;
}

.podcast-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.podcast-title a {
    color: var(--text-primary);
    transition: color 0.2s;
}

.podcast-title a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.podcast-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.podcast-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    padding-top: 12px;
    border-top: 1px solid var(--cell-border);
    margin-top: auto;
}

.podcast-date {
    flex: 1;
}

.podcast-duration {
    background: rgba(0, 150, 136, 0.15);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* ===== STICKY PODCAST PLAYER ===== */
.podcast-player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--cell-border);
    padding: 16px 0;
    z-index: 999;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.player-bar-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Left: Thumbnail and Info */
.player-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 300px;
}

.player-thumbnail-small {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--cell-border);
    flex-shrink: 0;
}

.player-thumbnail-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.player-artist {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Center: Play Button */
.player-bar-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.player-control-btn:hover {
    background: var(--primary-light);
    transform: scale(1.1);
}

/* Player Skip Buttons */
.player-skip-btn {
    width: 40px;
    height: 40px;
    font-size: 14px;
    background: rgba(0, 150, 136, 0.15);
    border: 1px solid var(--cell-border);
    margin: 0 8px;
}

.player-skip-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--cell-border);
}

/* Play Button Main */
.player-play-btn-main {
    width: 48px;
    height: 48px;
    margin: 0 12px;
    background: var(--primary-color);
}

/* Volume Button */
.player-volume-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
    background: rgba(0, 150, 136, 0.15);
    border: 1px solid var(--cell-border);
    margin-left: 12px;
}

.player-volume-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.player-volume-slider {
    width: 80px;
    height: 4px;
    margin-left: 8px;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

.player-volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.player-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.player-volume-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: rgba(0, 150, 136, 0.15);
    border-radius: 2px;
}

.player-volume-slider::-moz-range-track {
    background: transparent;
    border: none;
}

.player-control-btn .play-icon,
.player-control-btn .pause-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Right: Progress */
.player-bar-right {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.player-progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.player-time {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    min-width: 40px;
}

.player-progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(0, 150, 136, 0.15);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.player-progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.1s ease;
}

.player-progress-slider {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 4px;
    appearance: none;
    background: transparent;
    cursor: pointer;
    z-index: 10;
}

.player-progress-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.player-progress-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Close Button */
.player-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--cell-border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.player-close-btn:hover {
    background: rgba(0, 150, 136, 0.08);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Podcast View Mobile */
@media (max-width: 768px) {
    .podcast-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .podcast-play-btn {
        width: 48px;
        height: 48px;
        font-size: 16px;
        bottom: 12px;
        right: 12px;
        opacity: 1;
        transform: scale(1);
    }

    .podcast-info {
        padding: 16px;
    }

    .podcast-title {
        font-size: 14px;
    }

    .podcast-excerpt {
        font-size: 12px;
    }

    .podcast-meta {
        font-size: 11px;
    }

    /* Mobile Podcast Player Bar */
    .podcast-player-bar {
        padding: 16px 0;
        height: auto;
    }

    .player-bar-inner {
        padding: 0 16px;
        gap: 16px;
        flex-wrap: wrap;
        position: relative;
    }

    .player-bar-left {
        min-width: auto;
        width: calc(100% - 40px);
        gap: 12px;
        order: 1;
    }

    .player-thumbnail-small {
        width: 56px;
        height: 56px;
        border-radius: 8px;
    }

    .player-info {
        flex: 1;
        min-width: 0;
    }

    .player-title {
        font-size: 14px;
        margin-bottom: 4px;
        line-height: 1.3;
    }

    .player-artist {
        font-size: 11px;
    }

    .player-bar-center {
        width: 100%;
        order: 3;
        gap: 12px;
        margin: 8px 0;
        justify-content: center;
    }

    .player-control-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .player-skip-btn {
        width: 40px;
        height: 40px;
        font-size: 12px;
        margin: 0 6px;
    }

    .player-play-btn-main {
        width: 52px;
        height: 52px;
        margin: 0 12px;
    }

    .player-volume-btn {
        width: 40px;
        height: 40px;
        font-size: 15px;
        margin-left: 12px;
    }

    .player-volume-slider {
        width: 70px;
        height: 4px;
        margin-left: 8px;
    }

    .player-bar-right {
        width: 100%;
        order: 2;
        gap: 8px;
        margin: 8px 0 0 0;
    }

    .player-progress-container {
        width: 100%;
        gap: 10px;
    }

    .player-progress-bar {
        height: 6px;
        border-radius: 3px;
    }

    .player-progress-slider {
        height: 6px;
    }

    .player-progress-slider::-webkit-slider-thumb {
        width: 14px;
        height: 14px;
    }

    .player-progress-slider::-moz-range-thumb {
        width: 14px;
        height: 14px;
    }

    .player-time {
        font-size: 12px;
        min-width: 35px;
        font-weight: 500;
    }

    .player-close-btn {
        position: absolute;
        top: 16px;
        right: 16px;
        width: 32px;
        height: 32px;
        font-size: 14px;
        order: 0;
    }
}

@media (max-width: 480px) {
    .podcast-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 20px;
    }

    .podcast-card {
        background: var(--cell-bg);
        border: 1px solid var(--cell-border);
        border-radius: 12px;
        padding: 12px;
    }

    .podcast-card-inner {
        flex-direction: row;
        gap: 12px;
    }

    .podcast-thumbnail {
        width: 110px;
        height: 110px;
        flex-shrink: 0;
        aspect-ratio: 1 / 1;
        border-radius: 8px;
    }

    .podcast-thumbnail img {
        border-radius: 8px;
    }

    .podcast-play-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
        bottom: 8px;
        right: 8px;
    }

    .podcast-info {
        padding: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
    }

    .podcast-title {
        font-size: 15px;
        min-height: auto;
        -webkit-line-clamp: 2;
        margin-bottom: 6px;
        line-height: 1.4;
    }

    .podcast-excerpt {
        font-size: 12px;
        -webkit-line-clamp: 2;
        line-height: 1.4;
    }

    .podcast-meta {
        display: flex;
        flex-direction: column;
        gap: 4px;
        font-size: 11px;
    }

    .podcast-date,
    .podcast-duration {
        display: block;
    }
}

/* ========================================
   VIDEO VIEW - YouTube-style Layout
   ======================================== */

.video-view {
    max-width: 100%;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.video-card {
    background: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.video-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 150, 136, 0.4);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.video-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Video Thumbnail */
.video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, #2d2d2d 0%, #1e1e1e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    opacity: 0.3;
}

/* Video Duration Badge */
.video-duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
    z-index: 5;
}

/* Video Play Button Overlay */
.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 64px;
    height: 64px;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    z-index: 10;
}

.video-card:hover .video-play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.video-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.video-play-btn svg circle {
    transition: fill 0.2s;
}

.video-play-btn:hover svg circle {
    fill: rgba(0, 0, 0, 0.9);
}

/* Video Embed Container */
.video-embed-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
}

.video-embed-container iframe {
    width: 100%;
    height: 100%;
}

/* Video Info */
.video-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.video-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
}

.video-title a {
    color: var(--text-primary);
    transition: color 0.2s;
}

.video-title a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.video-excerpt {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    padding-top: 12px;
    border-top: 1px solid var(--cell-border);
    margin-top: auto;
}

.video-date {
    flex: 1;
}

.video-duration {
    background: rgba(0, 150, 136, 0.15);
    padding: 3px 6px;
    border-radius: 3px;
    font-weight: 500;
}

/* Video View Mobile */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }

    .video-play-btn {
        width: 56px;
        height: 56px;
        opacity: 1;
    }

    .video-info {
        padding: 14px;
    }

    .video-title {
        font-size: 14px;
    }

    .video-excerpt {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .video-play-btn {
        width: 48px;
        height: 48px;
    }
}

/* ========================================
   Q&A VIEW - Stack Overflow-style Layout
   ======================================== */

.qa-view {
    max-width: 100%;
}

.qa-list {
    margin-top: 30px;
}

.qa-item {
    background: transparent;
    border: none;
    margin-bottom: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--cell-border);
}

.qa-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.qa-question-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.qa-content-text {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
}

.qa-content-text p {
    margin-bottom: 16px;
}

.qa-content-text h2,
.qa-content-text h3,
.qa-content-text h4 {
    margin: 20px 0 12px 0;
    font-weight: 600;
    color: var(--text-primary);
}

.qa-content-text code {
    background: var(--cell-border);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    font-family: 'Monaco', 'Menlo', monospace;
}

.qa-content-text pre {
    background: var(--cell-border);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.qa-content-text ul,
.qa-content-text ol {
    margin-bottom: 16px;
    margin-left: 20px;
}

.qa-content-text li {
    margin-bottom: 8px;
}

/* ===== FAQ ACCORDION STYLE ===== */
.faq-accordion {
    margin-top: 40px;
}

.faq-item {
    margin-bottom: 16px;
    background: transparent;
    border: none;
}

.faq-item:last-child {
    margin-bottom: 0;
}

.faq-header {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 20px 24px;
    background: rgba(0, 150, 136, 0.08);
    border: 1px solid var(--cell-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: inherit;
    font-size: 15px;
}

.faq-header:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--cell-border);
}

.faq-header.active {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--accent-color, #2563eb);
}

.faq-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 18px;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.faq-header.active .faq-number {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.faq-title {
    flex: 1;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.faq-toggle {
    font-size: 14px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-header.active .faq-toggle {
    transform: rotate(180deg);
    color: var(--accent-color, #2563eb);
}

.faq-content {
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 2000px;
    }
}

.faq-text {
    padding: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--cell-border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    margin-top: -1px;
}

.faq-text p {
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
}

.faq-text h2,
.faq-text h3,
.faq-text h4 {
    margin: 20px 0 12px 0;
    font-weight: 600;
    color: var(--text-primary);
}

.faq-text code {
    background: var(--cell-border);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    font-family: 'Monaco', 'Menlo', monospace;
}

.faq-text pre {
    background: var(--cell-border);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.faq-text ul,
.faq-text ol {
    margin-bottom: 16px;
    margin-left: 20px;
}

.faq-text li {
    margin-bottom: 8px;
}

/* Q&A Stats */
.qa-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.qa-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    border: 1px solid var(--cell-border);
    border-radius: 6px;
    min-width: 80px;
    background: rgba(0, 0, 0, 0.2);
}

.qa-stat-box.answered {
    border-color: var(--accent-green);
    background: rgba(152, 195, 121, 0.1);
}

.qa-stat-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.qa-stat-box.answered .qa-stat-number {
    color: var(--accent-green);
}

.qa-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Q&A Content */
.qa-content {
    flex: 1;
    min-width: 0;
}

.qa-content-full {
    width: 100%;
}

.qa-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.qa-title a {
    color: var(--primary-color);
    transition: color 0.2s;
}

.qa-title a:hover {
    color: var(--primary-light);
    text-decoration: none;
}

.qa-question-text,
.qa-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.qa-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.qa-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.qa-tag {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(0, 150, 136, 0.15);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 500;
}

.qa-author-date {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* Q&A Number Column */
.qa-number-col {
    display: flex;
    align-items: flex-start;
    flex-shrink: 0;
    margin-top: 2px;
}

.qa-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-color, #2563eb), var(--primary-light, #3b82f6));
    color: white;
    border-radius: 50%;
    font-size: 22px;
    font-weight: 700;
    font-family: var(--font-mono);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Question and Answer Blocks */
.qa-question-block {
    margin-bottom: 24px;
    padding-bottom: 0;
    border-bottom: none;
}

.qa-question-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 0;
}

.qa-question-icon {
    font-size: 28px;
    flex-shrink: 0;
    margin-top: 0px;
}

.qa-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.5;
}

/* Answer Block */
.qa-answer-block {
    margin-top: 20px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border-left: none;
}

.qa-answer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.qa-answer-icon {
    font-size: 22px;
    color: var(--accent-green, #22c55e);
    font-weight: bold;
}

.qa-answer-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qa-answer-content {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.8;
    margin: 0;
}

.qa-answer-content p {
    margin-bottom: 12px;
}

.qa-answer-content h2,
.qa-answer-content h3,
.qa-answer-content h4 {
    margin: 16px 0 12px 0;
    font-weight: 600;
    color: var(--text-primary);
}

.qa-answer-content code {
    background: var(--cell-border);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    font-family: 'Monaco', 'Menlo', monospace;
}

.qa-answer-content pre {
    background: var(--cell-border);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 12px;
}

/* Q&A Mobile */
@media (max-width: 768px) {
    .qa-item {
        margin-bottom: 32px;
        padding-bottom: 32px;
    }

    .qa-item-inner {
        gap: 16px;
        padding: 0;
    }

    .qa-number {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .qa-title {
        font-size: 18px;
    }

    .qa-question-header {
        gap: 10px;
    }

    .qa-question-icon {
        font-size: 24px;
    }

    .qa-answer-icon {
        font-size: 18px;
    }

    .qa-answer-content {
        font-size: 14px;
    }
}

/* ========================================
   GALLERY VIEW - Portfolio Grid Layout
   ======================================== */

.gallery-view {
    max-width: 100%;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.gallery-item {
    background: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 150, 136, 0.4);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.gallery-item-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Gallery Thumbnail */
.gallery-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #2d2d2d 0%, #1e1e1e 100%);
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-thumbnail img {
    transform: scale(1.1);
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    color: var(--primary-color);
    opacity: 0.3;
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-view-btn,
.gallery-external-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.gallery-view-btn {
    background: var(--primary-color);
    color: #ffffff;
}

.gallery-view-btn:hover {
    background: var(--primary-light);
    transform: scale(1.05);
    text-decoration: none;
}

.gallery-external-btn {
    background: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.gallery-external-btn:hover {
    background: #ffffff;
    color: var(--notebook-bg);
    text-decoration: none;
}

/* Gallery Info */
.gallery-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gallery-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.gallery-title a {
    color: var(--text-primary);
    transition: color 0.2s;
}

.gallery-title a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.gallery-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 12px 0;
    flex: 1;
}

.gallery-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.tech-badge {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(0, 150, 136, 0.15);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 10px;
    font-family: var(--font-mono);
    font-weight: 600;
}

/* Gallery Mobile */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ========================================
   TUTORIAL VIEW - Sequential Steps Layout
   ======================================== */

.tutorial-view {
    max-width: 100%;
}

.tutorial-list {
    margin-top: 20px;
}

.tutorial-card {
    background: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 8px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.tutorial-card:hover {
    border-color: rgba(0, 150, 136, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: translateX(4px);
}

.tutorial-card-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

/* Tutorial Number */
.tutorial-number {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tutorial-step {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    font-family: var(--font-mono);
}

/* Tutorial Content */
.tutorial-content {
    flex: 1;
    min-width: 0;
}

.tutorial-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.tutorial-title a {
    color: var(--primary-color);
    transition: color 0.2s;
}

.tutorial-title a:hover {
    color: var(--primary-light);
    text-decoration: none;
}

.tutorial-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.tutorial-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tutorial-difficulty {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tutorial-difficulty.difficulty-easy {
    background: rgba(152, 195, 121, 0.2);
    color: var(--accent-green);
}

.tutorial-difficulty.difficulty-medium {
    background: rgba(229, 192, 123, 0.2);
    color: var(--atom-yellow);
}

.tutorial-difficulty.difficulty-hard {
    background: rgba(224, 108, 117, 0.2);
    color: var(--atom-red);
}

.tutorial-time {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* Tutorial Arrow */
.tutorial-arrow {
    flex-shrink: 0;
    font-size: 32px;
    color: var(--text-secondary);
    opacity: 0;
    transition: all 0.2s ease;
}

.tutorial-card:hover .tutorial-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* Tutorial Mobile */
@media (max-width: 768px) {
    .tutorial-card-inner {
        padding: 16px;
        gap: 16px;
    }

    .tutorial-number {
        width: 48px;
        height: 48px;
    }

    .tutorial-step {
        font-size: 20px;
    }

    .tutorial-title {
        font-size: 16px;
    }

    .tutorial-arrow {
        display: none;
    }
}

/* ========================================
   QUIZ VIEW - Interactive Quiz Cards
   ======================================== */

.quiz-view {
    max-width: 100%;
}

.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.quiz-card {
    background: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.quiz-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 150, 136, 0.4);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.quiz-card-inner {
    display: flex;
    flex-direction: column;
    padding: 24px;
}

/* Quiz Icon */
.quiz-icon {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 150, 136, 0.1) 0%, rgba(0, 150, 136, 0.2) 100%);
    border-radius: 8px;
    margin-bottom: 20px;
}

.quiz-icon svg {
    color: var(--primary-color);
}

/* Quiz Info */
.quiz-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.quiz-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.quiz-title a {
    color: var(--text-primary);
    transition: color 0.2s;
}

.quiz-title a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.quiz-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 16px 0;
    flex: 1;
}

.quiz-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--cell-border);
}

.quiz-stat {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.quiz-difficulty {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quiz-difficulty.difficulty-easy {
    background: rgba(152, 195, 121, 0.2);
    color: var(--accent-green);
}

.quiz-difficulty.difficulty-medium {
    background: rgba(229, 192, 123, 0.2);
    color: var(--atom-yellow);
}

.quiz-difficulty.difficulty-hard {
    background: rgba(224, 108, 117, 0.2);
    color: var(--atom-red);
}

/* Quiz Start Button */
.quiz-start-btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color);
    color: #ffffff;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}

.quiz-start-btn:hover {
    background: var(--primary-light);
    transform: scale(1.02);
    text-decoration: none;
}

/* Quiz Mobile */
@media (max-width: 768px) {
    .quiz-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }

    .quiz-card-inner {
        padding: 20px;
    }

    .quiz-icon {
        height: 100px;
    }

    .quiz-icon svg {
        width: 48px;
        height: 48px;
    }
}

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

/* ========================================
   VIDEO PLAYER - Single Post Display
   ======================================== */

.video-player-section {
    width: 100%;
    margin-bottom: 40px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.video-player-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

.video-player-container iframe,
.video-player-container video {
    display: block;
}

/* Responsive video player */
@media (max-width: 768px) {
    .video-player-container {
        aspect-ratio: 16 / 9;
    }

    .video-player-container iframe,
    .video-player-container video {
        width: 100% !important;
        height: auto !important;
    }
}

@media (max-width: 480px) {
    .video-player-section {
        margin-bottom: 30px;
    }

    .video-player-container {
        aspect-ratio: 16 / 9;
    }
}

/* Video Thumbnail Link - Clickable */
.video-thumbnail-link {
    display: block;
    text-decoration: none;
}

/* Static play button overlay on category page */
.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.video-thumbnail:hover .video-play-overlay {
    opacity: 1;
}

/* ========================================
   VIDEO SIDEBAR - YouTube-style Right Sidebar
   ======================================== */

.video-sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.video-sidebar-item {
    margin-bottom: 12px;
    padding: 0;
    list-style: none;
}

.video-sidebar-item:last-child {
    margin-bottom: 0;
}

.video-sidebar-link {
    display: flex;
    gap: 10px;
    text-decoration: none;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.video-sidebar-link:hover {
    background-color: rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

/* Video Sidebar Thumbnail */
.video-sidebar-thumbnail {
    position: relative;
    width: 100px;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
    background: linear-gradient(135deg, #2d2d2d 0%, #1e1e1e 100%);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-sidebar-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.video-sidebar-link:hover .video-sidebar-thumbnail img {
    transform: scale(1.05);
}

.video-sidebar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    opacity: 0.5;
}

/* Video Sidebar Info */
.video-sidebar-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.video-sidebar-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-sidebar-link:hover .video-sidebar-title {
    color: var(--primary-color);
}

.video-sidebar-date {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* ========================================
   VIDEO POST LAYOUT - YouTube/Udemy Style
   ======================================== */

.video-post-wrapper {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.video-post-main {
    flex: 1;
    min-width: 0;
}

/* Video Sidebar positioning */
.video-sidebar {
    width: 320px;
    flex-shrink: 0;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    position: sticky;
    top: 100px;
}

.video-sidebar .sidebar-inner {
    padding: 0;
}

.video-sidebar .widget-related-posts {
    background: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 8px;
    padding: 16px;
}

.video-sidebar .widget-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--cell-border);
}

/* Responsive layout */
@media (max-width: 1200px) {
    .video-post-wrapper {
        flex-direction: column;
        gap: 16px;
    }

    .video-sidebar {
        width: 100%;
        max-height: none;
        position: static;
    }

    .video-sidebar-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }

    .video-sidebar-item {
        margin-bottom: 0;
    }

    .video-sidebar-link {
        flex-direction: column;
        padding: 0;
    }

    .video-sidebar-thumbnail {
        width: 100%;
        aspect-ratio: 16 / 9;
        margin-bottom: 8px;
    }

    .video-sidebar-info {
        padding: 8px 0;
    }
}

@media (max-width: 768px) {
    .video-post-wrapper {
        gap: 12px;
    }

    .video-sidebar {
        width: 100%;
    }

    .video-sidebar-list {
        display: flex;
        flex-direction: column;
    }

    .video-sidebar-item {
        margin-bottom: 12px;
    }

    .video-sidebar-link {
        flex-direction: row;
        padding: 8px;
    }

    .video-sidebar-thumbnail {
        width: 120px;
        aspect-ratio: 16 / 9;
        margin-bottom: 0;
    }
}

/* ========================================
   INTERACTIVE QUIZ SYSTEM
   ======================================== */

/* Quiz Slideshow Modal */
.quiz-slideshow {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    flex-direction: row;
    overflow: hidden;
}

.quiz-slideshow-container {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

.quiz-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 150, 136, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.quiz-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffffff;
}

/* Quiz Main Area */
.quiz-main-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    overflow-y: auto;
}

/* Quiz Question Slide */
.quiz-question-slide {
    width: 100%;
    max-width: 700px;
    animation: slideIn 0.3s ease-out;
}

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

.quiz-question-header {
    margin-bottom: 50px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.quiz-question-text {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.5;
    margin: 0;
    word-spacing: 0.05em;
}

/* Quiz Options */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 40px;
}

.quiz-option-wrapper {
    display: flex;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 18px 20px;
    background: rgba(0, 150, 136, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    text-align: left;
}

.quiz-option:hover:not(.selected):not(.incorrect):not(.disabled):not(.correct-answer-highlight) {
    background: rgba(0, 150, 136, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 150, 136, 0.2);
}

.quiz-option.selected {
    background: rgba(0, 150, 136, 0.3);
    border-color: #00998d;
    box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.1);
}

.quiz-option.correct {
    background: rgba(152, 195, 121, 0.3);
    border-color: #98c379;
    box-shadow: 0 0 0 3px rgba(152, 195, 121, 0.1);
}

.quiz-option.correct-answer-highlight {
    background: rgba(152, 195, 121, 0.2);
    border-color: #98c379;
    border-width: 3px;
    opacity: 0.9;
}

.quiz-option.incorrect {
    background: rgba(224, 108, 117, 0.3);
    border-color: #e06c75;
    box-shadow: 0 0 0 3px rgba(224, 108, 117, 0.1);
}

.quiz-option.disabled {
    cursor: not-allowed !important;
    opacity: 0.8;
}

.quiz-option:disabled {
    pointer-events: none;
}

.quiz-option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #ffffff;
}

.quiz-option.selected .quiz-option-letter {
    background: #00998d;
    box-shadow: 0 4px 12px rgba(0, 150, 136, 0.4);
    transform: scale(1.05);
}

.quiz-option.correct .quiz-option-letter {
    background: #98c379;
    box-shadow: 0 4px 12px rgba(152, 195, 121, 0.4);
    transform: scale(1.05);
}

.quiz-option.correct-answer-highlight .quiz-option-letter {
    background: rgba(152, 195, 121, 0.6);
    border: 2px solid #98c379;
}

.quiz-option.incorrect .quiz-option-letter {
    background: #e06c75;
    box-shadow: 0 4px 12px rgba(224, 108, 117, 0.4);
    transform: scale(1.05);
}

.quiz-option-text {
    flex: 1;
    line-height: 1.6;
    font-weight: 500;
}

/* Quiz Sidebar */
.quiz-sidebar {
    width: 280px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), rgba(0, 150, 136, 0.05));
    border-left: 2px solid rgba(0, 150, 136, 0.3);
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    overflow-y: auto;
}

.quiz-sidebar-header {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

/* Score Display */
.quiz-score-display {
    text-align: center;
    padding: 24px 18px;
    background: linear-gradient(135deg, rgba(0, 150, 136, 0.2), rgba(0, 150, 136, 0.1));
    border: 1px solid rgba(0, 150, 136, 0.3);
    border-radius: 12px;
}

.quiz-score-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    font-weight: 600;
}

.quiz-score-value {
    font-size: 40px;
    font-weight: 700;
    color: #00998d;
    font-family: var(--font-mono);
    text-shadow: 0 2px 8px rgba(0, 150, 136, 0.2);
}

/* Progress Section */
.quiz-progress-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    background: rgba(0, 150, 136, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quiz-progress-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quiz-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 150, 136, 0.15);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00998d 0%, #26a69a 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    border-radius: 3px;
    box-shadow: 0 0 12px rgba(0, 150, 136, 0.5);
}

/* Navigation Buttons */
.quiz-navigation {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-nav-btn {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quiz-nav-btn:hover:not(:disabled) {
    background: rgba(0, 150, 136, 0.2);
    border-color: rgba(0, 150, 136, 0.4);
    box-shadow: 0 4px 12px rgba(0, 150, 136, 0.2);
    transform: translateY(-1px);
}

.quiz-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(0, 150, 136, 0.08);
}

/* Finish Section */
.quiz-finish-section {
    display: flex;
    flex-direction: column;
}

.quiz-finish-btn {
    padding: 16px 18px;
    background: linear-gradient(135deg, #d19a66, #e06c75);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 16px rgba(224, 108, 117, 0.3);
}

.quiz-finish-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(224, 108, 117, 0.5);
}

.quiz-finish-btn:active {
    transform: translateY(0);
}

/* Results Modal */
.quiz-results-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.quiz-results-container {
    background: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 16px;
    padding: 40px;
    max-width: 700px;
    width: 100%;
    position: relative;
}

.quiz-results-container .quiz-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
}

.quiz-results-content h2 {
    color: #ffffff;
    font-size: 32px;
    margin-bottom: 30px;
    text-align: center;
}

/* Score Display */
.quiz-results-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 30px;
    background: rgba(0, 150, 136, 0.1);
    border-radius: 12px;
}

.quiz-results-percentage {
    font-size: 64px;
    font-weight: 700;
    color: #00998d;
    text-align: center;
}

.quiz-results-text {
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: #ffffff;
}

.quiz-results-text > div {
    font-size: 16px;
}

/* Actions */
.quiz-results-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.quiz-retake-btn,
.quiz-back-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.quiz-retake-btn {
    background: #00998d;
    color: #ffffff;
}

.quiz-retake-btn:hover {
    background: #00796b;
}

.quiz-back-btn {
    background: rgba(0, 150, 136, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.quiz-back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Review Section */
.quiz-results-review {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--cell-border);
}

.quiz-results-review h3 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
}

.quiz-review-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.quiz-review-item {
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 4px solid rgba(0, 150, 136, 0.5);
}

.quiz-review-item:has(.quiz-review-status.incorrect) {
    border-left-color: #e06c75;
}

.quiz-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.quiz-review-header strong {
    color: #ffffff;
    font-size: 14px;
}

.quiz-review-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.quiz-review-status.correct {
    background: rgba(152, 195, 121, 0.2);
    color: #98c379;
}

.quiz-review-status.incorrect {
    background: rgba(224, 108, 117, 0.2);
    color: #e06c75;
}

.quiz-review-content {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.quiz-review-content p {
    margin: 0 0 8px 0;
}

.quiz-review-explanation {
    margin-top: 12px;
    padding: 12px;
    background: rgba(0, 150, 136, 0.1);
    border-radius: 6px;
    border-left: 3px solid #00998d;
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 1024px) {
    /* Tablet Mega Menu - 2 columns */
    .mega-menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mega-menu-submenu {
        min-width: 400px;
    }

    .quiz-slideshow {
        flex-direction: column;
    }

    .quiz-main-area {
        flex: 1;
        padding: 40px 20px;
    }

    .quiz-sidebar {
        width: 100%;
        max-height: 200px;
        flex-direction: row;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        gap: 20px;
        justify-content: space-around;
    }

    .quiz-question-text {
        font-size: 24px;
    }

    .quiz-option {
        padding: 16px;
        font-size: 14px;
    }
}

@media (max-width: 640px) {
    .quiz-slideshow {
        flex-direction: column;
    }

    .quiz-close-btn {
        width: 36px;
        height: 36px;
        font-size: 24px;
        top: 16px;
        right: 16px;
    }

    .quiz-main-area {
        padding: 30px 16px;
    }

    .quiz-question-text {
        font-size: 20px;
    }

    .quiz-option {
        padding: 14px;
        gap: 12px;
    }

    .quiz-option-letter {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .quiz-sidebar {
        flex-direction: column;
        max-height: none;
        gap: 16px;
    }

    .quiz-results-container {
        padding: 24px;
    }

    .quiz-results-score {
        flex-direction: column;
        gap: 16px;
    }

    .quiz-results-actions {
        flex-direction: column;
    }
}

/**
 * ============================================================================
 * TUTORIAL SYSTEM STYLES
 * ============================================================================
 */

/* Tutorial Container & Layout */
.tutorial-container {
    max-width: 1200px;
    margin: 0 auto;
}

.tutorial-content-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.tutorial-main-content {
    flex: 1;
    min-width: 0;
}

/* Tutorial Header */
.tutorial-header {
    margin-bottom: 40px;
    padding: 30px;
    background: rgba(0, 150, 136, 0.08);
    border-radius: 12px;
    border-left: 4px solid #00998d;
}

.tutorial-progress {
    margin-bottom: 20px;
}

.progress-counter {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    display: block;
    margin-bottom: 12px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 150, 136, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00998d, #26a69a);
    transition: width 0.4s ease;
    border-radius: 3px;
}

.tutorial-chapter-title {
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    margin: 16px 0;
    line-height: 1.2;
}

.chapter-meta {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.chapter-type-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(0, 150, 136, 0.2);
    border: 1px solid rgba(0, 150, 136, 0.4);
    color: #26a69a;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Tutorial Sidebar */
.tutorial-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.sidebar-section {
    background: rgba(0, 150, 136, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 16px 0;
}

/* Learning Progress Section */
.learning-progress {
    background: linear-gradient(135deg, rgba(0, 150, 136, 0.15), rgba(0, 150, 136, 0.05));
    border: 1px solid rgba(0, 150, 136, 0.3);
}

.progress-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.progress-percentage {
    font-size: 32px;
    font-weight: 700;
    color: #00998d;
}

.progress-stat {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.progress-stat .completed {
    color: #00998d;
    font-weight: 700;
}

.progress-bar-small {
    width: 100%;
    height: 4px;
    background: rgba(0, 150, 136, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill-small {
    height: 100%;
    background: linear-gradient(90deg, #00998d, #26a69a);
    transition: width 0.4s ease;
}

/* Chapters List */
.chapter-navigation {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chapter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(0, 150, 136, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none !important;
    transition: all 0.3s ease;
    font-size: 13px;
}

.chapter-item:hover {
    background: rgba(0, 150, 136, 0.15);
    border-color: rgba(0, 150, 136, 0.3);
    color: #1a1a1a;
    text-decoration: none !important;
}

.chapter-item.active {
    background: rgba(0, 150, 136, 0.2);
    border-color: #00998d;
    color: #ffffff;
    font-weight: 600;
}

.chapter-item.completed {
    opacity: 0.7;
}

.chapter-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(0, 150, 136, 0.2);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #00998d;
}

.chapter-item.active .chapter-number {
    background: #00998d;
    color: #ffffff;
}

.chapter-icon {
    font-size: 16px;
}

.chapter-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.completion-badge {
    font-size: 14px;
    color: #98c379;
}

/* Chapter Content */
.tutorial-chapter {
    background: rgba(255, 255, 255, 0.02);
    padding: 20px 0;
}

.chapter-introduction {
    margin-bottom: 30px;
}

.chapter-intro-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 0;
}

.chapter-content {
    font-size: 16px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

/* Video Chapter */
.video-player-container {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
}

.youtube-player,
.vimeo-player,
.self-hosted-player {
    width: 100%;
    height: 100%;
}

/* Audio Chapter */
.audio-player-container {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 150, 136, 0.1);
    border-radius: 8px;
}

.audio-player {
    width: 100%;
}

/* Quiz Chapter */
.quiz-question-display {
    background: rgba(0, 150, 136, 0.08);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.quiz-question-title {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 30px 0;
    line-height: 1.4;
}

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

.quiz-answer-option {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: rgba(0, 150, 136, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 15px;
}

.quiz-answer-option:hover:not(:disabled):not(.correct):not(.incorrect) {
    background: rgba(0, 150, 136, 0.15);
    border-color: rgba(0, 150, 136, 0.4);
}

.quiz-answer-option.correct {
    background: rgba(152, 195, 121, 0.2);
    border-color: #98c379;
}

.quiz-answer-option.incorrect {
    background: rgba(224, 108, 117, 0.2);
    border-color: #e06c75;
}

.quiz-answer-option.correct-answer-show {
    background: rgba(152, 195, 121, 0.15);
    border-color: #98c379;
    border-width: 3px;
}

.quiz-answer-option:disabled {
    cursor: not-allowed;
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.quiz-answer-option.correct .option-letter {
    background: #98c379;
}

.quiz-answer-option.incorrect .option-letter {
    background: #e06c75;
}

.option-text {
    flex: 1;
    line-height: 1.6;
}

.quiz-results-display {
    background: rgba(152, 195, 121, 0.1);
    border: 1px solid rgba(152, 195, 121, 0.3);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
}

.quiz-result-message {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.result-correct {
    color: #98c379;
}

.result-incorrect {
    color: #e06c75;
}

.quiz-explanation {
    text-align: left;
    margin: 30px 0;
}

.quiz-explanation h3 {
    font-size: 16px;
    color: #ffffff;
    margin: 0 0 16px 0;
}

.explanation-content {
    background: rgba(0, 150, 136, 0.08);
    padding: 16px;
    border-radius: 8px;
    border-left: 3px solid #00998d;
    line-height: 1.6;
}

/* Quiz Buttons Container */
.quiz-buttons-container {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* Quiz Try Again Button */
.quiz-try-again-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #666666, #888888);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
}

.quiz-try-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #777777, #999999);
}

/* Quiz Next Chapter Button */
.quiz-next-chapter-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #00998d, #26a69a);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
}

.quiz-next-chapter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 150, 136, 0.3);
    background: linear-gradient(135deg, #26a69a, #4db6ac);
}

/* Legacy - keeping for backwards compatibility */
.quiz-next-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #00998d, #26a69a);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
}

.quiz-next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 150, 136, 0.3);
}

/* Q&A Chapter */
/* Q&A Chapter - Simplified */
.tutorial-chapter-qa {
    background: transparent;
    border: none;
    padding: 0;
}

.qa-question-section {
    margin-bottom: 32px;
}

.qa-question-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, #000);
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.qa-answer-section {
    background: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 8px;
    padding: 24px;
    margin-top: 24px;
}

.qa-answer-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #000);
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent-color, #2563eb);
    display: inline-block;
}

.qa-answer-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary, #333);
}

.qa-answer-content p {
    margin-bottom: 12px;
}

.qa-answer-content h2,
.qa-answer-content h3,
.qa-answer-content h4 {
    margin: 16px 0 12px 0;
    font-weight: 600;
    color: var(--text-primary, #000);
}

.qa-answer-content code {
    background: var(--cell-border);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    font-family: 'Monaco', 'Menlo', monospace;
}

.qa-answer-content pre {
    background: var(--cell-border);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 16px;
}

/* Image/Gallery Chapter */
.chapter-featured-image {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
}

.chapter-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.project-actions {
    margin: 30px 0;
}

.project-link-btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #00998d, #26a69a);
    color: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.project-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 150, 136, 0.3);
}

.technologies-section {
    margin: 30px 0;
}

.technologies-section h3 {
    font-size: 16px;
    color: #ffffff;
    margin: 0 0 12px 0;
}

.technologies-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tech-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(0, 150, 136, 0.2);
    border: 1px solid rgba(0, 150, 136, 0.3);
    color: #26a69a;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

/* Tutorial Navigation */
.tutorial-navigation {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    background: rgba(0, 150, 136, 0.2);
    border: 1px solid rgba(0, 150, 136, 0.3);
    color: #26a69a;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
    cursor: pointer;
}

.nav-btn:hover:not(.disabled):not(.completed) {
    background: rgba(0, 150, 136, 0.3);
    border-color: #00998d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 150, 136, 0.2);
}

.nav-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-btn.completed {
    background: rgba(152, 195, 121, 0.2);
    border-color: #98c379;
    color: #98c379;
}

.chapter-info {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

/* Tutorial Category View (List) */
.tutorial-view .notebook-header {
    margin-bottom: 40px;
}

.tutorial-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tutorial-card {
    background: rgba(0, 150, 136, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.tutorial-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 150, 136, 0.3);
    box-shadow: 0 4px 16px rgba(0, 150, 136, 0.1);
}

.tutorial-card-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
}

.tutorial-number {
    flex-shrink: 0;
}

.tutorial-step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(0, 150, 136, 0.3), rgba(0, 150, 136, 0.1));
    border: 2px solid rgba(0, 150, 136, 0.3);
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
    color: #00998d;
}

.tutorial-content {
    flex: 1;
}

.tutorial-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.tutorial-title a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.tutorial-title a:hover {
    color: #00998d;
}

.tutorial-excerpt {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 12px 0;
    line-height: 1.6;
}

.tutorial-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.tutorial-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 150, 136, 0.2);
    border: 1px solid rgba(0, 150, 136, 0.3);
    color: #26a69a;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.tutorial-arrow {
    flex-shrink: 0;
    font-size: 24px;
    color: rgba(0, 150, 136, 0.5);
    transition: all 0.3s ease;
}

.tutorial-card:hover .tutorial-arrow {
    color: #00998d;
    transform: translateX(4px);
}

/* Responsive */
@media (max-width: 768px) {
    .tutorial-content-wrapper {
        flex-direction: column;
    }

    .tutorial-sidebar {
        width: 100%;
    }

    .chapter-type-badge {
        font-size: 11px;
        padding: 5px 10px;
    }

    .tutorial-chapter-title {
        font-size: 28px;
    }

    .nav-container {
        flex-direction: column;
        gap: 12px;
    }

    .nav-btn {
        width: 100%;
    }

    .chapter-item {
        font-size: 12px;
        padding: 10px;
    }

    .youtube-player,
    .vimeo-player,
    .self-hosted-player {
        min-height: 300px;
    }
}

/**
 * ============================================================================
 * COURSE LANDING PAGE STYLES
 * Udemy-inspired professional course overview page
 * ============================================================================
 */

.course-page-wrapper {
    width: 100%;
}

/* Hero Section */
.course-hero {
    background: linear-gradient(135deg, rgba(0, 150, 136, 0.15), rgba(0, 150, 136, 0.05));
    border-bottom: 1px solid rgba(0, 150, 136, 0.2);
    padding: 50px 0;
    margin-bottom: 40px;
}

.course-hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

.course-title {
    font-size: 48px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.course-intro-text {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 0;
    max-width: 800px;
}

/* Main Course Content */
.course-main {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* Left Side: Chapters Section */
.course-chapters-section {
    flex: 1;
    min-width: 0;
}

.chapters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(0, 150, 136, 0.2);
}

.chapters-title {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.chapters-count {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(0, 150, 136, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* Chapter List Items */
.course-chapters-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chapter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    text-decoration: none !important;
    transition: all 0.3s ease;
    cursor: pointer;
}

.chapter-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 150, 136, 0.3);
    box-shadow: 0 4px 12px rgba(0, 150, 136, 0.1);
    transform: translateX(8px);
    text-decoration: none !important;
}

.chapter-item-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.chapter-number-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(0, 150, 136, 0.3), rgba(0, 150, 136, 0.1));
    border: 2px solid rgba(0, 150, 136, 0.3);
    border-radius: 8px;
    flex-shrink: 0;
}

.badge-number {
    font-size: 16px;
    font-weight: 700;
    color: #00998d;
}

.chapter-info {
    min-width: 0;
}

.chapter-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 6px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chapter-item-type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.type-icon {
    font-size: 14px;
}

.type-label {
    font-weight: 500;
}

.chapter-item-arrow {
    font-size: 18px;
    color: rgba(0, 150, 136, 0.5);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chapter-item:hover .chapter-item-arrow {
    color: #00998d;
    transform: translateX(4px);
}

.no-chapters {
    padding: 40px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
}

/* Right Side: Course Overview */
.course-overview-section {
    width: 380px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

/* Course Video Container */
.course-video-container {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 8px 24px rgba(0, 150, 136, 0.15);
    aspect-ratio: 16 / 9;
    width: 100%;
}

.course-intro-video {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 12px;
}

/* Course Details Box */
.course-details-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

.course-details-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    font-size: 15px;
}

.course-details-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin: 20px 0 12px 0;
}

.course-details-content h3:first-child {
    margin-top: 0;
}

.course-details-content ul,
.course-details-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.course-details-content li {
    margin: 8px 0;
}

.course-details-content p {
    margin: 12px 0;
}

.course-details-content strong {
    color: #26a69a;
    font-weight: 700;
}

.course-details-content em {
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .course-main {
        flex-direction: column;
        gap: 30px;
    }

    .course-overview-section {
        width: 100%;
        position: static;
    }

    .course-title {
        font-size: 36px;
    }

    .chapters-header {
        flex-wrap: wrap;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .course-hero {
        padding: 30px 0;
        margin-bottom: 30px;
    }

    .course-hero-content {
        padding: 0 20px;
    }

    .course-title {
        font-size: 28px;
    }

    .course-intro-text {
        font-size: 16px;
    }

    .course-main {
        padding: 0 20px;
    }

    .chapter-item {
        padding: 14px 14px;
    }

    .chapter-item-title {
        font-size: 14px;
    }

    .chapter-number-badge {
        width: 36px;
        height: 36px;
    }

    .course-details-box {
        padding: 20px;
    }

    .course-details-content {
        font-size: 14px;
    }
}

/* ===== TUTORIAL LESSON POST LAYOUT ===== */
/* Two-column layout for lesson posts with sidebar navigation */

.content-wrapper {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.site-main.tutorial-container {
    flex: 1;
    min-width: 0;
}

/* Lesson Content Wrapper - flexbox for content and sidebar */
.tutorial-content-wrapper {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.tutorial-main-content {
    flex: 1;
    min-width: 0;
}

/* Tutorial Sidebar positioning - same as video sidebar */
.tutorial-sidebar,
.sidebar.tutorial-sidebar-wrapper {
    width: 320px;
    flex-shrink: 0;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    position: sticky;
    top: 100px;
}

.tutorial-sidebar .sidebar-inner,
.sidebar.tutorial-sidebar-wrapper .sidebar-inner {
    padding: 0;
}

/* Learning Progress Section */
.tutorial-sidebar .sidebar-section,
.sidebar.tutorial-sidebar-wrapper .sidebar-section {
    background: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.tutorial-sidebar .sidebar-title,
.sidebar.tutorial-sidebar-wrapper .sidebar-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--cell-border);
}

/* Progress Display */
.learning-progress {
    text-align: center;
}

.progress-display {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.progress-percentage {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-color, #2563eb);
}

.progress-stat {
    font-size: 13px;
    color: var(--text-secondary, #666);
}

.progress-stat .completed {
    font-weight: 600;
    color: var(--text-primary, #000);
}

.progress-bar-small {
    width: 100%;
    height: 6px;
    background: var(--cell-border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill-small {
    height: 100%;
    background: var(--accent-color, #2563eb);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Chapter List */
.chapters-list .chapter-navigation {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chapter-navigation .chapter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    border-radius: 6px;
    color: var(--text-primary, #333);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 13px;
}

.chapter-navigation .chapter-item:hover {
    background: var(--hover-bg, #f5f5f5);
}

.chapter-navigation .chapter-item.active {
    background: var(--accent-color, #2563eb);
    color: white;
    font-weight: 600;
}

.chapter-navigation .chapter-item.completed {
    opacity: 0.6;
}

.chapter-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cell-border);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
}

.chapter-item.active .chapter-number {
    background: rgba(255, 255, 255, 0.3);
}

.chapter-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.completion-badge {
    font-size: 14px;
    color: #22c55e;
    font-weight: bold;
}

/* Tutorial Chapter Header */
.tutorial-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--cell-border);
}

.tutorial-progress {
    margin-bottom: 16px;
}

.progress-counter {
    font-size: 13px;
    color: var(--text-secondary, #666);
    display: block;
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--cell-border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-color, #2563eb);
    transition: width 0.3s ease;
}

.tutorial-chapter-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
    color: var(--text-primary, #000);
}

.chapter-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.chapter-type-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* Tutorial Chapter Content */
.tutorial-chapter {
    background: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 8px;
    padding: 28px;
    margin-bottom: 24px;
}

.tutorial-chapter-text {
    background: transparent;
    border: none;
    padding: 0;
}

.chapter-introduction {
    margin-bottom: 20px;
}

.chapter-intro-text {
    font-size: 16px;
    color: var(--text-secondary, #666);
    font-style: italic;
    line-height: 1.6;
    margin: 0;
}

.chapter-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary, #333);
}

.chapter-content p {
    margin-bottom: 16px;
}

.chapter-content h2,
.chapter-content h3,
.chapter-content h4 {
    margin: 24px 0 12px 0;
    font-weight: 600;
    color: var(--text-primary, #000);
}

.chapter-content code {
    background: var(--cell-border);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    font-family: 'Monaco', 'Menlo', monospace;
}

.chapter-content pre {
    background: var(--cell-border);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 16px;
}

/* Tutorial Navigation */
.tutorial-navigation {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--cell-border);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-btn {
    padding: 10px 16px;
    background: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-primary, #333);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    display: inline-block;
}

.nav-btn:hover:not(.disabled):not(.completed) {
    background: var(--accent-color, #2563eb);
    color: white;
    border-color: var(--accent-color, #2563eb);
}

.nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--cell-border);
}

.nav-btn.completed {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

.chapter-info {
    font-size: 13px;
    color: var(--text-secondary, #666);
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .content-wrapper {
        flex-direction: column;
        gap: 16px;
    }

    .tutorial-content-wrapper {
        flex-direction: column;
        gap: 16px;
    }

    .tutorial-sidebar {
        width: 100%;
        max-height: none;
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .tutorial-chapter-title {
        font-size: 24px;
    }

    .tutorial-chapter {
        padding: 16px;
    }

    .nav-container {
        flex-wrap: wrap;
    }

    .nav-btn {
        flex: 1;
        min-width: 100px;
    }

    .chapter-info {
        width: 100%;
        text-align: center;
        order: 3;
    }

    .chapter-navigation .chapter-item {
        padding: 10px 8px;
        font-size: 12px;
    }

    .chapter-number {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }

    /* Mobile Touch Target Optimization */
    /* Ensure all interactive elements have minimum 44x44px touch target */
    button,
    a[role="button"],
    input[type="button"],
    input[type="submit"],
    .btn,
    a.btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px !important;
        font-size: 14px;
        touch-action: manipulation;
    }

    .quiz-nav-btn,
    .nav-btn,
    .quiz-option,
    .quiz-finish-btn,
    .quiz-try-again-btn,
    .quiz-next-chapter-btn {
        min-height: 48px;
        padding: 14px 16px !important;
        font-size: 14px;
        margin-bottom: 12px;
    }

    .quiz-option {
        width: 100%;
        text-align: left;
        margin-bottom: 10px;
    }

    /* Enhanced Form Element Touch Targets */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    textarea,
    select {
        min-height: 44px;
        padding: 12px 14px;
        font-size: 16px;
        border-radius: 6px;
    }

    textarea {
        min-height: 100px;
    }

    /* Link Spacing for Mobile */
    a {
        /* Increase tap area without changing visual size using pseudo-element */
        position: relative;
    }

    a:after {
        content: '';
        position: absolute;
        top: -8px;
        left: -8px;
        right: -8px;
        bottom: -8px;
    }

    /* Mobile Category Links - Better Touch Targets */
    .category-link,
    .post-link,
    .chapter-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 12px !important;
    }

    /* Podcast Card Touch Area */
    .podcast-card,
    .video-card,
    .qa-item {
        cursor: pointer;
        border-radius: 8px;
    }

    /* Mobile Sidebar Navigation */
    .sidebar a {
        display: block;
        padding: 12px 16px;
        min-height: 44px;
        display: flex;
        align-items: center;
        text-decoration: none;
    }

    /* Mobile Footer */
    .footer-main {
        padding: 40px 0 30px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-column {
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(0, 150, 136, 0.15);
    }

    .footer-column:last-child {
        border-bottom: none;
    }

    .footer-column .widget-title {
        font-size: 14px;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .footer-column .widget a {
        font-size: 13px;
    }

    .footer-bottom {
        padding: 20px 0;
    }

    .footer-bottom-content {
        justify-content: center;
        text-align: center;
        flex-direction: column;
        gap: 15px;
    }

    .footer-copyright p {
        font-size: 12px;
    }

    .footer-menu {
        justify-content: center;
        gap: 15px;
        font-size: 12px;
    }

    .footer-menu a {
        font-size: 12px;
    }
}

/* ============================================================================
   SUBCATEGORY GRID LAYOUT
   Full-page grid display for root categories showing their subcategories
   ============================================================================ */

.subcategory-grid-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.subcategory-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 30px;
    padding: 0;
}

.subcategory-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 32px 24px;
    background: rgba(0, 150, 136, 0.05);
    border: 1px solid rgba(0, 150, 136, 0.15);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    min-height: 200px;
    box-sizing: border-box;
}

.subcategory-card:hover {
    background: rgba(0, 150, 136, 0.12);
    border-color: rgba(0, 150, 136, 0.35);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 150, 136, 0.2);
}

.subcategory-icon,
.subcategory-icon-letter {
    font-size: 48px;
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

.subcategory-icon-letter {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 150, 136, 0.2), rgba(0, 150, 136, 0.4));
    border-radius: 50%;
    font-size: 32px;
    font-weight: 700;
    color: #00bfa5;
}

.subcategory-card:hover .subcategory-icon,
.subcategory-card:hover .subcategory-icon-letter {
    transform: scale(1.1);
}

.subcategory-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    text-align: center;
    color: var(--text-primary);
}

.subcategory-description {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin: 0 0 12px 0;
    line-height: 1.5;
    flex-grow: 1;
}

.subcategory-count {
    font-size: 12px;
    color: var(--text-tertiary);
    padding: 6px 14px;
    background: rgba(0, 150, 136, 0.15);
    border-radius: 16px;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .subcategory-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .subcategory-card {
        padding: 24px 16px;
        min-height: 180px;
    }

    .subcategory-icon,
    .subcategory-icon-letter {
        font-size: 36px;
    }

    .subcategory-icon-letter {
        width: 52px;
        height: 52px;
        font-size: 26px;
    }

    .subcategory-title {
        font-size: 16px;
    }

    .subcategory-description {
        font-size: 12px;
    }
}

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

/* ============================================================================
   PATHWAY / LEARNING JOURNEY LAYOUT
   Visual roadmap/timeline layout for learning pathways
   ============================================================================ */

/* Pathway Page Wrapper */
.pathway-page-wrapper {
    width: 100%;
    min-height: 100vh;
}

/* Pathway Hero Section */
.pathway-hero {
    background: linear-gradient(135deg, rgba(0, 150, 136, 0.15), rgba(0, 150, 136, 0.05));
    border-bottom: 2px solid var(--cell-border);
    padding: 60px 20px;
    text-align: center;
}

.pathway-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.pathway-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.pathway-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.pathway-description {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 30px 0;
}

.pathway-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 150, 136, 0.1);
    border-radius: 12px;
    border: 1px solid var(--cell-border-teal);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-direction: column;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    font-size: 24px;
}

.stat-divider {
    color: var(--text-tertiary);
    font-size: 24px;
}

/* Pathway Content Area */
.pathway-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.pathway-main {
    min-width: 0;
}

/* Journey Timeline */
.journey-timeline {
    position: relative;
    padding: 20px 0;
}

/* Start and End Markers */
.journey-start,
.journey-end {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.start-marker,
.end-marker {
    text-align: center;
    padding: 30px 40px;
    background: linear-gradient(135deg, rgba(0, 150, 136, 0.2), rgba(0, 150, 136, 0.1));
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    position: relative;
}

.marker-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: pulse 2s ease-in-out infinite;
}

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

.marker-label {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.marker-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* Journey Step */
.journey-step {
    position: relative;
    margin: 50px 0;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Step Connector */
.step-connector {
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    width: 4px;
    height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.connector-line {
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), rgba(0, 150, 136, 0.3));
    border-radius: 2px;
}

.connector-dots {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.connector-dots .dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.6;
    animation: dotPulse 1.5s ease-in-out infinite;
}

.connector-dots .dot:nth-child(2) {
    animation-delay: 0.3s;
}

.connector-dots .dot:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes dotPulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Step Card */
.step-card {
    background: linear-gradient(135deg, rgba(43, 43, 43, 1) 0%, rgba(35, 35, 35, 0.95) 100%);
    border: 2px solid var(--cell-border);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(0, 150, 136, 0.1) inset;
}

.step-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        var(--primary-color) 0%,
        var(--primary-light) 50%,
        var(--primary-color) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.step-card:hover::before {
    opacity: 1;
}

.step-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at top left,
        rgba(0, 150, 136, 0.15) 0%,
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.step-card:hover::after {
    opacity: 1;
}

.step-card:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: var(--primary-color);
    box-shadow: 0 16px 40px rgba(0, 150, 136, 0.35),
                0 8px 16px rgba(0, 0, 0, 0.5),
                0 0 0 1px var(--primary-color) inset;
}

/* Step Number Badge */
.step-number-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    filter: drop-shadow(0 4px 8px rgba(0, 150, 136, 0.4));
}

.badge-circle {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 50%, var(--primary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--notebook-bg);
    box-shadow: 0 0 0 2px var(--primary-color),
                0 6px 16px rgba(0, 150, 136, 0.6);
    position: relative;
    transition: all 0.3s ease;
}

.badge-circle::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), transparent);
    opacity: 0.3;
    animation: rotateBadge 4s linear infinite;
}

@keyframes rotateBadge {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.step-card:hover .badge-circle {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 0 0 2px var(--primary-light),
                0 8px 20px rgba(0, 150, 136, 0.8);
}

.badge-text {
    font-size: 12px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Step Content Wrapper */
.step-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 24px 24px 24px;
    position: relative;
}

.step-content-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 150, 136, 0.3) 50%,
        transparent 100%);
}

/* Step Thumbnail */
.step-thumbnail {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #2d2d2d 0%, #1e1e1e 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 150, 136, 0.2);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
}

.step-thumbnail::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 150, 136, 0.1) 0%,
        transparent 50%
    );
    z-index: 1;
    pointer-events: none;
}

.step-card:hover .step-thumbnail {
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(0, 150, 136, 0.4);
}

.step-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.95);
}

.step-thumbnail:hover img {
    transform: scale(1.15) rotate(2deg);
    filter: brightness(1.1);
}

.thumbnail-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 150, 136, 0.85) 0%,
        rgba(0, 150, 136, 0.95) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.step-thumbnail:hover .thumbnail-overlay {
    opacity: 1;
}

.view-icon {
    font-size: 40px;
    color: white;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: bounceIcon 0.6s ease-in-out;
}

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

/* Step Text Content */
.step-text-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    padding-left: 90px;
}

.step-text-content::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg,
        var(--primary-color) 0%,
        var(--primary-light) 50%,
        transparent 100%);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.step-card:hover .step-text-content::before {
    opacity: 1;
}

.step-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.step-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.step-title a {
    background: linear-gradient(135deg,
        var(--text-primary) 0%,
        rgba(212, 212, 212, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.step-card:hover .step-title a {
    background: linear-gradient(135deg,
        var(--primary-light) 0%,
        var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.step-title a:hover {
    transform: translateX(4px);
}

.step-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-icon {
    font-size: 14px;
}

.meta-divider {
    color: var(--text-tertiary);
}

.step-excerpt {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Step Footer */
.step-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 2px solid rgba(0, 150, 136, 0.15);
}

.step-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 150, 136, 0.3),
                0 0 0 0 rgba(0, 150, 136, 0.4);
    position: relative;
    overflow: hidden;
}

.step-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.2) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.step-button:hover::before {
    opacity: 1;
}

.step-button:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    transform: translateX(8px) translateY(-2px);
    color: white;
    box-shadow: 0 8px 20px rgba(0, 150, 136, 0.5),
                0 0 0 4px rgba(0, 150, 136, 0.2);
}

.button-arrow {
    font-size: 18px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: bold;
}

.step-button:hover .button-arrow {
    transform: translateX(8px);
    animation: arrowSlide 0.8s ease-in-out infinite;
}

@keyframes arrowSlide {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

.step-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-badge {
    padding: 6px 14px;
    background: rgba(0, 150, 136, 0.15);
    border: 1px solid rgba(0, 150, 136, 0.3);
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.tag-badge:hover {
    background: rgba(0, 150, 136, 0.3);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Pathway Sidebar */
.pathway-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.pathway-sidebar .sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pathway-sidebar .widget {
    background: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 12px;
    padding: 20px;
}

.pathway-sidebar .widget-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

/* Journey Progress Widget */
.journey-progress-widget .progress-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.progress-stat {
    text-align: center;
    padding: 16px;
    background: rgba(0, 150, 136, 0.1);
    border-radius: 8px;
}

.stat-value {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-text {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-bar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--notebook-bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

/* Journey Navigation Widget */
.journey-steps-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.journey-nav-item {
    margin: 0;
}

.journey-nav-item .nav-link {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    background: rgba(0, 150, 136, 0.05);
    border: 1px solid transparent;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.journey-nav-item .nav-link:hover {
    background: rgba(0, 150, 136, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-step-number {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.nav-step-title {
    font-size: 13px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Empty State */
.no-pathway-steps {
    padding: 60px 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
    background: var(--cell-bg);
    border: 2px dashed var(--cell-border);
    border-radius: 16px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 24px;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* Responsive Design for Pathway Layout */
@media (max-width: 1024px) {
    .pathway-content {
        grid-template-columns: 1fr;
    }

    .pathway-sidebar {
        position: static;
    }

    .step-content-wrapper {
        grid-template-columns: 200px 1fr;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .pathway-hero {
        padding: 40px 16px;
    }

    .pathway-icon {
        font-size: 48px;
    }

    .pathway-title {
        font-size: 28px;
    }

    .pathway-description {
        font-size: 14px;
    }

    .pathway-stats {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .stat-divider {
        display: none;
    }

    .pathway-content {
        padding: 30px 16px;
    }

    .step-content-wrapper {
        padding: 20px 16px 16px 16px;
    }

    .step-text-content {
        padding-left: 80px;
    }

    .step-thumbnail {
        width: 100%;
        max-width: 100%;
    }

    .step-title {
        font-size: 18px;
    }

    .badge-circle {
        width: 60px;
        height: 60px;
    }

    .badge-text {
        font-size: 11px;
    }

    .step-number-badge {
        top: 16px;
        left: 16px;
    }

    .step-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .step-button {
        width: 100%;
        justify-content: center;
    }

    .journey-nav-widget {
        max-height: 400px;
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .pathway-title {
        font-size: 24px;
    }

    .pathway-icon {
        font-size: 40px;
    }

    .journey-step {
        margin: 40px 0;
    }

    .step-connector {
        height: 40px;
    }

    .badge-circle {
        width: 50px;
        height: 50px;
    }

    .badge-text {
        font-size: 10px;
        letter-spacing: 0.5px;
    }

    .step-number-badge {
        top: 12px;
        left: 12px;
    }

    .step-text-content {
        padding-left: 70px;
    }

    .step-title {
        font-size: 16px;
    }

    .marker-icon {
        font-size: 40px;
    }

    .marker-label {
        font-size: 18px;
    }
}
