/* ====================================
   Modern Blog Redesign - Hope Institute
   Professional & Attractive Card Design
   ==================================== */

/* CSS Variables for consistency */
:root {
    --primary-color: #065f46;
    --primary-light: #059669;
    --primary-dark: #064e3b;
    --accent-color: #fbbf24;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --border-light: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-3xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hero Section Animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float-slow {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(2deg);
    }
    66% {
        transform: translateY(10px) rotate(-1deg);
    }
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
    }
}

.animate-fade-in {
    animation: fade-in 0.8s ease-out forwards;
}

.animate-fade-in-up {
    animation: fade-in-up 0.8s ease-out forwards;
}

.animate-float-slow {
    animation: float-slow 8s ease-in-out infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 6s ease infinite;
}

.animate-pulse-glow {
    animation: pulse-glow 3s ease-in-out infinite;
}

/* Animation Delays */
.animation-delay-300 {
    animation-delay: 0.3s;
}

.animation-delay-600 {
    animation-delay: 0.6s;
}

.animation-delay-900 {
    animation-delay: 0.9s;
}

.animation-delay-1200 {
    animation-delay: 1.2s;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

.animation-delay-6000 {
    animation-delay: 6s;
}

/* Modern Hero Section Styles */
.hero-search-form {
    position: relative;
    transition: var(--transition);
}

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

.hero-search-input {
    transition: var(--transition);
}

.hero-search-input:focus {
    transform: scale(1.02);
}

.hero-cta-button {
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.hero-cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.5s ease;
}

.hero-cta-button:hover::before {
    left: 100%;
}

.hero-stats-item {
    position: relative;
    transition: var(--transition);
}

.hero-stats-item:hover {
    transform: translateY(-4px);
}

.hero-stats-item::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-light), #10b981);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.hero-stats-item:hover::after {
    width: 60%;
}

/* Backdrop blur support */
@supports (backdrop-filter: blur(10px)) {
    .backdrop-blur-sm {
        backdrop-filter: blur(4px);
    }
    
    .backdrop-blur {
        backdrop-filter: blur(8px);
    }
}

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(10px)) {
    .backdrop-blur-sm {
        background-color: rgba(255, 255, 255, 0.8);
    }
    
    .backdrop-blur {
        background-color: rgba(255, 255, 255, 0.9);
    }
}

/* Enhanced search suggestions */
.search-suggestions {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-suggestion-tag {
    position: relative;
    transition: var(--transition);
}

.search-suggestion-tag::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent, rgba(16, 185, 129, 0.1));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-suggestion-tag:hover::before {
    opacity: 1;
}

/* Scroll indicator styling */
.scroll-indicator {
    position: relative;
}

.scroll-indicator::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
}

/* Featured posts anchor smooth scroll */
html {
    scroll-behavior: smooth;
}

#featured-posts {
    scroll-margin-top: 100px;
}

/* Modern Blog Card Design */
.blog-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(229, 231, 235, 0.3);
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(6, 95, 70, 0.1);
}

/* Image Container with Overlay Effects */
.blog-card-image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Image Overlay Gradient */
.blog-card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.05) 50%,
        rgba(0, 0, 0, 0.15) 100%
    );
    opacity: 0;
    transition: var(--transition);
}

.blog-card:hover .blog-card-image::after {
    opacity: 1;
}

/* Category Badge */
.category-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--primary-color);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.375rem 0.875rem;
    border-radius: 50px;
    z-index: 10;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(6, 95, 70, 0.2);
}

/* Featured Badge */
.featured-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, var(--accent-color), #f59e0b);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.375rem 0.875rem;
    border-radius: 50px;
    z-index: 10;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
    animation: subtle-pulse 3s infinite;
}

@keyframes subtle-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Card Content */
.blog-card-content {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Meta Information */
.blog-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.blog-date, .blog-views {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.blog-date i, .blog-views i {
    opacity: 0.8;
}

/* Card Title */
.blog-card-title {
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
    background: linear-gradient(
        to right,
        var(--primary-color),
        var(--primary-light)
    );
    background-size: 0% 2px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease-out;
}

.blog-card-title a:hover {
    color: var(--primary-color);
    background-size: 100% 2px;
}

/* Featured post title styling */
.blog-card-title.featured {
    font-size: 1.875rem;
    margin-bottom: 1.25rem;
}

/* Excerpt */
.blog-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.95rem;
}

/* Card Footer */
.blog-card-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(229, 231, 235, 0.5);
}

/* Read More Button */
.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: var(--transition);
    padding: 0.5rem 0;
    position: relative;
}

.read-more-btn:hover {
    color: var(--primary-dark);
    transform: translateX(4px);
}

.read-more-btn i {
    transition: var(--transition);
    font-size: 0.875rem;
}

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

/* Featured Post Styling */
.blog-card.featured {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 1) 0%,
        rgba(249, 250, 251, 1) 100%
    );
    border: 2px solid rgba(6, 95, 70, 0.1);
}

.blog-card.featured .blog-card-image {
    height: 320px;
}

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

/* Filter Buttons Redesign */
.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: 2px solid var(--border-light);
    background: var(--white);
    color: var(--text-secondary);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(6, 95, 70, 0.1),
        transparent
    );
    transition: left 0.5s ease;
}

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

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(6, 95, 70, 0.3);
    transform: translateY(-2px);
}

.filter-btn span {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 0.125rem 0.5rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
}

.filter-btn:not(.active) span {
    background: var(--bg-light);
    color: var(--text-light);
}

/* Pagination Redesign */
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-light);
    background: var(--white);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    min-width: 44px;
    transition: var(--transition);
}

.pagination-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pagination-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(6, 95, 70, 0.3);
}

/* Sidebar Styling */
.blog-sidebar-widget {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    border: 1px solid rgba(229, 231, 235, 0.3);
    transition: var(--transition);
}

.blog-sidebar-widget:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--bg-light);
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(
        90deg,
        var(--primary-color),
        var(--primary-light)
    );
    border-radius: 1px;
}

/* Recent Posts in Sidebar */
.recent-post-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.recent-post-item:last-child {
    border-bottom: none;
}

.recent-post-item:hover {
    transform: translateX(8px);
    background: rgba(6, 95, 70, 0.02);
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: var(--radius-md);
}

.recent-post-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.recent-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.recent-post-item:hover .recent-post-image img {
    transform: scale(1.1);
}

.recent-post-content {
    flex: 1;
}

.recent-post-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 0.375rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: var(--transition);
}

.recent-post-item:hover .recent-post-title {
    color: var(--primary-color);
}

.recent-post-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Category Links Redesign */
.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
}

.category-link:hover {
    background: rgba(6, 95, 70, 0.05);
    color: var(--primary-color);
    transform: translateX(8px);
    border-color: rgba(6, 95, 70, 0.1);
}

.category-link.active {
    background: var(--primary-color);
    color: var(--white);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(6, 95, 70, 0.2);
}

.category-count {
    background: rgba(6, 95, 70, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
}

.category-link.active .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

/* Loading States */
.blog-card-skeleton {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    height: 400px;
    animation: skeleton-shimmer 1.5s infinite linear;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .blog-card-content {
        padding: 1.25rem;
    }
    
    .blog-card-image {
        height: 200px;
    }
    
    .blog-card.featured .blog-card-image {
        height: 240px;
    }
    
    .blog-card-title {
        font-size: 1.25rem;
    }
    
    .blog-card-title.featured {
        font-size: 1.5rem;
    }
    
    .blog-sidebar-widget {
        padding: 1.25rem;
    }
    
    .filter-btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .recent-post-item {
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    .category-link {
        padding: 0.75rem;
    }
}

@media (max-width: 640px) {
    .blog-card-content {
        padding: 1rem;
    }
    
    .blog-card-image {
        height: 180px;
    }
    
    .blog-card.featured .blog-card-image {
        height: 220px;
    }
    
    .blog-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .category-badge,
    .featured-badge {
        top: 12px;
        left: 12px;
        right: 12px;
        font-size: 0.7rem;
        padding: 0.25rem 0.625rem;
    }
    
    .featured-badge {
        right: 12px;
        left: auto;
    }
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-light: #9ca3af;
        --bg-light: #1f2937;
        --white: #111827;
        --border-light: #374151;
    }
    
    .blog-card {
        background: var(--white);
        border-color: var(--border-light);
    }
    
    .blog-sidebar-widget {
        background: var(--white);
        border-color: var(--border-light);
    }
}

/* Print styles */
@media print {
    .blog-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-light);
    }
    
    .blog-card:hover {
        transform: none;
    }
    
    .category-badge,
    .featured-badge {
        background: transparent;
        color: var(--text-primary);
        border: 1px solid var(--border-light);
    }
}

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

.filter-btn:focus,
.pagination-btn:focus,
.read-more-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .blog-card {
        border: 2px solid var(--text-primary);
    }
    
    .category-badge,
    .featured-badge {
        border: 2px solid var(--white);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .blog-card:hover {
        transform: none;
    }
    
    .filter-btn:hover {
        transform: none;
    }
}
