
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 1.5rem;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
}

nav a.active {
    background-color: #3498db;
}

nav a:hover {
    background-color: #34495e;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Main content layout */
main.container {
    display: flex;
    margin: 2rem auto;
    gap: 2rem;
}

.posts {
    flex: 3;
}

.sidebar {
    flex: 1;
}

/* Blog posts */
.post {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.post-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.post-category {
    background-color: #3498db;
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-weight: bold;
}

.post-date {
    color: #777;
}

.post h2 {
    font-family: 'Poppins', sans-serif;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.post-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    margin: 1.5rem 0;
}

.post-content ul {
    margin-left: 1.5rem;
    margin-top: 1rem;
}

.code-box {
    background-color: #2c3e50;
    color: white;
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
    font-family: monospace;
    overflow-x: auto;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.tags {
    display: flex;
    gap: 0.5rem;
}

.tag {
    background-color: #ecf0f1;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
    color: #666;
}

.like-btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;    
    display: flex;
    align-items: center;
    gap: 5px;
}

.like-btn.liked {
    background-color: #e74c3c;
}

/* Sidebar */
.sidebar-box {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sidebar-box h3 {
    font-family: 'Poppins', sans-serif;
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
}

.author-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 1rem auto;
    display: block;
    border: 3px solid #3498db;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
}

.category-list a {
    color: #333;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
}

.category-list a:hover {
    color: #3498db;
}

.category-list span {
    background-color: #ecf0f1;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

#newsletter-form {
    margin-top: 1rem;
}

#newsletter-form input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#newsletter-form button {
    width: 100%;
    padding: 10px;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#newsletter-form button:hover {
    background-color: #27ae60;
}

.comment {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.comment span {
    display: block;
    text-align: right;
    color: #777;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 2rem 0;
    text-align: center;
}

footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: white;
    text-decoration: none;
}

.social-links a:hover {
    color: #3498db;
}

/* Responsive design */
@media (max-width: 768px) {
    main.container {
        flex-direction: column;
    }
    
    nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #2c3e50;
        flex-direction: column;
        padding: 1rem;
    }
    
    nav ul.show {
        display: flex;
    }
    
    nav ul li {
        margin: 0;
        margin-bottom: 0.5rem;
    }
    
    .menu-btn {
        display: block;
    }
    
    .post-image {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .post-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .logo {
        font-size: 1.5rem;
    }
}