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

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --code-bg: #f3f4f6;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.site-header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.site-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 3rem 0;
}

/* Home Page */
.home-header {
    text-align: center;
    margin-bottom: 4rem;
}

.home-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
}

/* Category Section */
.category-section {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

/* Notes Grid */
.notes-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.notes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Note Card */
.note-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}

.note-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.note-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.note-card h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.note-card h3 a:hover {
    color: var(--primary-color);
}

/* Note Meta */
.note-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.note-date::before {
    content: "📅 ";
}

.note-reading-time::before {
    content: "⏱️ ";
}

.note-category::before {
    content: "📁 ";
}

/* Tags */
.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.tag {
    background-color: var(--bg-secondary);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
}

/* Note Article */
.note-article {
    max-width: 800px;
    margin: 0 auto;
}

.note-header {
    margin-bottom: 3rem;
}

.back-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    margin-bottom: 1rem;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.note-article h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

/* Note Content */
.note-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.note-content h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.note-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.note-content p {
    margin-bottom: 1.5rem;
}

.note-content ul,
.note-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.note-content li {
    margin-bottom: 0.5rem;
}

.note-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.note-content a:hover {
    color: var(--secondary-color);
}

.note-content code {
    background-color: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}

.note-content pre {
    background-color: var(--code-bg);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.note-content pre code {
    background-color: transparent;
    padding: 0;
    font-size: 0.875rem;
}

.note-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-style: italic;
}

.note-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.note-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.note-content table th,
.note-content table td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: left;
}

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

/* Related Notes */
.related-notes {
    max-width: 800px;
    margin: 4rem auto 0;
    padding-top: 3rem;
    border-top: 2px solid var(--border-color);
}

.related-notes h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Error Page */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-page h1 {
    font-size: 6rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.error-page h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-page p {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.btn-primary {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-light);
}

/* Footer */
.site-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

.site-footer p {
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .home-header h1 {
        font-size: 2rem;
    }

    .note-article h1 {
        font-size: 2rem;
    }

    .notes-list {
        grid-template-columns: 1fr;
    }

    .nav-links {
        gap: 1rem;
    }
}
