/* Blog Page Specific Styles */
/* ============================= */

/* Background Pattern */
.bg-grid-pattern {
    background-image: 
        linear-gradient(rgba(34, 197, 94, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 197, 94, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Hero Section Enhancements */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(34, 197, 94, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Sidebar Enhancements */
.sidebar {
    transition: all 0.3s ease;
}

.sidebar .sticky {
    position: sticky;
    top: 2rem;
}

/* Search Input */
.search-input {
    transition: all 0.3s ease;
    position: relative;
}

.search-input:focus-within {
    transform: translateY(-2px);
}

.search-input input:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Category Filters */
.category-filter {
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    outline: none;
}

.category-filter:hover {
    background: rgba(34, 197, 94, 0.1);
    transform: translateX(4px);
}

.category-filter.active {
    background: #22c55e;
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* Recent Posts */
.recent-post {
    transition: all 0.3s ease;
}

.recent-post:hover {
    transform: translateX(4px);
}

.recent-post img {
    transition: all 0.3s ease;
}

.recent-post:hover img {
    transform: scale(1.05);
}

/* Newsletter Section */
.newsletter-section {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.newsletter-section:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.newsletter-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.1), transparent);
    transition: left 0.6s ease;
}

.newsletter-section:hover::before {
    left: 100%;
}

/* Featured Article */
.featured-article {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.featured-article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #22c55e, #16a34a, #22c55e);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.featured-article:hover::before {
    transform: scaleX(1);
}

.featured-article:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Blog Cards */
.blog-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #22c55e, #16a34a, #22c55e);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.blog-card:hover::before {
    transform: scaleX(1);
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.blog-image {
    position: relative;
    overflow: hidden;
}

.blog-image img {
    transition: all 0.3s ease;
}

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

.blog-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(34, 197, 94, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.blog-date {
    color: #6b7280;
}

.blog-read-time {
    color: #9ca3af;
}

.blog-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-excerpt {
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.blog-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.blog-author {
    display: flex;
    align-items: center;
    space-x: 0.75rem;
}

.blog-author img {
    border: 2px solid #e5e7eb;
}

.blog-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.blog-link:hover {
    background: #22c55e;
    color: white;
    transform: scale(1.1);
}

/* Load More Button */
.load-more-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.2), transparent);
    transition: left 0.5s ease;
}

.load-more-btn:hover::before {
    left: 100%;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Featured Article Detail */
.article-detail {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.article-detail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #22c55e, #16a34a, #22c55e);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.article-detail:hover::before {
    transform: scaleX(1);
}

/* Prose Enhancements */
.prose h2 {
    color: #111827;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose p {
    color: #6b7280;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.prose ul {
    margin-bottom: 1.5rem;
}

.prose li {
    color: #6b7280;
    line-height: 1.6;
}

/* Info Box */
.info-box {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 2rem 0;
}

.dark .info-box {
    background: #1e3a8a;
    border-color: #1d4ed8;
}

/* Article Actions */
.article-actions button {
    transition: all 0.3s ease;
}

.article-actions button:hover {
    transform: translateY(-2px);
}

/* CTA Section */
.cta-section {
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Animation Classes */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.6s ease-out forwards;
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Staggered Animation Delays */
.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-400 { animation-delay: 0.4s; }
.animate-delay-500 { animation-delay: 0.5s; }

/* Responsive Enhancements */
@media (max-width: 1024px) {
    .sidebar .sticky {
        position: static;
    }
    
    .blog-card {
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .blog-footer {
        flex-direction: column;
        align-items: flex-start;
        space-y: 1rem;
    }
    
    .blog-meta {
        flex-direction: column;
        align-items: flex-start;
        space-y: 0.5rem;
    }
    
    .featured-article {
        padding: 1.5rem;
    }
}

@media (max-width: 640px) {
    .hero-section {
        padding: 4rem 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .blog-content {
        padding: 1rem;
    }
    
    .article-detail {
        padding: 1.5rem;
    }
}

/* Dark Mode Enhancements */
.dark .bg-grid-pattern {
    background-image: 
        linear-gradient(rgba(34, 197, 94, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 197, 94, 0.05) 1px, transparent 1px);
}

.dark .blog-card {
    background: #1f2937;
    color: white;
}

.dark .blog-title {
    color: white;
}

.dark .blog-excerpt {
    color: #d1d5db;
}

.dark .blog-date {
    color: #9ca3af;
}

.dark .blog-read-time {
    color: #6b7280;
}

.dark .category-filter {
    color: #d1d5db;
}

.dark .category-filter:hover {
    background: rgba(34, 197, 94, 0.2);
}

.dark .category-filter.active {
    background: #22c55e;
    color: white;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Focus States for Accessibility */
.focus-visible:focus {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .blog-card {
        border: 2px solid currentColor;
    }
    
    .category-filter {
        border: 2px solid currentColor;
    }
    
    .featured-article {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-fade-in-up,
    .animate-slide-in-left,
    .animate-scale-in {
        animation: none;
    }
    
    .blog-card:hover {
        transform: none;
    }
    
    .featured-article:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .hero-section,
    .cta-section,
    .sidebar {
        display: none;
    }
    
    .blog-card,
    .featured-article {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}
