/* Show header on note list pages, hide on individual note pages */
.page-header {
    display: none;
}

body.viewing-note .page-header {
    display: none;
}

body.about-active .page-header {
    display: none;
}

/* Hide main title and subtitle in general */
.main-title,
.subtitle {
    display: none;
}

/* Search section styling */
.search-section {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

/* Hide search section and related elements on about page and individual notes */
body.about-active .search-section,
body.about-active .search-toggle,
body.about-active .search-container,
body.about-active .filters-container,
body.viewing-note .search-section,
body.viewing-note .search-toggle,
body.viewing-note .search-container,
body.viewing-note .filters-container {
    display: none !important;
}

.search-toggle {
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--accent-brown);
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(139, 111, 71, 0.08);
}

/* Hide search button, search container, and filters on about page */
body.about-active .search-toggle,
body.about-active .search-container,
body.about-active .filters-container {
    display: none !important;
}

/* About page: force About heading to black */
.about-body h1 {
    color: #111 !important;
}

/* Sidebar About button - Vintage bookmark tab */
.sidebar-footer .about-link {
    display: block;
    width: 100%;
    text-align: center;
    background: linear-gradient(135deg, #d4a574 0%, #c9945e 100%);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.8px;
    padding: 12px 0;
    margin-top: 30px;
    margin-bottom: 0;
    border: none;
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    text-decoration: none;
    text-transform: uppercase;
    position: relative;
    font-family: 'Patrick Hand', cursive;
    clip-path: polygon(
        0 0,
        85% 0,
        100% 50%,
        85% 100%,
        0 100%
    );
}\n.sidebar-footer .about-link:hover {
    background: linear-gradient(135deg, #c9945e 0%, #b8844d 100%);
    transform: translateX(3px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
/* ===== About Page Styles - Unique Vintage Journal Entry ===== */
.about-section {
    padding: 40px;
    margin: 0 auto;
    max-width: 850px;
    position: relative;
    background: linear-gradient(to bottom, 
        rgba(255, 248, 240, 0.3) 0%, 
        rgba(245, 235, 224, 0.5) 100%);
    border-left: 3px solid var(--accent-brown);
    border-right: 1px solid rgba(139, 111, 71, 0.2);
}

/* Coffee stain decoration */
.about-section::before {
    content: '';
    position: absolute;
    top: 20px;
    right: 40px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, 
        rgba(139, 111, 71, 0.08) 0%, 
        rgba(139, 111, 71, 0.04) 40%, 
        transparent 70%);
    pointer-events: none;
}

/* Paper fold corner */
.about-section::after {
    content: '';
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, 
        transparent 50%, 
        rgba(139, 111, 71, 0.15) 50%);
    border-top-left-radius: 4px;
    pointer-events: none;
}

.about-content {
    width: 100%;
    position: relative;
    z-index: 1;
}

.about-body {
    font-size: 1.08rem;
    color: #2b2b2b;
    line-height: 1.9;
    font-family: 'Georgia', serif;
    word-break: break-word;
}

.about-body h1, .about-body h2, .about-body h3 {
    color: var(--accent-dark);
    font-family: 'Caveat', cursive;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    position: relative;
}

/* Handwritten title with underline flourish */
.about-body h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-top: 0;
    padding-bottom: 20px;
    border-bottom: 3px double var(--accent-brown);
    text-shadow: 1px 1px 0px rgba(139, 111, 71, 0.1);
}

.about-body h1::after {
    content: '~';
    position: absolute;
    right: 0;
    bottom: -10px;
    font-size: 1.5rem;
    color: var(--accent-brown);
    opacity: 0.6;
}

.about-body h2 {
    font-size: 1.8rem;
    font-weight: 600;
}

.about-body h2::before {
    content: '✦';
    margin-right: 10px;
    color: var(--accent-brown);
    opacity: 0.5;
}

.about-body h3 {
    font-size: 1.3rem;
    font-weight: 500;
    font-style: italic;
}

.about-body p {
    margin-bottom: 1.1em;
}

.about-body ul, .about-body ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.about-body a {
    color: var(--accent-brown);
    text-decoration: underline;
    transition: color 0.15s;
}
.about-body a:hover {
    color: var(--accent-dark);
}


/* ===== CSS Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 20px;
}

:root {
    --paper-bg: #f5ebe0;
    --paper-dark: #e3d5ca;
    --text-primary: #2b2b2b;
    --text-secondary: #5a5a5a;
    --accent-brown: #8b6f47;
    --accent-dark: #6d5535;
    --border-color: #d4c4b0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --binding-shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Georgia', serif;
    /* Rich walnut wood desk */
    background-color: #3d2f2a;
    background-image: 
        /* Wood grain streaks */
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            rgba(90, 60, 40, 0.15) 2px,
            transparent 4px,
            transparent 40px,
            rgba(70, 45, 30, 0.2) 41px,
            transparent 43px,
            transparent 80px
        ),
        /* Horizontal wood lines */
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.03) 0px,
            transparent 1px,
            transparent 3px
        ),
        /* Base gradient for depth */
        linear-gradient(135deg, 
            #3d2f2a 0%, 
            #4a3832 30%,
            #5a4438 50%,
            #4a3832 70%,
            #3d2f2a 100%);
    min-height: 100vh;
    padding: 40px 20px;
    color: var(--text-primary);
    font-weight: 400;
    position: relative;
}

/* Burgundy leather desk mat */
body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(1300px, 90vw);
    height: min(900px, 85vh);
    /* Rich burgundy leather base */
    background-color: #8b3a3a;
    background-image: 
        /* Leather grain pattern */
        repeating-radial-gradient(
            circle at 20% 30%,
            transparent 0px,
            rgba(0, 0, 0, 0.04) 1px,
            transparent 2px,
            transparent 15px
        ),
        repeating-radial-gradient(
            circle at 80% 70%,
            transparent 0px,
            rgba(0, 0, 0, 0.03) 1px,
            transparent 2px,
            transparent 18px
        ),
        /* Subtle sheen variation */
        linear-gradient(125deg,
            #7d3333 0%,
            #8b3a3a 20%,
            #9d4444 40%,
            #a84c4c 50%,
            #9d4444 60%,
            #8b3a3a 80%,
            #7d3333 100%);
    border-radius: 4px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.08),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    z-index: -10;
}

/* Mechanical pencil on desk */
body::after {
    content: '';
    position: fixed;
    bottom: calc(50vh - 380px);
    right: calc(50vw - 680px);
    width: 180px;
    height: 8px;
    background: 
        linear-gradient(to right,
            #2c2c2c 0%,
            #3a3a3a 15%,
            #4a4a4a 30%,
            #d4af37 30%,
            #f5d76e 40%,
            #d4af37 50%,
            #4a4a4a 50%,
            #3a3a3a 85%,
            #2c2c2c 100%);
    border-radius: 1px;
    box-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transform: rotate(-15deg);
    z-index: 0;
}

/* Pencil tip */
body::after {
    background: 
        linear-gradient(to right,
            #8b7355 0%,
            #d2b48c 2%,
            #f5e6d3 4%,
            transparent 4%,
            transparent 6%,
            #2c2c2c 6%,
            #3a3a3a 15%,
            #4a4a4a 30%,
            #d4af37 30%,
            #f5d76e 40%,
            #d4af37 50%,
            #4a4a4a 50%,
            #3a3a3a 85%,
            #2c2c2c 100%);
}

/* ===== Notebook Container ===== */
.notebook-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--paper-bg);
    border-radius: 8px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.35),
        0 10px 30px rgba(0, 0, 0, 0.25),
        0 5px 15px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.3);
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 85vh;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Bookmark ribbon */
.notebook-container::after {
    content: '';
    position: absolute;
    top: -5px;
    right: 180px;
    width: 30px;
    height: 60px;
    background: linear-gradient(to bottom, #c94545 0%, #a83838 100%);
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.2),
        2px 2px 6px rgba(0, 0, 0, 0.3);
    clip-path: polygon(0 0, 100% 0, 100% 85%, 50% 100%, 0 85%);
    z-index: 0;
}

/* Add subtle paper texture and grain */
.notebook-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 85% 15%, rgba(139, 111, 71, 0.04) 0%, transparent 35%),
        radial-gradient(circle at 15% 75%, rgba(139, 111, 71, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(200, 180, 160, 0.02) 0%, transparent 60%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(139, 111, 71, 0.012) 2px,
            rgba(139, 111, 71, 0.012) 3px
        );
    pointer-events: none;
    z-index: 1;
}

/* ===== Notebook Binding ===== */
.notebook-binding {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    background: linear-gradient(to right, 
        #8b7355 0%,
        #9d8567 20%,
        #a88f6f 40%,
        rgba(139, 111, 71, 0.3) 70%,
        transparent 100%);
    box-shadow: 
        inset -3px 0 8px rgba(0, 0, 0, 0.4),
        inset 2px 0 3px rgba(255, 255, 255, 0.2);
    z-index: 10;
    pointer-events: none;
}

/* Spiral binding holes/rings */
.notebook-binding::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 20px;
    bottom: 20px;
    width: 20px;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 30px,
        rgba(0, 0, 0, 0.15) 30px,
        rgba(0, 0, 0, 0.15) 32px,
        transparent 32px,
        transparent 40px
    );
}

/* Metal spiral rings */
.notebook-binding::after {
    content: '';
    position: absolute;
    left: 18px;
    top: 35px;
    width: 14px;
    height: calc(100% - 70px);
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 35px,
        /* Ring top */
        radial-gradient(ellipse at center, 
            rgba(200, 200, 200, 0.9) 0%,
            rgba(160, 160, 160, 0.8) 40%,
            rgba(120, 120, 120, 0.7) 60%,
            transparent 70%) 35px,
        transparent 42px
    );
    background-size: 14px 45px;
    opacity: 0.6;
}

/* ===== Sidebar ===== */
.sidebar {
    background: linear-gradient(to bottom, #ede3d8 0%, #e3d5ca 100%);
    border-right: 2px solid var(--border-color);
    padding: 80px 30px 30px 60px;
    position: relative;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50px;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 31px,
            var(--border-color) 31px,
            var(--border-color) 32px
        );
    opacity: 0.3;
    pointer-events: none;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Patrick Hand', cursive;
}

.category-nav {
    position: relative;
    z-index: 1;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 12px;
}

.category-link {
    display: block;
    padding: 10px 14px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    border: 1px solid transparent;
}

.category-link:hover {
    background: rgba(139, 111, 71, 0.12);
    color: var(--accent-dark);
    transform: translateX(3px);
    border-color: rgba(139, 111, 71, 0.2);
    box-shadow: 0 2px 6px rgba(139, 111, 71, 0.1);
}

.category-link.active {
    background: var(--accent-brown);
    color: white;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(139, 111, 71, 0.3);
}

.sidebar-footer {
    position: absolute;
    bottom: 30px;
    left: 60px;
    right: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.about-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.about-link:hover {
    color: var(--accent-dark);
}

/* ===== Content Area ===== */
.content-area {
    padding: 60px 60px 60px 40px;
    background: var(--paper-bg);
    position: relative;
    overflow-y: auto;
}

/* Add left margin line like a ruled notebook */
.content-area::after {
    content: '';
    position: absolute;
    left: 35px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(220, 100, 100, 0.25);
    z-index: 1;
    pointer-events: none;
}

.content-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 31px,
            rgba(212, 196, 176, 0.15) 31px,
            rgba(212, 196, 176, 0.15) 32px
        );
    pointer-events: none;
    z-index: 0;
}

.content-area > * {
    position: relative;
    z-index: 1;
}

/* ===== Page Header ===== */
.page-header {
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(139, 111, 71, 0.15);
}

.main-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-dark);
    margin-bottom: 8px;
    font-family: 'Caveat', cursive;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(139, 111, 71, 0.1);
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0;
    line-height: 1.6;
}

.search-toggle:hover {
    background: var(--accent-brown);
    color: white;
    border-color: var(--accent-brown);
    box-shadow: 0 2px 8px rgba(139, 111, 71, 0.2);
    transform: scale(1.05);
}

/* ===== Search Container ===== */
.search-container {
    margin-bottom: 30px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-brown);
}

/* ===== Advanced Filters ===== */
.filters-container {
    background: rgba(255, 255, 255, 0.4);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
    flex: 1;
}

.filter-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-dark);
    font-family: 'Patrick Hand', cursive;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 600px;
}

.tag-filter-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    background: #f5f5f5;
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Patrick Hand', cursive;
    color: var(--text-secondary);
    font-weight: 500;
}

.tag-filter-btn:hover {
    background: #e8e8e8;
    border-color: var(--accent-brown);
}

.tag-filter-btn.active {
    background: var(--accent-brown);
    color: white;
    border-color: var(--accent-dark);
    box-shadow: 0 2px 6px rgba(139, 111, 71, 0.3);
}

.filter-select {
    padding: 10px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-brown);
}

.btn-clear-filters {
    padding: 10px 20px;
    background: linear-gradient(135deg, #e57373 0%, #ef5350 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Patrick Hand', cursive;
    box-shadow: 0 2px 6px rgba(229, 115, 115, 0.3);
    align-self: flex-end;
}

.btn-clear-filters:hover {
    background: linear-gradient(135deg, #ef5350 0%, #e53935 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 115, 115, 0.4);
}

.btn-clear-filters:active {
    transform: translateY(0);
}

.filter-toggle-btn {
    background: var(--accent-brown);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filter-toggle-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 111, 71, 0.3);
}

/* ===== Notes Section ===== */
.notes-section {
    margin-top: 30px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent-dark);
    margin-bottom: 12px;
    font-family: 'Caveat', cursive;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.section-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 30px;
    font-style: italic;
}

.recent-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-dark);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--accent-brown);
    position: relative;
}

.recent-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent-dark);
    border-radius: 3px;
}

/* ===== Notes List ===== */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.note-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.6);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(139, 111, 71, 0.08);
}

.note-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--accent-brown);
    box-shadow: 0 8px 24px rgba(139, 111, 71, 0.18), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(6px) translateY(-2px);
}

.note-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    padding-top: 2px;
}

.note-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.note-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent-dark);
    margin: 0;
    font-family: 'Patrick Hand', cursive;
    letter-spacing: 0.4px;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.note-item:hover .note-title {
    color: var(--accent-brown);
}

.note-description {
    font-size: 1.02rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-family: 'Georgia', serif;
}

/* ===== Loading & Empty States ===== */
.loading-message,
.empty-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 1.1rem;
}

/* ===== Responsive Design ===== */
@media (max-width: 968px) {
    body {
        padding: 15px;
    }
    
    .notebook-container {
        grid-template-columns: 1fr;
        min-height: auto;
        border-radius: 4px;
    }

    .notebook-binding {
        display: none;
    }
    
    /* Hide decorative ribbon on mobile */
    .notebook-container::after {
        display: none;
    }

    .sidebar {
        padding: 20px;
        border-right: none;
        border-bottom: 2px solid var(--border-color);
    }

    .sidebar::before {
        left: 0;
    }

    .sidebar-footer {
        position: static;
        margin-top: 20px;
        left: auto;
        right: auto;
    }
    
    .sidebar-footer .about-link {
        margin-top: 20px;
    }

    .content-area {
        padding: 25px 20px;
    }

    .main-title {
        font-size: 2.2rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .note-item {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* Better about section on tablet */
    .about-section {
        padding: 25px 20px;
    }
}

/* ===== Note Detail View ===== */
.note-detail {
    padding: 30px 40px 40px 40px;
    animation: fadeIn 0.3s ease-in-out;
}

.back-button {
    background: #f5ebe0;
    color: var(--accent-brown);
    border: 1px solid #e3d5ca;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(139, 115, 85, 0.07);
    transition: all 0.15s ease;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    margin-bottom: 30px;
}

.back-button:hover {
    background: #e3d5ca;
    color: #6d5535;
    box-shadow: 0 2px 6px rgba(139, 115, 85, 0.12);
    transform: translateX(-2px);
}

.note-content {
    max-width: 900px;
    padding: 0;
}

.note-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.note-header-image {
    margin: 0 0 24px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1.5px solid var(--border-color);
}

.note-header-image img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.note-header-image:hover img {
    transform: scale(1.02);
}

.note-header .note-title {
    font-size: 2rem;\n    margin-bottom: 8px;
    color: var(--text-primary);
    font-family: 'Caveat', 'Patrick Hand', cursive;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.note-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.note-meta .note-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

.note-meta .note-category {
    display: inline-block;
    padding: 5px 14px;
    background: var(--accent-brown);
    color: white;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    box-shadow: 0 1px 4px rgba(139, 111, 71, 0.3);
}

.note-body {
    line-height: 1.8;
    font-size: 1.05rem;
    font-family: 'Georgia', serif;
    position: relative;
}

/* Section intent markers - subtle margin annotations */
.note-body h2::before,
.note-body h3::before {
    content: '§';
    position: absolute;
    left: -30px;
    color: var(--accent-brown);
    opacity: 0.3;
    font-size: 0.8em;
    font-family: 'Georgia', serif;
    font-weight: 400;
}

.note-body p:first-of-type::first-letter {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--accent-dark);
    float: left;
    line-height: 1;
    margin: 0.05em 0.1em 0 0;
    font-family: 'Caveat', cursive;
}

/* Subtle margin note indicators */
.note-body blockquote {
    border-left: 3px solid var(--accent-brown);
    margin-left: 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-style: italic;
    position: relative;
}

.note-body blockquote::before {
    content: '✎';
    position: absolute;
    left: -35px;
    top: 0;
    color: var(--accent-brown);
    opacity: 0.4;
    font-size: 1.2em;
    font-style: normal;
}

.note-body h1 {
    font-size: 1.8rem;
    margin: 30px 0 15px;
    color: var(--accent-dark);
    font-family: 'Caveat', cursive;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.note-body h2 {
    font-size: 1.5rem;
    margin: 25px 0 12px;
    color: var(--accent-dark);
    font-family: 'Caveat', cursive;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.note-body h3 {
    font-size: 1.2rem;
    margin: 20px 0 10px;
    color: var(--accent-brown);
    font-family: 'Patrick Hand', cursive;
    font-weight: 600;
}

.note-body pre {
    background: #0d1117;
    color: #f8f8f2;
    padding: 45px 20px 20px 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 20px 0;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    white-space: pre;
}

.note-body pre code {
    white-space: pre;
    background: transparent !important;
}

/* Language label for code blocks */
.code-language {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px 20px;
    background: rgba(22, 27, 34, 0.95);
    border-bottom: 1px solid rgba(48, 54, 61, 0.8);
    color: #7d8590;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 500;
    user-select: none;
}

/* Syntax highlighting - use theme defaults for better readability */
.note-body pre code.hljs {
    padding: 0;
    background: transparent !important;
}

/* Copy button for code blocks */
.code-block-wrapper {
    position: relative;
    margin: 20px 0;
}

/* Language badge for code blocks */
.code-block-wrapper::before {
    content: attr(data-language);
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    background: rgba(48, 54, 61, 0.95);
    color: #7d8590;
    font-size: 0.7rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    z-index: 10;
    border: 1px solid rgba(48, 54, 61, 0.5);
    opacity: 0.85;
}
    opacity: 0.8;
}

.code-block-wrapper:hover::before {
    opacity: 1;
}

.copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    color: #2b2b2b;
    font-size: 0.75rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
}

.code-block-wrapper:hover .copy-code-btn {
    opacity: 1;
}

.copy-code-btn:hover {
    background: white;
    border-color: var(--accent-brown);
    color: var(--accent-brown);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.copy-code-btn:active {
    transform: scale(0.95);
}

.copy-code-btn.copied {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.copy-code-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.note-body code {
    background: #2b2b2b;
    color: #f8f8f2;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.note-body pre code {
    background: none;
    padding: 0;
}

.note-body a {
    color: var(--accent-brown);
    text-decoration: underline;
}

.note-body a:hover {
    color: var(--accent-dark);
}

.note-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Sticky note tab-like tags */
.tag {
    background: linear-gradient(135deg, #ffd54f 0%, #ffca28 100%);
    color: #5d4037;
    padding: 6px 12px 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: lowercase;
    position: relative;
    display: inline-block;
    box-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.15),
        inset 0 -1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    font-family: 'Patrick Hand', cursive;
    letter-spacing: 0.3px;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
}

/* Sticky note tab fold effect */
.tag::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 8px 6px;
    border-color: transparent transparent #f9a825 transparent;
}

/* Paper texture on tag */
.tag::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.1) 2px,
        rgba(255, 255, 255, 0.1) 4px
    );
    pointer-events: none;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
}

.tag:hover {
    transform: translateY(-2px) rotate(-1deg);
    box-shadow: 
        3px 4px 8px rgba(0, 0, 0, 0.2),
        inset 0 -1px 2px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #ffeb3b 0%, #ffd54f 100%);
}

/* Alternate colors for variety */
.tag:nth-child(2n) {
    background: linear-gradient(135deg, #81c784 0%, #66bb6a 100%);
    color: #1b5e20;
}

.tag:nth-child(2n)::before {
    border-color: transparent transparent #4caf50 transparent;
}

.tag:nth-child(2n):hover {
    background: linear-gradient(135deg, #a5d6a7 0%, #81c784 100%);
}

.tag:nth-child(3n) {
    background: linear-gradient(135deg, #90caf9 0%, #64b5f6 100%);
    color: #0d47a1;
}

.tag:nth-child(3n)::before {
    border-color: transparent transparent #42a5f5 transparent;
}

.tag:nth-child(3n):hover {
    background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
}

.tag:nth-child(4n) {
    background: linear-gradient(135deg, #f48fb1 0%, #ec407a 100%);
    color: #880e4f;
}

.tag:nth-child(4n)::before {
    border-color: transparent transparent #e91e63 transparent;
}

.tag:nth-child(4n):hover {
    background: linear-gradient(135deg, #f8bbd0 0%, #f48fb1 100%);
}

@media (max-width: 640px) {
    body {
        padding: 10px 5px;
    }
    
    .notebook-container {
        border-radius: 0;
        box-shadow: none;
        margin: 0;
    }

    .content-area {
        padding: 20px 15px;
    }
    
    .sidebar {
        padding: 15px;
    }

    .main-title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .note-item {
        padding: 14px;
    }

    .note-title {
        font-size: 1.05rem;
    }

    .note-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .note-detail {
        padding: 15px;
    }
    
    .note-header .note-title {
        font-size: 1.4rem;
    }
    
    /* About section mobile optimization */
    .about-section {
        padding: 20px 15px;
        border-left-width: 2px;
    }
    
    .about-section::before,
    .about-section::after {
        display: none; /* Hide decorative elements on mobile */
    }
    
    /* Better touch targets for mobile */
    .category-item,
    .note-item,
    .tag-item {
        min-height: 48px;
    }
    
    .back-button {
        min-height: 44px;
        padding: 12px 20px;
    }
    
    /* Improved code blocks on mobile */
    .code-block {
        font-size: 0.85rem;
        padding: 12px;
        border-radius: 6px;
    }
    
    pre code {
        font-size: 0.85rem;
    }
    
    .copy-button {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    /* Better table handling on mobile */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.9rem;
    }
    
    /* Improved search and filter UI */
    .search-container {
        padding: 15px;
    }
    
    .search-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 15px;
    }
    
    .filter-section {
        padding: 12px;
    }
    
    .filter-group {
        margin-bottom: 15px;
    }
    
    /* Better sidebar on mobile */
    .sidebar {
        padding: 20px;
    }
    
    .category-list {
        gap: 8px;
    }
    
    /* Improved note metadata */
    .note-meta {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 0.85rem;
    }
    
    /* Better tag display */
    .tag-list {
        gap: 6px;
    }
    
    .tag-item {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

/* Extra small devices (phones in portrait, less than 400px) */
@media (max-width: 400px) {
    body {
        padding: 5px 2px;
    }
    
    .notebook-container {
        border-radius: 0;
    }
    
    .sidebar {
        padding: 12px;
    }
    
    .content-area {
        padding: 15px 10px;
    }
    
    .main-title {
        font-size: 1.4rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .note-detail {
        padding: 12px;
    }
    
    .note-item {
        padding: 10px;
    }
    
    .about-section {
        padding: 15px 10px;
    }
    
    /* Ensure no horizontal overflow */
    * {
        max-width: 100%;
    }
    
    pre {
        overflow-x: auto;
