/* Modern Blogs Page Styles */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Blog card animations */
.blog-card {
    animation: fadeInUp 0.6s ease-out;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

/* Stagger animation for multiple cards */
.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.2s; }
.blog-card:nth-child(3) { animation-delay: 0.3s; }
.blog-card:nth-child(4) { animation-delay: 0.4s; }
.blog-card:nth-child(5) { animation-delay: 0.5s; }
.blog-card:nth-child(6) { animation-delay: 0.6s; }

/* Search input focus effects */
#searchInput:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    transform: scale(1.02);
}

/* Button hover effects */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

/* Loading spinner animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Image hover effects */
.blog-card img {
    transition: transform 0.3s ease;
}

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

/* Author avatar styles */
.author-avatar {
    border: 2px solid #e5e7eb;
    transition: border-color 0.3s ease;
}

.blog-card:hover .author-avatar {
    border-color: #3b82f6;
}

/* Date badge styles */
.date-badge {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Responsive grid adjustments */
@media (max-width: 768px) {
    .blog-card {
        margin-bottom: 1.5rem;
    }
    
    #blogGrid {
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .blog-card .p-6 {
        padding: 1rem;
    }
    
    .blog-card h2 {
        font-size: 1.125rem;
    }
}

/* List view specific styles */
.blog-list-view .blog-card {
    display: flex;
    max-width: none;
    margin-bottom: 1.5rem;
}

.blog-list-view .blog-card > div:first-child {
    width: 300px;
    flex-shrink: 0;
}

.blog-list-view .blog-card > div:last-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
}

@media (max-width: 768px) {
    .blog-list-view .blog-card {
        flex-direction: column;
    }
    
    .blog-list-view .blog-card > div:first-child {
        width: 100%;
    }
}

/* Search and filter bar styles */
.search-filter-bar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(229, 231, 235, 0.5);
}

/* View toggle button styles */
.view-toggle-btn {
    transition: all 0.2s ease;
}

.view-toggle-btn:hover {
    transform: scale(1.05);
}

.view-toggle-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Load more button styles */
#loadMoreBtn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#loadMoreBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#loadMoreBtn:hover::before {
    left: 100%;
}

#loadMoreBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}

/* Notification styles */
#notificationContainer {
    pointer-events: none;
}

#notificationContainer > div {
    pointer-events: auto;
}

/* Loading overlay styles */
.loading-overlay {
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.5);
}

/* Empty state styles */
.empty-state {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Text truncation utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Custom focus styles for accessibility */
.blog-card:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Smooth transitions for all interactive elements */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Header sticky behavior */
header {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

/* Modern card shadows */
.blog-card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.blog-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Gradient backgrounds */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Modern button styles */
.modern-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.modern-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

/* Print styles */
@media print {
    .blog-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    .search-filter-bar,
    #loadMoreBtn,
    .view-toggle-btn,
    header,
    footer {
        display: none;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .blog-card {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .blog-card h2 {
        color: #f9fafb;
    }
    
    .blog-card p {
        color: #d1d5db;
    }
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .blog-card {
        margin: 0.5rem 0;
    }
    
    .blog-card .p-6 {
        padding: 0.75rem;
    }
    
    .blog-card h2 {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .blog-card p {
        font-size: 0.875rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .blog-card {
        border: 2px solid #000;
    }
    
    .blog-card:hover {
        border-color: #3b82f6;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
