/* Color scheme variables */
:root {
    /* Dark mode colors (default) */
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --heading-color: #ffffff;
    --link-color: #66b3ff;
    --link-hover-color: #99ccff;
    --border-color: #333333;
    --card-bg: #252525;
    --code-bg: #2d2d2d;
}

/* Light mode colors */
[data-theme="light"] {
    --bg-color: #ffffff;
    --text-color: #333333;
    --heading-color: #1a1a1a;
    --link-color: #0066cc;
    --link-hover-color: #0052a3;
    --border-color: #e0e0e0;
    --card-bg: #f5f5f5;
    --code-bg: #f0f0f0;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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);
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.3;
}

h1 {
    font-size: 2.5em;
    margin-top: 0;
}

h2 {
    font-size: 2em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.3em;
}

h3 {
    font-size: 1.5em;
}

p {
    margin-bottom: 1em;
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* Header */
header {
    text-align: center;
    padding: 40px 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 40px;
    position: relative;
}

/* Theme toggle button */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--link-color);
}

.theme-toggle:active {
    transform: scale(0.95);
}

header h1 a {
    color: var(--heading-color);
    text-decoration: none;
}

header h1 a:hover {
    color: var(--link-hover-color);
}

.subtitle {
    color: var(--text-color);
    font-size: 1.1em;
    margin-top: 10px;
}

/* Main content */
main {
    min-height: 400px;
}

/* Blog sections */
.section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.8em;
    color: var(--link-color);
    margin-bottom: 15px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title:hover {
    color: var(--link-hover-color);
}

.collapse-icon {
    font-size: 0.7em;
    transition: transform 0.3s ease;
}

.post-list {
    list-style: none;
}

.post-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.post-item:last-child {
    border-bottom: none;
}

.post-item:hover {
    background-color: var(--card-bg);
    padding-left: 10px;
}

.post-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    gap: 15px;
}

.post-link:hover {
    text-decoration: none;
}

.post-title {
    color: var(--link-color);
    font-size: 1.1em;
    flex-grow: 1;
}

.post-link:hover .post-title {
    color: var(--link-hover-color);
    text-decoration: underline;
}

.post-date {
    color: #888;
    font-size: 0.9em;
    white-space: nowrap;
    font-style: italic;
}

/* Post content */
article {
    line-height: 1.8;
}

article img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
}

article pre {
    background-color: var(--code-bg);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
}

article code {
    background-color: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
}

article pre code {
    padding: 0;
    background-color: transparent;
}

article blockquote {
    border-left: 4px solid var(--link-color);
    padding-left: 20px;
    margin: 20px 0;
    color: #aaa;
    font-style: italic;
}

article ul, article ol {
    margin-left: 30px;
    margin-bottom: 1em;
}

article li {
    margin-bottom: 0.5em;
}

/* Breadcrumb navigation */
.breadcrumb {
    margin-bottom: 30px;
    color: #888;
}

.breadcrumb a {
    color: var(--link-color);
}

.breadcrumb span:before {
    content: " / ";
    margin: 0 8px;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0 20px;
    border-top: 2px solid var(--border-color);
    margin-top: 60px;
    color: #888;
}

/* Buy Me a Coffee Button */
.support-section {
    margin-top: 30px;
}

.bmc-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #FFDD00 0%, #FBB034 100%);
    color: #000000;
    font-weight: 600;
    font-size: 1em;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 221, 0, 0.3);
}

.bmc-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 221, 0, 0.5);
    text-decoration: none;
    color: #000000;
}

.bmc-icon {
    font-size: 1.3em;
    line-height: 1;
}

/* Loading state */
.loading {
    text-align: center;
    color: #888;
    padding: 40px;
}

/* Error state */
.error {
    background-color: #3d1f1f;
    color: #ff6b6b;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #ff6b6b;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.empty-state h2 {
    border: none;
    margin-bottom: 20px;
}

/* Responsive design */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    header {
        padding: 20px 0;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.5em;
    }

    .post-item {
        padding: 15px;
    }
}
