/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2563eb;
    letter-spacing: -0.025em;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav a {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav a:hover,
.nav a.active {
    color: #2563eb;
}

.nav a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: #2563eb;
    border-radius: 1px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 0.875rem;
    width: 250px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: #94a3b8;
    pointer-events: none;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat .number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat .label {
    font-size: 0.875rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Main Content Layout */
.main {
    padding: 4rem 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
}

/* Sidebar Styles */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.widget {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.widget h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.75rem;
}

.category-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: #64748b;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.category-list a:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.category-list i {
    margin-right: 0.75rem;
    width: 16px;
}

.category-list span {
    font-size: 0.875rem;
    background: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    color: #64748b;
}

.popular-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.popular-post {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.popular-post:hover {
    background: #f8fafc;
}

.popular-post img {
    width: 70px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
}

.post-info h4 {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.post-info .date {
    font-size: 0.75rem;
    color: #94a3b8;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.newsletter-form input {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
}

.newsletter-form button {
    padding: 0.75rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.newsletter-form button:hover {
    background: #1d4ed8;
}

/* Horizontal Scroll Controls */
.blog-content {
    min-height: 100vh;
    position: relative;
}

.scroll-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.scroll-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: white;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.scroll-btn:hover {
    border-color: #2563eb;
    background: #2563eb;
    color: white;
    transform: scale(1.1);
}

.scroll-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.scroll-btn:disabled:hover {
    border-color: #e2e8f0;
    background: white;
    color: #64748b;
}

.posts-container-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(45deg, #f8fafc 0%, #ffffff 100%);
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Edit Mode Toggle */
.edit-toggle {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: #2563eb;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.edit-toggle:hover {
    background: #1d4ed8;
    transform: translateY(-50%) scale(1.1);
}

.edit-toggle.active {
    background: #ef4444;
}

.edit-toggle.active:hover {
    background: #dc2626;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.filter-options {
    display: flex;
    gap: 1rem;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e2e8f0;
    background: white;
    color: #64748b;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: #2563eb;
    background: #2563eb;
    color: white;
}

.sort-options select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
}

/* Posts Grid - Horizontal Flexbox Layout */
.posts-grid {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1rem 0 2rem 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar */
.posts-grid::-webkit-scrollbar {
    height: 8px;
}

.posts-grid::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.posts-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.posts-grid::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Individual Post Container */
.post {
    min-width: 350px;
    max-width: 350px;
    flex-shrink: 0;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    cursor: pointer;
}

.post {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
}

/* Featured Post - Remove Grid Spanning for Horizontal Layout */
.featured-post {
    min-width: 400px;
    max-width: 400px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
}

.featured-post .post-content {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.featured-post .post-title {
    color: white;
}

.featured-post .post-excerpt {
    color: rgba(255, 255, 255, 0.9);
}

.featured-post .post-meta {
    color: rgba(255, 255, 255, 0.8);
}

.featured-post .post-stats {
    color: rgba(255, 255, 255, 0.8);
}

.featured-post .read-more {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.featured-post .read-more:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Edit Mode Styles */
.post.edit-mode {
    border: 2px dashed #2563eb;
    background: #f8fafc;
}

.post.edit-mode::before {
    content: "✏️ Edit Mode";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #2563eb;
    color: white;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    z-index: 10;
}

.post.edit-mode .post-content {
    position: relative;
}

.post.edit-mode .editable {
    border: 1px solid #e2e8f0;
    padding: 0.25rem;
    border-radius: 4px;
    background: white;
    min-height: 1em;
}

.post.edit-mode .editable:hover {
    border-color: #2563eb;
    background: #f8fafc;
}

.post.edit-mode .editable:focus {
    outline: 2px solid #2563eb;
    border-color: transparent;
}

.post-image {
    position: relative;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Remove featured post specific height */

.post:hover .post-image img {
    transform: scale(1.05);
}

.post-overlay {
    position: absolute;
    top: 1rem;
    left: 1rem;
}

.category-tag {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-tag.technology {
    background: #dbeafe;
    color: #1e40af;
}

.category-tag.design {
    background: #fef3c7;
    color: #92400e;
}

.category-tag.business {
    background: #d1fae5;
    color: #065f46;
}

.category-tag.lifestyle {
    background: #fce7f3;
    color: #be185d;
}

.post-content {
    padding: 2rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #94a3b8;
}

.author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
    color: #1e293b;
}

.featured-post .post-title {
    font-size: 2rem;
}

.post-excerpt {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.post-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #94a3b8;
}

.post-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #2563eb;
    font-weight: 500;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: #1d4ed8;
}

.read-more i {
    transition: transform 0.3s ease;
}

.read-more:hover i {
    transform: translateX(4px);
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 3rem;
}

.load-more-btn {
    padding: 1rem 2rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.load-more-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

/* Footer */
.footer {
    background: #1e293b;
    color: white;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    padding: 4rem 0 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1.5rem;
    color: white;
}

.footer-section p {
    color: #94a3b8;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: #334155;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.3s ease;
}

.social-links a:hover {
    background: #2563eb;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section ul a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul a:hover {
    color: white;
}

.footer-newsletter {
    display: flex;
    gap: 0.5rem;
}

.footer-newsletter input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #334155;
    border-radius: 8px;
    background: #334155;
    color: white;
}

.footer-newsletter input::placeholder {
    color: #94a3b8;
}

.footer-newsletter button {
    padding: 0.75rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.footer-newsletter button:hover {
    background: #1d4ed8;
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding: 2rem 0;
    text-align: center;
    color: #94a3b8;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .sidebar {
        order: -1;
    }
    
    .posts-grid {
        gap: 1rem;
    }
    
    .post {
        min-width: 300px;
        max-width: 300px;
    }
    
    .featured-post {
        min-width: 320px;
        max-width: 320px;
    }
    
    .hero-stats {
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav ul {
        gap: 1rem;
    }
    
    .search-box input {
        width: 200px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-bar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .filter-options {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .posts-grid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .post {
        min-width: 280px;
        max-width: 280px;
    }
    
    .featured-post {
        min-width: 300px;
        max-width: 300px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-newsletter {
        flex-direction: column;
    }
    
    .edit-toggle {
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav ul {
        gap: 1rem;
    }
    
    .search-box input {
        width: 200px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-bar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .filter-options {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-newsletter {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .main {
        padding: 2rem 0;
    }
    
    .post-content {
        padding: 1.5rem;
    }
    
    .widget {
        padding: 1.5rem;
    }
    
    .posts-grid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        gap: 0.5rem;
    }
    
    .post {
        min-width: 260px;
        max-width: 260px;
    }
    
    .featured-post {
        min-width: 280px;
        max-width: 280px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
