/**
 * Blog Page Styles - Simplified & Fast
 */

/* ============================================
   HERO
   ============================================ */
.blog-hero {
    background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
    color: white;
    padding: 120px 0 60px;
    text-align: center;
}

.blog-hero h1 {
    font-size: 3rem;
    color: white;
    margin: 0 0 1rem;
}

.blog-hero .hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* ============================================
   FILTERS
   ============================================ */
.filter-section {
    background: #f8f9fa;
    padding: 1.5rem 0;
    border-bottom: 2px solid #e9ecef;
    position: sticky;
    top: 80px;
    z-index: 100;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.filter-label {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: #0066ff;
    color: #0066ff;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
    border-color: #0066ff;
    color: white;
}

.filter-btn svg {
    flex-shrink: 0;
}

/* Alert filters */
.filter-btn.filter-alert {
    border-color: #ff9800;
    background: #fff8e6;
}

.filter-btn.filter-alert:hover {
    border-color: #d32f2f;
    background: #ffe8e8;
}

.filter-btn.filter-alert.active {
    background: linear-gradient(135deg, #ff9800 0%, #d32f2f 100%);
    border-color: #d32f2f;
}

/* ============================================
   GRID
   ============================================ */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.blog-posts-section {
    padding: 3rem 0;
}

/* ============================================
   CARD - With Image
   ============================================ */
.card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.card-img {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.cat {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e9ecef;
    color: #0066ff;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cat-ai { background: rgba(0, 102, 255, 0.1); color: #0066ff; }
.cat-tech { background: rgba(16, 185, 129, 0.1); color: #059669; }
.cat-marketing { background: rgba(249, 115, 22, 0.1); color: #ea580c; }
.cat-cybersecurity { background: rgba(220, 38, 38, 0.1); color: #dc2626; }
.cat-business { background: rgba(139, 92, 246, 0.1); color: #7c3aed; }
.cat-safety { background: linear-gradient(135deg, #ff9800 0%, #d32f2f 100%); color: white; }
.cat-senior-scams { background: linear-gradient(135deg, #f57c00 0%, #c62828 100%); color: white; }

.date {
    color: #6c757d;
    font-size: 0.85rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #212529;
    margin: 0 0 0.75rem;
    line-height: 1.4;
}

.card-title a {
    color: #212529;
    text-decoration: none;
    transition: color 0.2s;
}

.card-title a:hover {
    color: #0066ff;
}

.card-excerpt {
    color: #6c757d;
    line-height: 1.6;
    margin: 0 0 1rem;
    flex: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.source {
    font-size: 0.85rem;
    color: #6c757d;
}

.read-more {
    color: #0066ff;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: gap 0.2s;
}

.read-more:hover {
    color: #0052cc;
}

/* ============================================
   CARD - Without Image (Title-Focused)
   ============================================ */
.card.no-img {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
}

.card.no-img .card-body {
    padding: 2rem;
}

.card.no-img .card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.card.no-img .card-title.large {
    font-size: 1.75rem;
}

/* Alert cards */
.card.alert {
    border: 3px solid #ff9800;
    background: linear-gradient(135deg, #fff8e6 0%, #ffe8e8 100%);
    box-shadow: 0 4px 20px rgba(255, 152, 0, 0.3);
}

.card.alert:hover {
    border-color: #d32f2f;
    box-shadow: 0 8px 30px rgba(211, 47, 47, 0.4);
}

.card.alert .card-title a {
    color: #d32f2f;
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 0;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e9ecef;
    border-top-color: #0066ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 0;
    color: #6c757d;
}

.empty h3 {
    color: #495057;
    margin: 0 0 0.5rem;
}

.empty p {
    margin: 0;
}

/* ============================================
   LOAD MORE
   ============================================ */
.load-more-container {
    text-align: center;
    margin-top: 3rem;
}

#load-more-btn {
    min-width: 200px;
}

/* ============================================
   SCROLL TO TOP
   ============================================ */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 102, 255, 0.4);
}

/* ============================================
   CTA
   ============================================ */
.blog-cta {
    background: #f8f9fa;
    padding: 4rem 0;
}

.cta-card {
    background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
    color: white;
    padding: 3rem;
    border-radius: 12px;
    text-align: center;
}

.cta-card h2 {
    color: white;
    margin: 0 0 1rem;
}

.cta-card p {
    font-size: 1.1rem;
    margin: 0 0 2rem;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 100px 0 40px;
    }

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

    .filter-section {
        position: static;
    }

    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-buttons {
        width: 100%;
    }

    .filter-btn {
        flex: 1;
        min-width: 0;
        justify-content: center;
    }

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

    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .cta-buttons .button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .filter-btn {
        font-size: 0.85rem;
        padding: 0.625rem 1rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .card.no-img .card-title.large {
        font-size: 1.35rem;
    }
}

/* Spin animation for refresh button */
.spin {
    animation: spin 1s linear infinite;
}
