:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-color: #333;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
}

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

/* Header */
.header {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

.logo h1 {
    color: white;
    font-size: 24px;
}

.nav a {
    color: white;
    text-decoration: none;
    margin-left: 30px;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav a:hover {
    opacity: 0.8;
}

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

/* Hero Section */
.hero {
    text-align: center;
    color: white;
    padding: 80px 20px;
}

.hero h2 {
    font-size: 48px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 18px;
    opacity: 0.9;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.post-card {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.post-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-content {
    padding: 20px;
}

.post-title {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.post-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
}

.post-excerpt {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.6;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.read-more:hover {
    gap: 10px;
}

/* Single Post Page */
.post-detail {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.post-detail .post-title {
    font-size: 36px;
    margin-bottom: 20px;
}

.post-detail .post-meta {
    font-size: 16px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.post-detail .post-content {
    font-size: 18px;
    line-height: 1.8;
    color: #444;
}

.post-detail .post-content p {
    margin-bottom: 20px;
}

.post-detail .post-content h1,
.post-detail .post-content h2,
.post-detail .post-content h3 {
    margin: 30px 0 15px;
    color: #333;
}

.post-detail .post-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.post-detail .post-content pre {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

/* Comments Section */
.comments-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.comments-section h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.comment {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.comment-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.comment-author {
    font-weight: 600;
    color: var(--primary-color);
}

.comment-content {
    color: #444;
    line-height: 1.6;
}

.comment-form {
    margin-top: 30px;
}

.comment-form textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
    resize: vertical;
}

.comment-form button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.comment-form button:hover {
    background: #5a67d8;
}

/* User info in nav */
.user-info {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 30px;
    color: white;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

/* Footer */
.footer {
    background: rgba(0,0,0,0.3);
    color: white;
    text-align: center;
    padding: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav a {
        margin: 0 15px;
    }
    
    .user-info {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h2 {
        font-size: 32px;
    }
}