/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.logo p {
    font-size: 0.9rem;
    opacity: 0.8;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 1.5rem;
    position: relative;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #3498db;
}

.nav-link.active {
    color: #3498db;
    font-weight: bold;
}

/* Dropdown Menu */
.dropdown-content {
    display: none;
    position: absolute;
    background: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1;
    border-radius: 4px;
    top: 100%;
    left: 0;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

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

/* Featured Post */
.featured-post {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.featured-image {
    width: 100%;
    height: auto;
}

.featured-content {
    padding: 1.5rem;
}

.featured-content h2 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.featured-content p {
    color: #666;
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #777;
}

.post-meta i {
    margin-right: 0.3rem;
}

/* Comments Section */
.comments {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.comments h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.comment {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.comment:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 1rem;
}

.user-info {
    flex-grow: 1;
}

.username {
    font-weight: bold;
    display: block;
}

.timestamp {
    font-size: 0.8rem;
    color: #777;
}

.vote-buttons {
    display: flex;
    gap: 0.5rem;
}

.upvote, .downvote {
    background: none;
    border: none;
    cursor: pointer;
    color: #777;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.upvote:hover {
    color: #2ecc71;
}

.downvote:hover {
    color: #e74c3c;
}

.comment-body {
    margin-left: 3rem;
    margin-bottom: 0.5rem;
}

.comment-actions {
    margin-left: 3rem;
    display: flex;
    gap: 1rem;
}

.reply-btn, .share-btn {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.reply-btn:hover, .share-btn:hover {
    text-decoration: underline;
}

.replies {
    margin-left: 3rem;
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #eee;
}

/* Add Comment Form */
.add-comment {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.add-comment h3 {
    margin-bottom: 1rem;
}

.add-comment textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 100px;
    margin-bottom: 1rem;
    resize: vertical;
}

.add-comment button {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-comment button:hover {
    background: #2980b9;
}

/* Hidden Sections */
.hidden-section {
    display: none;
    background: white;
    padding: 2rem 0;
    margin: 2rem 0;
    border-radius: 8px;
}

/* Trending Grid */
.trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.trending-item {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
}

.trending-item:hover {
    transform: translateY(-5px);
}

.trending-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.trending-item h3 {
    padding: 0.8rem;
    font-size: 1.1rem;
}

.trending-item p {
    padding: 0 0.8rem 0.8rem;
    color: #777;
    font-size: 0.9rem;
}

/* Login Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
}

.close-modal:hover {
    color: #333;
}

#login-form input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#login-form button {
    width: 100%;
    padding: 0.8rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#login-form button:hover {
    background: #2980b9;
}

#login-form a {
    color: #3498db;
    text-decoration: none;
    display: inline-block;
    margin-top: 1rem;
}

#login-form a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
}

.social-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-links a {
    color: white;
    font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    nav ul {
        margin-top: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }

    nav ul li {
        margin: 0.5rem;
    }

    .dropdown-content {
        left: 50%;
        transform: translateX(-50%);
    }

    .comment-header {
        flex-wrap: wrap;
    }

    .vote-buttons {
        margin-top: 0.5rem;
        width: 100%;
        justify-content: flex-end;
    }

    .comment-body, .comment-actions, .replies {
        margin-left: 0;
    }
}