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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #666;
    transition: color 0.3s;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    color: #3498db;
}

.admin-link {
    background: #f0f0f0;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.posts-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.post-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.post-content {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.post-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    color: #999;
    font-size: 0.9rem;
}

.post-actions {
    display: flex;
    gap: 1rem;
}

.like-btn, .comment-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.like-btn:hover {
    color: #e74c3c;
}

.like-btn.liked {
    color: #e74c3c;
}

.comment-btn:hover {
    color: #3498db;
}

/* Admin Styles */
.admin-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.login-form {
    display: flex;
    gap: 1rem;
}

.login-form input {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

button {
    padding: 0.5rem 1.5rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #2980b9;
}

.new-post-btn {
    background: #27ae60;
}

.new-post-btn:hover {
    background: #229954;
}

.post-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.submit-btn {
    background: #27ae60;
}

.admin-posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-post-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-post-item h3 {
    color: #2c3e50;
}

.delete-btn {
    background: #e74c3c;
}

.delete-btn:hover {
    background: #c0392b;
}

/* Post Detail Styles */
.post-detail {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.post-detail-content {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.post-detail-image {
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    background: #f9f9f9;
}

.post-detail-info {
    padding: 2rem;
}

.comments-section {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.comments-list {
    margin: 1.5rem 0;
}

.comment {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.comment-author {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.comment-date {
    color: #999;
    font-size: 0.85rem;
}

.comment-form {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.2rem;
}

.error {
    text-align: center;
    padding: 2rem;
    color: #e74c3c;
    background: #fee;
    border-radius: 8px;
    margin: 1rem;
}

footer {
    text-align: center;
    padding: 2rem;
    background: #2c3e50;
    color: white;
    margin-top: 4rem;
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .admin-header {
        flex-direction: column;
    }
}
