* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #10b981;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --text-color: #374151;
    --border-color: #e5e7eb;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #ffffff;
    color: var(--dark-color);
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: var(--primary-color);
}

.logo p {
    font-size: 0.9rem;
    color: #6b7280;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav a:hover,
.nav a.active {
    color: var(--primary-color);
}

.nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: var(--dark-color);
    border-radius: 3px;
    transition: all 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    color: var(--dark-color);
    padding: 4rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #6b7280;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    background: white;
}

.search-box input:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    border: 1px solid var(--primary-color);
}

.search-btn {
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Categories */
.categories {
    padding: 2rem 0;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.category-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.category-btn {
    padding: 0.7rem 1.5rem;
    background: var(--light-color);
    border: 2px solid transparent;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-color);
}

.category-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Main Content */
.main-content {
    padding: 3rem 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

/* Post Card */
.post-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.post-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10;
}

.post-badge.hot {
    background: linear-gradient(135deg, #ef4444, #f97316);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.post-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: var(--light-color);
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-card:hover .post-image img {
    transform: scale(1.1);
}

.post-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-category {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    width: fit-content;
}

.post-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: var(--dark-color);
    line-height: 1.4;
}

.post-content p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    flex: 1;
    line-height: 1.6;
}

.post-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #888;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    width: fit-content;
}

.read-more:hover {
    transform: translateX(5px);
    color: #ee5a6f;
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #444;
    color: #bbb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        box-shadow: var(--shadow);
        border-top: 1px solid var(--border-color);
    }

    .nav.active {
        display: block;
    }

    .nav ul {
        flex-direction: column;
        padding: 1rem;
        gap: 0;
    }

    .nav ul li {
        border-bottom: 1px solid var(--border-color);
    }

    .nav ul li:last-child {
        border-bottom: none;
    }

    .nav a {
        display: block;
        padding: 1rem;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .search-box {
        flex-direction: column;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .category-filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .category-btn {
        white-space: nowrap;
    }

    .header-content {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .posts-grid {
        gap: 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* Animation for filtered posts */
.post-card.hidden {
    display: none;
}

.post-card.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

