/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 80%;
    max-width: none;
    margin: 0 auto;
    padding: 0 20px;
}

.main-container {
    width: 80%;
    max-width: none;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    color: white;
}

.btn-outline {
    background-color: transparent;
    color: #007bff;
    border: 2px solid #007bff;
}

.btn-outline:hover {
    background-color: #007bff;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
    color: white;
}

/* Header */
.header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo h1 {
    color: #007bff;
    margin: 0;
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: #333;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-menu a:hover {
    color: #007bff;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #007bff;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Search Form */
.search-form {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border-radius: 25px;
    padding: 0.5rem;
    border: 1px solid #e9ecef;
}

.search-form input {
    border: none;
    background: none;
    padding: 0.5rem;
    outline: none;
    min-width: 200px;
}

.search-form button {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-dropdown {
    position: relative;
}

.user-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.user-toggle:hover {
    background-color: #f8f9fa;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar i {
    font-size: 14px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: #333;
    transition: background-color 0.3s ease;
}

.dropdown-menu a:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.dropdown-menu .divider {
    height: 1px;
    background-color: #e9ecef;
    margin: 0.5rem 0;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 2px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 4rem 0;
    margin-bottom: 3rem;
    width: 100%;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.post-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.post-card.featured {
    grid-column: span 2;
}

.post-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.post-card.featured .post-image {
    height: 250px;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 3rem;
}

.post-content {
    padding: 1.5rem;
}

.post-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.post-category {
    background-color: #007bff;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.post-content h3 {
    margin-bottom: 1rem;
}

.post-content h3 a {
    color: #333;
    text-decoration: none;
}

.post-content h3 a:hover {
    color: #007bff;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.9rem;
    color: #6c757d;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    background-color: #f8f9fa;
    color: #6c757d;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.tag:hover {
    background-color: #007bff;
    color: white;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.page-link {
    padding: 0.5rem 1rem;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    color: #007bff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.page-link.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* Sidebar */
.sidebar {
    grid-column: span 1;
}

.widget {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.widget h3 {
    margin-bottom: 1rem;
    color: #333;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    display: block;
    padding: 0.5rem 0;
    color: #333;
    transition: color 0.3s ease;
}

.category-list a:hover {
    color: #007bff;
}

.category-list .post-count {
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: normal;
}

/* Footer */
.footer {
    background-color: #333;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
    width: 100%;
    position: relative;
    z-index: 10;
    min-height: 200px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto 2rem auto;
    padding: 0 20px;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    color: #ccc;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #ccc;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: #007bff;
    color: white;
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.social-link:hover {
    background-color: #0056b3;
    color: white;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 5px;
    outline: none;
}

.footer-bottom {
    border-top: 1px solid #555;
    padding-top: 1rem;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ccc;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-bottom a {
    color: #007bff;
}

/* Main Layout */
main.main-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    margin-top: 2rem;
    flex: 1;
}

/* Override grid layout for pages without sidebar */
.auth-container {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
}

.hero {
    grid-column: 1 / -1;
}

.featured-posts {
    grid-column: 1;
    margin-bottom: 3rem;
}

.latest-posts {
    grid-column: 1;
}

.sidebar {
    grid-column: 2;
    grid-row: 2 / span 2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .nav {
        order: 3;
        width: 100%;
        margin-top: 1rem;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0;
    }
    
    .nav-menu li {
        border-bottom: 1px solid #e9ecef;
    }
    
    .nav-menu a {
        display: block;
        padding: 1rem 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav {
        display: none;
    }
    
    .nav.active {
        display: block;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .post-card.featured {
        grid-column: span 1;
    }
    
    main.main-container {
        grid-template-columns: 1fr;
    }
    
    .hero {
        grid-column: 1;
    }
    
    .featured-posts {
        grid-column: 1;
    }
    
    .latest-posts {
        grid-column: 1;
    }
    
    .sidebar {
        grid-column: 1;
        grid-row: auto;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .search-form input {
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 0 15px;
    }
    
    .main-container {
        width: 95%;
        padding: 0 15px;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .post-content {
        padding: 1rem;
    }
    
    .post-footer {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
}

/* Author Links */
.author-name a,
.author a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.author-name a:hover,
.author a:hover {
    color: #007bff;
    text-decoration: underline;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.hidden { display: none; }
.visible { display: block; }
