/* ===== CSS Variables ===== */
:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --dark: #1a202c;
    --light: #f7fafc;
    --text: #2d3748;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--light);
}

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

img {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== Navbar ===== */
.navbar {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.logo i {
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: white;
    font-weight: 500;
    transition: opacity 0.3s;
    position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
    opacity: 0.8;
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: white;
}

.hamburger {
    display: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 100px 20px;
    text-align: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    animation: fadeInUp 0.6s ease-out;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.btn {
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-primary {
    background: white;
    color: var(--primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-outline:hover {
    background: white;
    color: var(--primary);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Categories Section ===== */
.categories-section {
    padding: 80px 20px;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--dark);
}

.section-title i {
    margin-right: 10px;
    color: var(--primary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.category-card i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.category-card p {
    color: #666;
    margin-bottom: 1rem;
}

.post-count {
    display: inline-block;
    background: var(--light);
    color: var(--primary);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ===== Posts Section ===== */
.posts-section {
    padding: 80px 20px;
}

.section-header {
    margin-bottom: 3rem;
}

.filters {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.search-input {
    flex: 1;
    max-width: 400px;
    padding: 12px 20px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.category-filter {
    padding: 12px 20px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.category-filter:focus {
    outline: none;
    border-color: var(--primary);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}

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

.post-card-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1.5rem;
    min-height: 150px;
}

.post-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.post-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.post-card-meta {
    font-size: 0.85rem;
    opacity: 0.9;
    display: flex;
    gap: 1rem;
}

.post-card-body {
    padding: 1.5rem;
}

.post-card-body p {
    color: #666;
    margin-bottom: 1rem;
}

.post-card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tag {
    background: var(--light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
}

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

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

/* ===== Post Detail Page ===== */
.post-detail {
    background: white;
    padding: 40px 20px;
}

.post-container {
    max-width: 900px;
}

.breadcrumb {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 2rem;
    color: #666;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary);
}

.post-header {
    margin-bottom: 3rem;
}

.post-category {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.post-header h1 {
    font-size: 2.8rem;
    color: var(--dark);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.post-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    color: #666;
    margin-bottom: 1rem;
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    color: var(--dark);
    margin: 2rem 0 1rem;
}

.post-content h2 {
    font-size: 2rem;
}

.post-content h3 {
    font-size: 1.5rem;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content ul,
.post-content ol {
    margin: 1.5rem 0 1.5rem 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content pre {
    background: #282c34;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
}

.post-content code {
    font-family: 'Courier New', monospace;
}

.post-content p code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    color: #e01e5a;
}

.post-share {
    margin: 4rem 0;
    padding: 2rem;
    background: var(--light);
    border-radius: 12px;
    text-align: center;
}

.post-share h3 {
    margin-bottom: 1.5rem;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    padding: 10px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    transition: transform 0.3s;
}

.share-btn:hover {
    transform: translateY(-2px);
}

.share-btn.twitter { background: #1DA1F2; }
.share-btn.linkedin { background: #0077B5; }
.share-btn.facebook { background: #1877F2; }
.share-btn.copy { background: #666; }

.related-posts {
    margin-top: 4rem;
}

.related-posts h2 {
    margin-bottom: 2rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
}

.related-card:hover {
    transform: translateY(-5px);
}

/* ===== About Section ===== */
.about-section {
    padding: 80px 20px;
    background: white;
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.about-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.about-content > p {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 3rem;
    color: #555;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature {
    text-align: center;
}

.feature i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.feature h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.feature p {
    color: #666;
}

/* ===== Footer ===== */
.footer {
    background: var(--dark);
    color: white;
    padding: 3rem 20px 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-section p {
    opacity: 0.8;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    transition: opacity 0.3s;
}

.social-links a:hover {
    opacity: 0.7;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul a {
    color: white;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-section ul a:hover {
    opacity: 1;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
}

.newsletter-form input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
}

.newsletter-form button {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-menu {
        display: none;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .post-header h1 {
        font-size: 2rem;
    }

    .posts-grid,
    .categories-grid {
        grid-template-columns: 1fr;
    }
}
