:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-hover: #0ea5e9;
    --border-color: #334155;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-color);
}

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

/* Header */
header {
    padding: 40px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--accent-color), #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

nav a {
    margin-left: 20px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

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

/* Hero / Intro */
.hero {
    text-align: center;
    margin-bottom: 80px;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Blog Grid */
.post-grid {
    display: grid;
    gap: 40px;
}

.post-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--accent-color);
}

.post-meta {
    font-size: 0.875rem;
    color: var(--accent-color);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.post-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.post-excerpt {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.read-more {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: var(--accent-color);
}

.read-more svg {
    margin-left: 6px;
    transition: transform 0.2s ease;
}

.post-card:hover .read-more svg {
    transform: translateX(4px);
}

/* Article Page */
.article-header {
    text-align: center;
    margin-bottom: 60px;
}

.article-header h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.article-content {
    font-size: 1.125rem;
    color: #cbd5e1;
}

.article-content h2 {
    font-size: 1.8rem;
    margin-top: 48px;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.article-content p {
    margin-bottom: 24px;
}

.article-content code {
    background-color: #334155;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

.article-content pre {
    background-color: #020617;
    padding: 24px;
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 32px;
    border: 1px solid var(--border-color);
}

.article-content pre code {
    background-color: transparent;
    padding: 0;
    color: #e2e8f0;
}

/* Comments Section */
.comments-section {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.comments-header {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 32px;
}

.comment-form {
    background-color: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.btn {
    background-color: var(--accent-color);
    color: #0f172a;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.comment-item {
    background-color: rgba(30, 41, 59, 0.4);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--accent-color);
}

.comment-author {
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.comment-date {
    font-weight: 400;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.comment-body {
    color: #cbd5e1;
}

/* Footer */
footer {
    margin-top: 100px;
    padding: 40px 0;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

/* EasyMDE Dark Mode Overrides */
.EasyMDEContainer {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

.editor-toolbar {
    background-color: #1e293b !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

.editor-toolbar i {
    color: var(--text-primary) !important;
}

.editor-toolbar i:hover {
    color: var(--accent-color) !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.editor-toolbar button.active,
.editor-toolbar button:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: transparent !important;
}

.CodeMirror {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: var(--border-color) !important;
    font-family: 'Menlo', 'Monaco', monospace !important;
    font-size: 1rem;
}

.CodeMirror-cursor {
    border-left: 1px solid var(--accent-color) !important;
}

.editor-statusbar {
    background-color: #1e293b !important;
    color: var(--text-secondary) !important;
    border-top: 1px solid var(--border-color) !important;
}

.editor-preview {
    background-color: var(--bg-color) !important;
    color: var(--text-primary) !important;
}

.editor-preview h1,
.editor-preview h2,
.editor-preview h3 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3em;
}

.editor-preview pre {
    background: #1e293b;
    padding: 1em;
}