﻿:root {
    --primary: #4361ee;
    --secondary: #3a0ca3;
    --accent: #f72585;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --border: #dee2e6;
    --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
    --card-bg: #fff;
    --body-bg: #fff;
    --text-color: var(--dark);
    --header-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: var(--dark);
    --footer-text: #fff;
}

/* Dark Mode Variables */
.dark-mode {
    --card-bg: #1e1e2e;
    --body-bg: #121212;
    --text-color: #e0e0e0;
    --light: #2d2d3d;
    --dark: #e0e0e0;
    --gray: #a0a0a0;
    --light-gray: #3a3a4a;
    --border: #3a3a4a;
    --header-bg: rgba(30, 30, 46, 0.95);
    --footer-bg: #0a0a14;
    --footer-text: #e0e0e0;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--body-bg);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--gradient);
    color: white;
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

    .btn-outline:hover {
        background: var(--primary);
        color: white;
    }

.section {
    padding: 80px 0;
}

.section-title {
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
    text-align: center;
}

    .section-title h2 {
        font-size: 2.2rem;
        color: var(--dark);
        display: inline-block;
        font-weight: 700;
    }

        .section-title h2::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 80px;
            height: 4px;
            background: var(--gradient);
            border-radius: 2px;
        }

/* Header & Navigation */
header {
    background: var(--header-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
}

    .logo i {
        margin-right: 10px;
        color: var(--accent);
    }

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-weight: 600;
    color: var(--dark);
    position: relative;
    padding: 5px 0;
    transition: var(--transition);
}

    .nav-link:hover {
        color: var(--primary);
    }

    .nav-link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 2px;
        background: var(--gradient);
        transition: var(--transition);
    }

    .nav-link:hover::after {
        width: 100%;
    }

.nav-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    padding: 10px 15px;
    padding-right: 40px;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: var(--light);
    color: var(--text-color);
    width: 0;
    opacity: 0;
    transition: all 0.3s ease;
}

    .search-input.active {
        width: 250px;
        opacity: 1;
    }

.search-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    position: absolute;
    right: 0;
}

    .search-btn:hover {
        color: var(--primary);
    }

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
}

    .theme-toggle:hover {
        color: var(--primary);
    }

.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark);
}

/* Hero Section */
.hero {
    padding: 100px 0;
    background: var(--gradient);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

    .hero::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80') center/cover no-repeat;
        opacity: 0.1;
    }

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin: 40px 0;
}

/* Latest Posts Section */
.latest-posts {
    margin-bottom: 50px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.post-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border);
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .post-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    }

.post-img {
    height: 200px;
    overflow: hidden;
    position: relative;
}

    .post-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: var(--transition);
    }

.post-card:hover .post-img img {
    transform: scale(1.1);
}

.post-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-category {
    display: inline-block;
    background: var(--gradient);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 15px;
    align-self: flex-start;
}

.post-title {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--dark);
    line-height: 1.4;
    font-weight: 600;
}

.post-excerpt {
    color: var(--gray);
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--gray);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary);
    font-size: 0.8rem;
}

/* Featured Articles */
.featured-posts {
    background: var(--light);
    padding: 80px 0;
    margin: 40px 0;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.featured-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

    .featured-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    }

.featured-img {
    height: 220px;
    overflow: hidden;
    position: relative;
}

    .featured-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: var(--transition);
    }

.featured-card:hover .featured-img img {
    transform: scale(1.1);
}

.featured-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.featured-title {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: var(--dark);
    line-height: 1.4;
    font-weight: 600;
}

.featured-excerpt {
    color: var(--gray);
    margin-bottom: 20px;
    flex-grow: 1;
    line-height: 1.6;
}

.read-more {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
    align-self: flex-start;
}

    .read-more:hover {
        gap: 10px;
    }

/* Sidebar */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-widget {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.widget-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-gray);
    color: var(--dark);
    font-weight: 600;
}

/* Categories Widget */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--light-gray);
    transition: var(--transition);
}

    .category-item:last-child {
        border-bottom: none;
    }

    .category-item:hover {
        padding-left: 10px;
    }

.category-name {
    font-weight: 500;
    color: var(--dark);
}

.category-count {
    background: var(--light-gray);
    color: var(--gray);
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Newsletter Widget */
.newsletter-widget p {
    color: var(--gray);
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-input {
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--body-bg);
    color: var(--text-color);
}

.newsletter-btn {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

    .newsletter-btn:hover {
        box-shadow: var(--shadow-lg);
    }

/* Popular Posts Widget */
.popular-posts {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popular-post {
    display: flex;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-gray);
    transition: var(--transition);
}

    .popular-post:hover {
        transform: translateX(5px);
    }

    .popular-post:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

.popular-img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

    .popular-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: var(--transition);
    }

.popular-post:hover .popular-img img {
    transform: scale(1.1);
}

.popular-content {
    flex-grow: 1;
}

.popular-title {
    font-size: 0.95rem;
    margin-bottom: 5px;
    line-height: 1.4;
    font-weight: 500;
}

.popular-meta {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Footer */
footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 80px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-col h3 {
    font-size: 1.3rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
    font-weight: 600;
}

    .footer-col h3::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 40px;
        height: 3px;
        background: var(--primary);
    }

.footer-about p {
    margin-bottom: 20px;
    color: #adb5bd;
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

    .social-link:hover {
        background: var(--primary);
        transform: translateY(-3px);
    }

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #adb5bd;
    transition: var(--transition);
}

    .footer-links a:hover {
        color: white;
        padding-left: 5px;
    }

.footer-contact li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    color: #adb5bd;
}

.footer-contact i {
    margin-right: 10px;
    color: var(--primary);
}

.copyright {
    text-align: center;
    padding: 25px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #adb5bd;
    font-size: 0.9rem;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .sidebar {
        position: static;
    }

    .posts-grid, .featured-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .hero h1 {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        flex-direction: column;
        background: var(--card-bg);
        width: 100%;
        text-align: center;
        padding: 30px 0;
        box-shadow: var(--shadow);
        transition: var(--transition);
        z-index: 999;
    }

        .nav-menu.active {
            left: 0;
        }

    .nav-link {
        padding: 15px 0;
        display: block;
    }

    .section {
        padding: 60px 0;
    }

    .featured-posts {
        padding: 60px 0;
    }

    .hero {
        padding: 80px 0;
    }

        .hero h1 {
            font-size: 2.2rem;
        }

    .search-input.active {
        width: 180px;
    }
}

@media (max-width: 576px) {
    .posts-grid, .featured-grid {
        grid-template-columns: 1fr;
    }

    .section-title h2 {
        font-size: 1.8rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .search-input.active {
        width: 150px;
    }
}

.asp-button {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger-btn {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide button text and show icons */
.btn-icon-only {
    position: relative;
    width: 40px;
    height: 40px;
}

    .btn-icon-only span {
        display: none;
    }

    .btn-icon-only::before {
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

.btn-search::before {
    content: "\f002";
}

.btn-theme::before {
    content: "\f186";
}

.btn-theme.dark-mode::before {
    content: "\f185";
}

.btn-menu::before {
    content: "\f0c9";
}

@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }
}

/* Style for LinkButtons to look like read-more links */
.read-more-link {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
    align-self: flex-start;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

    .read-more-link:hover {
        gap: 10px;
        color: var(--secondary);
    }
/* Latest Posts - 3 posts horizontally */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.post-card-horizontal {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr !important; /* Override previous grid */
    gap: 0 !important;
    height: 100%;
}

.post-card-media {
    height: 180px;
    position: relative;
}

.post-image-wrapper {
    height: 100%;
    min-height: 180px;
}

.post-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.post-excerpt {
    font-size: 0.85rem;
    margin-bottom: 15px;
    flex: 1;
}

.post-footer {
    margin-top: auto;
    padding-top: 15px;
}

/* Featured Articles - 3 posts horizontally */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.featured-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.featured-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.featured-title {
    font-size: 1.1rem;
}

.featured-excerpt {
    font-size: 0.85rem;
    flex: 1;
    margin-bottom: 15px;
}

/* Main Layout - About Author at right side */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 350px; /* Sidebar fixed width */
    gap: 40px;
}

.content-main {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

/* Featured section with categories at right */
.section-featured {
    position: relative;
}

.section-featured-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

.section-featured .section-header {
    grid-column: 1 / -1;
}

.featured-main {
    grid-column: 1;
}

.categories-sidebar {
    grid-column: 2;
    position: sticky;
    top: 100px;
    align-self: start;
}

/* Make categories widget float */
.widget-categories {
    position: sticky;
    top: 100px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin: 0;
}

/* Popular Tags - Centered below all */
.widget-tags {
    margin-top: 60px;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
}

    .widget-tags .widget-header {
        text-align: center;
    }

    .widget-tags .widget-title {
        justify-content: center;
    }

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.tag-item {
    background: var(--light);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

    .tag-item:hover {
        background: var(--primary);
        color: white;
        transform: translateY(-2px);
    }

/* Stats Section - Smaller and modern */
.stats-section {
    padding: 40px 0;
    margin-top: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--body-bg);
    transition: all 0.3s ease;
}

    .stat-card:hover {
        border-color: var(--primary);
        box-shadow: var(--shadow);
    }

.stat-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .content-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .posts-grid,
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-featured-container {
        grid-template-columns: 1fr;
    }

    .categories-sidebar {
        grid-column: 1;
        position: static;
    }
}

@media (max-width: 768px) {
    .posts-grid,
    .featured-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}