/* Modern, responsive design with dark mode support */
:root {
    /* Light mode variables */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-tertiary: #64748b;
    --border: #e2e8f0;
    --accent: #4f46e5;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --code-bg: #f1f5f9;
    --sidebar-width: 260px;
    --header-height: 60px;
}

.dark-mode {
    /* Dark mode variables */
    --bg-primary: #1a1a1a;
    --bg-secondary: #121212;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-tertiary: #888888;
    --border: #333333;
    --accent: #60a5fa;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --code-bg: #252525;
}

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

body {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: var(--header-height);
}

/* Header Styles */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
}

.site-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.site-nav {
    display: flex;
    gap: 1.25rem;
}

.nav-item {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    color: var(--accent);
    background: rgba(79, 70, 229, 0.08);
}

.dark-mode .nav-item:hover, .dark-mode .nav-item.active {
    background: rgba(96, 165, 250, 0.12);
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    transition: all 0.2s;
    cursor: pointer;
}

.theme-toggle:hover {
    background: rgba(79, 70, 229, 0.08);
    color: var(--accent);
}

.dark-mode .theme-toggle:hover {
    background: rgba(96, 165, 250, 0.12);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 999;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-item {
    display: block;
    padding: 0.625rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-item:hover {
    background: rgba(79, 70, 229, 0.08);
    color: var(--accent);
}

.dark-mode .sidebar-item:hover {
    background: rgba(96, 165, 250, 0.12);
}

.sidebar-item i {
    width: 20px;
    text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-link {
    color: var(--text-tertiary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--accent);
}

.footer-copyright {
    color: var(--text-tertiary);
    text-align: center;
    padding-top: 0.75rem;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    flex: 1;
}

.content-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.content-title {
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.lead {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Blog Posts */
.blog-post {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow);
}

.post-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.post-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-decoration: none;
}

.post-title:hover {
    color: var(--accent);
}

.post-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.read-more {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--accent);
    transition: all 0.2s;
}

.read-more:hover {
    color: var(--accent);
    border-color: transparent;
}

/* Single Post */
.post-content {
    line-height: 1.8;
    margin-bottom: 2rem;
}

.post-content h2, .post-content h3 {
    margin: 1.5rem 0 1rem;
    color: var(--text-primary);
}

.post-content p {
    margin-bottom: 1.25rem;
}

.code-block {
    background: var(--code-bg);
    padding: 1.25rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Admin Panel */
.admin-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #4338ca;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Login Form */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.login-container h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 991px) {
    :root {
        --sidebar-width: 100%;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border);
        margin-bottom: 2rem;
        top: auto;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .site-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1.5rem;
    }
    
    .blog-post {
        padding: 1.5rem;
    }
    
    .content-title {
        font-size: 2rem;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: all 0.3s;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
}