/**
 * Notes Page Styles - Neobrutalism Design
 * Used by all course notes pages (MATH1081, MATH1131, etc.)
 * Version: 1.0.0
 */

/* Base styles */
.notes-page {
    font-family: 'Inter', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
    background-color: #f8f7f2;
    color: #2c2c2c;
    line-height: 1.6;
}

/* Container */
.notes-container {
    background-color: #ffffff;
    border: 2px solid #2c2c2c;
    padding: 2rem;
    box-shadow: 6px 6px 0 #2c2c2c;
    margin-bottom: 2rem;
    max-width: 5xl;
    margin-left: auto;
    margin-right: auto;
}

/* Header */
.notes-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 4px solid #1a7f7f;
}

.notes-title {
    color: #1a7f7f;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.notes-subtitle {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

/* Navigation */
.notes-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.back-button {
    background-color: #1a7f7f;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border: 2px solid #2c2c2c;
    box-shadow: 4px 4px 0 #2c2c2c;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    font-size: 0.875rem;
}

.back-button:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #2c2c2c;
    color: #ffffff;
}

/* Section Card */
.section-card {
    background-color: #f8f7f2;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 2px solid #1a7f7f;
    box-shadow: 4px 4px 0 #1a7f7f;
}

.section-title {
    color: #1a7f7f;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #1a7f7f;
}

/* Formula Box - Blue */
.formula-box {
    background-color: #e0f2fe;
    border: 2px solid #0ea5e9;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 4px 4px 0 #0ea5e9;
    font-family: 'Courier New', monospace;
}

/* Example Box - Green */
.example-box {
    background-color: #f0fdf4;
    border: 2px solid #22c55e;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 4px 4px 0 #22c55e;
}

/* Tip Box - Yellow/Orange */
.tip-box {
    background-color: #fef3c7;
    border: 2px solid #f59e0b;
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: 4px 4px 0 #f59e0b;
}

/* Warning Box - Red */
.warning-box {
    background-color: #fef2f2;
    border: 2px solid #ef4444;
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: 4px 4px 0 #ef4444;
}

/* Info Box - Purple */
.info-box {
    background-color: #faf5ff;
    border: 2px solid #8b5cf6;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 4px 4px 0 #8b5cf6;
}

/* Quiz Link */
.quiz-link {
    background-color: #8b5cf6;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border: 2px solid #2c2c2c;
    box-shadow: 4px 4px 0 #2c2c2c;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.1s;
    display: inline-block;
    margin: 1rem 0;
    text-transform: uppercase;
    font-size: 0.875rem;
}

.quiz-link:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #2c2c2c;
    color: #ffffff;
}

/* Topic Navigation */
.topic-nav {
    background-color: #f8f7f2;
    border: 2px solid #2c2c2c;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 4px 4px 0 #2c2c2c;
}

.topic-nav-title {
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1a7f7f;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.topic-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.topic-nav-link {
    background-color: #ffffff;
    border: 2px solid #2c2c2c;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #2c2c2c;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.1s;
    display: block;
}

.topic-nav-link:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #2c2c2c;
}

/* Notion Sync Badge */
.notion-sync {
    background-color: #e0f2fe;
    border: 2px solid #0284c7;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: #0369a1;
    box-shadow: 3px 3px 0 #0284c7;
    display: inline-block;
}

/* Version Badge */
.version-badge {
    background-color: #dc2626;
    color: #ffffff;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-left: 0.5rem;
    text-transform: uppercase;
}

/* Bilingual content */
.en-content, .zh-content {
    transition: opacity 0.2s ease-in-out;
}
.lang-zh .en-content { display: none; }
.lang-zh .zh-content { display: inline; }
body:not(.lang-zh) .en-content { display: inline; }
body:not(.lang-zh) .zh-content { display: none; }

.en-block, .zh-block {
    transition: opacity 0.2s ease-in-out;
}
.lang-zh .en-block { display: none; }
.lang-zh .zh-block { display: block; }
body:not(.lang-zh) .en-block { display: block; }
body:not(.lang-zh) .zh-block { display: none; }

/* Code and Math */
code {
    background-color: #e5e5e5;
    padding: 0.125rem 0.375rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875em;
    border: 1px solid #bfbfbf;
}

pre {
    background-color: #2c2c2c;
    color: #f8f7f2;
    padding: 1rem;
    overflow-x: auto;
    border: 2px solid #2c2c2c;
    box-shadow: 4px 4px 0 #2c2c2c;
}

pre code {
    background-color: transparent;
    border: none;
    padding: 0;
    color: inherit;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    border: 2px solid #2c2c2c;
    box-shadow: 4px 4px 0 #2c2c2c;
}

th {
    background-color: #1a7f7f;
    color: #ffffff;
    font-weight: 700;
    padding: 0.75rem;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

td {
    padding: 0.75rem;
    border-top: 1px solid #e5e5e5;
}

tr:nth-child(even) {
    background-color: #f8f7f2;
}

/* Dark Mode */
[data-theme='dark'] .notes-page,
html.dark .notes-page {
    background-color: #1A1A1A;
    color: #FFFFFF;
}

[data-theme='dark'] .notes-container,
html.dark .notes-container {
    background-color: #2A2A2A;
    border-color: #FFFFFF;
    box-shadow: 6px 6px 0 #FFFFFF;
}

[data-theme='dark'] .section-card,
html.dark .section-card {
    background-color: #1A1A1A;
    border-color: #4fd1c5;
    box-shadow: 4px 4px 0 #4fd1c5;
}

[data-theme='dark'] .section-title,
html.dark .section-title {
    color: #4fd1c5;
    border-color: #4fd1c5;
}

[data-theme='dark'] .notes-title,
html.dark .notes-title {
    color: #4fd1c5;
}

[data-theme='dark'] .notes-header,
html.dark .notes-header {
    border-color: #4fd1c5;
}

[data-theme='dark'] .formula-box,
html.dark .formula-box {
    background-color: #1e3a5f;
    border-color: #38bdf8;
    box-shadow: 4px 4px 0 #38bdf8;
}

[data-theme='dark'] .example-box,
html.dark .example-box {
    background-color: #1a3a2a;
    border-color: #4ade80;
    box-shadow: 4px 4px 0 #4ade80;
}

[data-theme='dark'] .tip-box,
html.dark .tip-box {
    background-color: #3a3a1a;
    border-color: #fbbf24;
    box-shadow: 4px 4px 0 #fbbf24;
}

[data-theme='dark'] .warning-box,
html.dark .warning-box {
    background-color: #3a1a1a;
    border-color: #f87171;
    box-shadow: 4px 4px 0 #f87171;
}

[data-theme='dark'] .info-box,
html.dark .info-box {
    background-color: #2a1a3a;
    border-color: #c084fc;
    box-shadow: 4px 4px 0 #c084fc;
}

[data-theme='dark'] .back-button,
html.dark .back-button {
    background-color: #1a7f7f;
    border-color: #FFFFFF;
    box-shadow: 4px 4px 0 #FFFFFF;
}

[data-theme='dark'] .back-button:hover,
html.dark .back-button:hover {
    box-shadow: 2px 2px 0 #FFFFFF;
}

[data-theme='dark'] .quiz-link,
html.dark .quiz-link {
    border-color: #FFFFFF;
    box-shadow: 4px 4px 0 #FFFFFF;
}

[data-theme='dark'] .quiz-link:hover,
html.dark .quiz-link:hover {
    box-shadow: 2px 2px 0 #FFFFFF;
}

[data-theme='dark'] .topic-nav,
html.dark .topic-nav {
    background-color: #2A2A2A;
    border-color: #FFFFFF;
    box-shadow: 4px 4px 0 #FFFFFF;
}

[data-theme='dark'] .topic-nav-link,
html.dark .topic-nav-link {
    background-color: #333;
    border-color: #FFFFFF;
    color: #FFFFFF;
}

[data-theme='dark'] .topic-nav-title,
html.dark .topic-nav-title {
    color: #4fd1c5;
}

[data-theme='dark'] .notion-sync,
html.dark .notion-sync {
    background-color: #1e3a5f;
    border-color: #38bdf8;
    box-shadow: 3px 3px 0 #38bdf8;
    color: #93c5fd;
}

[data-theme='dark'] h1, [data-theme='dark'] h2, [data-theme='dark'] h3, [data-theme='dark'] h4,
html.dark h1, html.dark h2, html.dark h3, html.dark h4 {
    color: #FFFFFF !important;
}

[data-theme='dark'] p, [data-theme='dark'] li,
html.dark p, html.dark li {
    color: #CCCCCC !important;
}

[data-theme='dark'] a,
html.dark a {
    color: #ff9980 !important;
}

[data-theme='dark'] a:hover,
html.dark a:hover {
    color: #ffb3a0 !important;
}

[data-theme='dark'] strong,
html.dark strong {
    color: #FFFFFF !important;
}

[data-theme='dark'] code,
html.dark code {
    background-color: #444;
    border-color: #666;
    color: #e5e5e5;
}

[data-theme='dark'] table,
html.dark table {
    border-color: #FFFFFF;
    box-shadow: 4px 4px 0 #FFFFFF;
}

[data-theme='dark'] th,
html.dark th {
    background-color: #1a7f7f;
}

[data-theme='dark'] td,
html.dark td {
    border-color: #555;
}

[data-theme='dark'] tr:nth-child(even),
html.dark tr:nth-child(even) {
    background-color: #333;
}

[data-theme='dark'] tr:nth-child(odd),
html.dark tr:nth-child(odd) {
    background-color: #2A2A2A;
}
