/* Reset and Base Styles */
.blog-container {
    max-width: 1200px;
    margin-top: 80px; /* Adjust based on your header height */
    padding: 2rem;
    position: relative;
    overflow: hidden;  /* Important to contain the light effect */
    min-height: 100vh; /* Ensure container fills viewport */
    z-index: 1;
}

/* Blog Post Grid Layout */
#blog-posts-container {
    max-width: 100%; /* Changed from 1400px */
    margin: 0 auto;
    padding: 2rem;
    margin-top: 0.5rem; /* Add small gap after filters */
    position: relative;
    z-index: 1;
}

#blog-posts-container > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(600px, 1fr)); /* Increased minimum width */
    gap: 2rem;
    padding: 2rem 0;
}

/* Blog Card Base */
.blog-card {
    background: linear-gradient(135deg, rgba(11, 17, 32, 0.7) 0%, rgba(17, 24, 39, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2.5rem; /* Increased padding */
    min-height: 300px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.blog-card:hover {
    transform: translateY(-5px);
    border-color: rgba(88, 130, 255, 0.3);
    box-shadow: 0 8px 30px rgba(88, 130, 255, 0.15);
}

/* Author Section */
.blog-card .author-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.blog-card img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(88, 130, 255, 0.3);
}

/* Title and Content */
.blog-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin: 1rem 0;
}

.blog-card p {
    color: #94a3b8;
    line-height: 1.6;
    flex-grow: 1;
}

/* Card Footer Layout */
.blog-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem; /* Add consistent gap */
    margin-top: 1.5rem;
}

/* Read More Button */
.read-more-btn {
    color: #60a5fa; /* Remove gradient, use flat color */
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: all 0.3s ease;
    background: transparent; /* Remove gradient background */
}

.read-more-btn:hover {
    color: #93c5fd;
}

.read-more-btn svg {
    width: 1rem;
    height: 1rem;
}

/* Category Badge on Blog Cards */
.category-badge {
    background: linear-gradient(45deg, #0ea5e9, #2563eb);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.625rem; /* 10px */
    font-weight: 500;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

/* Loading Spinner */
.cyber-spinner {
    position: relative;
    width: 80px;
    height: 80px;
}

.spinner-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.spinner-circle {
    width: 60px;
    height: 60px;
    border: 4px solid transparent;
    border-top: 4px solid #3b82f6;
    border-right: 4px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-text {
    margin-top: 10px;
    font-size: 14px;
    color: #3b82f6;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Responsive Design */
@media (max-width: 1400px) {
    #blog-posts-container > div {
        grid-template-columns: 1fr;
        max-width: 800px;
        margin: 0 auto;
    }
    
    .blog-card {
        padding: 2rem;
    }
}

/* Add these header styles at the top */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: linear-gradient(180deg, rgba(11, 17, 32, 0.95) 0%, rgba(11, 17, 32, 0.8) 100%);
    backdrop-filter: blur(10px);
}

/* Add these styles for body and main content */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

main {
    margin-top: 20px;
    margin-bottom: 2rem;
    padding-top: 0.5rem;
}

/* Footer Styles */
footer {
    background: linear-gradient(180deg, rgba(11, 17, 32, 0.95) 0%, rgba(11, 17, 32, 1) 100%);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 0;
    width: 100%;
}

/* Newsletter section in footer */
.newsletter-section {
    margin-bottom: 2rem;
}

/* Ensure content doesn't touch the edges on mobile */
@media (max-width: 768px) {
    footer {
        padding: 2rem 1rem;
    }
    
    .blog-card .card-footer {
        gap: 1.5rem; /* Increase gap on mobile */
    }

    .read-more-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
        gap: 0.3rem;
    }
    
    .read-more-btn svg {
        width: 0.875rem;
        height: 0.875rem;
    }
}

@media (max-width: 480px) {
    .blog-card .card-footer {
        gap: 2rem; /* Even more gap on smaller screens */
    }

    .read-more-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.6875rem;
        gap: 0.25rem;
    }
    
    .read-more-btn svg {
        width: 0.75rem;
        height: 0.75rem;
    }
}

/* Category Filter Styles */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem; /* Reduced from 2rem */
    padding: 0.5rem 0; /* Reduced padding */
}

.filter-label {
    color: #94a3b8;
    font-weight: 500;
    margin-right: 1rem;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
}

.category-filter-btn {
    background: rgba(88, 130, 255, 0.1);
    border: none;
    color: #94a3b8;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    backdrop-filter: blur(8px);
    font-size: 0.9375rem; /* 15px base size */
    white-space: nowrap;
    flex-shrink: 0;
}

.category-filter-btn:hover {
    background: rgba(88, 130, 255, 0.2);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 130, 255, 0.2);
}

.category-filter-btn.active {
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    color: white;
    box-shadow: 0 4px 15px rgba(88, 130, 255, 0.3);
}

/* Blog Title Styles */
.gradient-title {
    font-size: 4rem;
    font-weight: 800;
    background-image: linear-gradient(
        to right,
        #60a5fa,  /* Blue */
        #818cf8,  /* Indigo */
        #c084fc   /* Purple */
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(96, 165, 250, 0.2);
}

.blog-description {
    color: #94a3b8;
    font-size: 1.125rem;
    line-height: 1.75;
    max-width: 800px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gradient-title {
        font-size: 3rem;
    }
    
    .blog-description {
        font-size: 1rem;
    }

    .category-filter-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem; /* 14px */
    }
    
    .filter-buttons {
        gap: 0.35rem; /* Tighter gap on mobile */
    }
}

@media (max-width: 480px) {
    .gradient-title {
        font-size: 2.5rem;
    }
    
    .category-filter-btn {
        padding: 0.45rem 0.75rem;
        font-size: 0.8125rem; /* 13px - increased from previous */
    }
    
    .filter-buttons {
        gap: 0.25rem; /* Even tighter gap on smaller screens */
    }
}

/* Blog Header Styles */
.blog-header {
    margin-bottom: 2rem; /* Reduced from 3rem */
}

/* Main Container Adjustment */
main.container {
    padding-top: 4rem; /* Reduced from 8rem to bring everything up */
}

/* Grid Background */
.grid-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(88, 130, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(88, 130, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: -1;
    pointer-events: none;
}

/* Moving Light Effect */
.light-effect {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(88, 130, 255, 0.05) 0%,
        rgba(88, 130, 255, 0.02) 30%,
        transparent 70%
    );
    z-index: -1;
    pointer-events: none;
    animation: moveLight 15s ease-in-out infinite;
    opacity: 0.7;
}

@keyframes moveLight {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(-10%, 10%) rotate(90deg);
    }
    50% {
        transform: translate(10%, -10%) rotate(180deg);
    }
    75% {
        transform: translate(10%, 10%) rotate(270deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

/* Update blog posts container for proper layering */
#blog-posts-container {
    position: relative;
    z-index: 1;
}
