/* Blog Specific Styles */

/* Blog Hero Section */
.blog-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    padding: 120px 0 60px;
    margin-top: 70px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                      radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
}

.blog-hero-content {
    position: relative;
    z-index: 1;
}

.blog-hero h1 {
    font-size: 3.5rem;
    color: white;
    margin-bottom: 1rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.blog-tagline {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.blog-description {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 600px;
    margin: 0 auto;
}

/* Blog Filters Section */
.blog-filters {
    background: var(--background-light);
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 80px;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.filters-wrapper {
    display: flex;
    gap: 2rem;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.1rem;
}

.search-box input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.5rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.category-filter select {
    padding: 1rem 2rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.5rem center;
    padding-right: 3rem;
}

.category-filter select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* Blog Posts Grid */
.blog-posts {
    padding: 60px 0;
    background: var(--background-white);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Blog Card */
.blog-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.6s ease;
    min-height: 500px;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.blog-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: var(--background-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    background: var(--background-light);
    border-radius: 0;
}

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

.blog-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #FF6B35;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
}

.blog-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.blog-meta i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.blog-content h3 {
    font-size: 1.35rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-weight: 700;
    min-height: 3.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-content p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
    min-height: 4.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

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

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

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

/* Load More Button */
.load-more-wrapper {
    text-align: center;
    margin-top: 3rem;
}

#loadMore {
    padding: 1rem 2.5rem;
    font-size: 1rem;
}

/* Newsletter Section */
.newsletter-section {
    background: var(--background-light);
    padding: 60px 0;
    border-top: 1px solid var(--border-color);
}

.newsletter-box {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
}

.newsletter-content h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.newsletter-content p {
    color: var(--text-light);
    font-size: 1.125rem;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    flex: 1;
    max-width: 500px;
}

.newsletter-form input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.newsletter-form button {
    white-space: nowrap;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hidden cards for load more */
.blog-card.hidden {
    display: none;
}

/* Filter animations */
.blog-card.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

.blog-card.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */

/* Tablet Design */
@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Mobile Design */
@media (max-width: 768px) {
    .blog-hero h1 {
        font-size: 2.5rem;
    }

    .blog-tagline {
        font-size: 1.25rem;
    }

    .blog-description {
        font-size: 1rem;
    }

    .filters-wrapper {
        flex-direction: column;
        gap: 1rem;
    }

    .search-box {
        width: 100%;
    }

    .category-filter {
        width: 100%;
    }

    .category-filter select {
        width: 100%;
    }

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

    .blog-content {
        padding: 1.5rem;
    }

    .blog-content h3 {
        font-size: 1.25rem;
        min-height: auto;
        -webkit-line-clamp: 3;
    }

    .blog-content p {
        min-height: auto;
        -webkit-line-clamp: 4;
    }

    .blog-card {
        min-height: auto;
    }

    .blog-image {
        height: 200px;
    }

    .newsletter-box {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
    }

    .newsletter-form {
        width: 100%;
        flex-direction: column;
    }

    .blog-filters {
        position: static;
        padding: 1.5rem 0;
    }
}

@media (max-width: 480px) {
    .blog-hero {
        padding: 120px 0 60px;
    }

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

    .blog-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Enhanced Styles for Dynamic Content Loading */

/* Search Results Message */
.search-results-message {
    background: var(--background-light);
    padding: 1rem 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary-color);
    display: none;
}

.results-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-dark);
    font-weight: 500;
}

.results-summary i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Enhanced List Styling */
.enhanced-list {
    padding-left: 1.5rem;
    margin-bottom: 2rem;
}

.enhanced-list li {
    margin-bottom: 1rem;
    line-height: 1.7;
    position: relative;
}

.enhanced-list li::marker {
    color: var(--primary-color);
    font-weight: bold;
}

/* Reading Progress Indicator */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    width: 0%;
    transition: width 0.3s ease;
}

/* Post Navigation */
.post-navigation {
    background: var(--background-light);
    padding: 2rem;
    border-radius: 16px;
    margin: 3rem 0;
    border: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.nav-prev, .nav-next, .nav-back {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    color: var(--text-dark);
    background: white;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-prev:hover, .nav-next:hover, .nav-back:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.nav-back {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.nav-back:hover {
    background: var(--primary-dark);
    color: white;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

/* Notification System */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    min-width: 300px;
    border-left: 4px solid var(--primary-color);
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    border-left-color: var(--success-color, #10b981);
}

.notification-error {
    border-left-color: #ef4444;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-dark);
}

.notification-success .notification-content i {
    color: var(--success-color, #10b981);
}

.notification-error .notification-content i {
    color: #ef4444;
}

/* Error Message Styling */
.error-message {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin: 2rem 0;
}

.error-content i {
    font-size: 3rem;
    color: #f59e0b;
    margin-bottom: 1rem;
}

.error-content h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.error-content p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Enhanced Blog Card Hover Effects */
.blog-card {
    position: relative;
    overflow: hidden;
}

.blog-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    border-radius: 18px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-card:hover::before {
    opacity: 1;
}

/* Improved Category Tags */
.blog-category {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

/* Enhanced Typography */
.blog-content h3 {
    background: linear-gradient(135deg, var(--text-dark), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .blog-hero {
        padding: 100px 0 50px;
        margin-top: 60px;
    }
    
    .blog-hero h1 {
        font-size: 2.25rem;
        line-height: 1.2;
    }
    
    .blog-tagline {
        font-size: 1.125rem;
    }
    
    .blog-description {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .filters-wrapper {
        padding: 0 1rem;
    }
    
    .blog-posts {
        padding: 50px 0;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .blog-card {
        min-height: auto;
    }
    
    .blog-image {
        height: 180px;
    }
    
    .blog-content {
        padding: 1.5rem;
    }
    
    .blog-content h3 {
        font-size: 1.125rem;
        min-height: auto;
        -webkit-line-clamp: 2;
        line-height: 1.3;
    }
    
    .blog-content p {
        font-size: 0.95rem;
        min-height: auto;
        -webkit-line-clamp: 3;
        line-height: 1.5;
        margin-bottom: 1.25rem;
    }
    
    .blog-meta {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 0.875rem;
        font-size: 0.8rem;
    }
    
    .blog-meta span {
        display: inline-block;
        margin-right: 1rem;
    }
    
    .read-more {
        font-size: 0.9rem;
        padding: 0.5rem 0;
    }
    
    .newsletter-box {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1.5rem;
        gap: 2rem;
    }
    
    .newsletter-content h3 {
        font-size: 1.5rem;
    }
    
    .newsletter-content p {
        font-size: 1rem;
    }
    
    .newsletter-form {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .newsletter-form input {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .newsletter-form button {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .search-results-message {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .results-summary {
        font-size: 0.9rem;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-prev, .nav-next, .nav-back {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        min-width: auto;
        font-size: 0.9rem;
    }
    
    .blog-category {
        font-size: 0.7rem;
        padding: 0.375rem 0.875rem;
    }
    
    .error-message {
        padding: 2rem 1.5rem;
        margin: 1.5rem 0;
    }
    
    .error-content h3 {
        font-size: 1.25rem;
    }
    
    .error-content p {
        font-size: 0.95rem;
    }
}

/* Loading States */
.blog-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

.blog-card.loading {
    opacity: 0.5;
    transform: scale(0.98);
    transition: all 0.3s ease;
}

/* Smooth Animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.blog-card.new {
    animation: slideInRight 0.6s ease;
}

/* Focus Improvements for Accessibility */
.blog-card:focus-within {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.search-box input:focus,
.category-filter select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .blog-card {
        border: 2px solid var(--text-dark);
    }
    
    .blog-category {
        background: var(--text-dark);
        color: white;
    }
    
    .read-more {
        text-decoration: underline;
    }
}