/* =========================================
   BLOG PAGE SPECIFIC STYLES
   (Complements the main style.css)
========================================= */

/* Blog Hero Section */
.blog-hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 4rem 2rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.1"><path d="M0 0 L100 100 M100 0 L0 100" stroke="white" stroke-width="1"/></svg>');
    background-size: 30px 30px;
}

.blog-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.blog-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.blog-hero p {
    font-size: 1.2rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* Filter Bar - Fixed layout */
.filter-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 2rem;
    max-width: var(--max);
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.search-input-wrapper {
    position: relative;
    flex: 2;
    min-width: 280px;
    max-width: 400px;
}

.filter-wrapper {
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 220px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    z-index: 1;
    font-size: 1rem;
    transition: color 0.3s ease;
    pointer-events: none;
}

.filter-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    z-index: 1;
    font-size: 1rem;
    pointer-events: none;
}

.filter-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    font-size: 1rem;
    border-radius: 50px;
    border: 2px solid var(--border-color);
    background: var(--bg-light);
    color: var(--text-dark);
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}

.filter-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-bar input:focus ~ .search-icon {
    color: var(--primary-color);
}

.filter-bar select {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    font-size: 1rem;
    border-radius: 50px;
    border: 2px solid var(--border-color);
    background: var(--bg-light);
    color: var(--text-dark);
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
    box-sizing: border-box;
}

.filter-bar select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-bar select:focus ~ .filter-icon {
    color: var(--primary-color);
}

/* Blog Container */
.blog-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: var(--max);
    margin: 0 auto;
}

/* Blog Card */
.blog-card {
    background: var(--bg-light);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border-color);
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover img {
    transform: scale(1.05);
}

.blog-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-content h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.blog-meta .date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.blog-meta .date i {
    color: var(--primary-color);
    font-size: 0.8rem;
}

.blog-meta .category {
    background: var(--bg-gray);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary-color);
}

.blog-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-light);
    margin: 0 0 1rem 0;
    flex: 1;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.tags span {
    background: var(--bg-gray);
    color: var(--text-light);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tags span:hover {
    background: var(--primary-color);
    color: white;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.read-more i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.read-more:hover {
    color: var(--secondary-color);
    gap: 0.75rem;
}

.read-more:hover i {
    transform: translateX(5px);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 3rem 2rem;
    max-width: var(--max);
    margin: 0 auto;
    flex-wrap: wrap;
}

.pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.pagination a:hover {
    background: var(--bg-gray);
    color: var(--primary-color);
}

.pagination a.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination a.prev-next {
    width: auto;
    padding: 0 1rem;
    border-radius: 50px;
    gap: 0.5rem;
}

.pagination a.prev-next i {
    font-size: 0.9rem;
}

.pagination a.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* No Results State */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-light);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
}

.no-results i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--text-light);
}

/* Loading State */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
}

.loading i {
    font-size: 2rem;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Active navigation link */
.nav-links a.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-links a.active::after {
    width: 100%;
}

/* Dark theme adjustments */
body.dark-theme .blog-card {
    border-color: var(--border-color);
}

body.dark-theme .filter-bar input,
body.dark-theme .filter-bar select {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-dark);
}

body.dark-theme .no-results {
    background: var(--bg-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .blog-hero {
        padding: 3rem 1.5rem;
        margin-top: 0;
    }

    .blog-hero h1 {
        font-size: 2rem;
    }

    .blog-hero p {
        font-size: 1rem;
    }

    .filter-bar {
        padding: 1.5rem 1rem;
        gap: 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .search-input-wrapper,
    .filter-wrapper {
        min-width: 100%;
        max-width: 100%;
    }

    .blog-container {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1.5rem;
    }

    .blog-content {
        padding: 1.25rem;
    }

    .blog-content h3 {
        font-size: 1.2rem;
    }

    .pagination {
        padding: 2rem 1rem;
        gap: 0.3rem;
    }
    
    .pagination a {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .pagination a.prev-next {
        width: auto;
        padding: 0 0.75rem;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .blog-container {
        grid-template-columns: repeat(2, 1fr);
        padding: 1.5rem;
    }
    
    .filter-bar {
        padding: 2rem 1.5rem;
    }
    
    .search-input-wrapper {
        min-width: 240px;
    }
    
    .filter-wrapper {
        min-width: 160px;
    }
}

/* Small Desktop */
@media (min-width: 1025px) and (max-width: 1200px) {
    .blog-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        padding: 2rem;
    }
}
