/* Insights & Updates Professional Styling */

/* Base Layout - FORCE WHITE BACKGROUND AND DARK TEXT */
body {
    background-color: #ffffff !important;
    color: #2c3e50 !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* UNIVERSAL TEXT VISIBILITY FIX */
* {
    color: #2c3e50 !important;
}

h1, h2, h3, h4, h5, h6 {
    color: #2c3e50 !important;
}

p, div, span, a {
    color: #495057 !important;
}

.text-muted {
    color: #6c757d !important;
}

/* Header Section */
.insights-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    padding: 6rem 0 4rem 0;
    margin-top: 2rem;
    margin-bottom: 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.insights-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.insights-header h1 {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
}

.insights-header p {
    font-size: 1.3rem;
    color: rgba(255,255,255,0.9);
    max-width: 800px;
    margin: 1rem auto 0;
    position: relative;
    z-index: 2;
}

/* Main Container */
.main-container {
    background-color: #ffffff;
    min-height: 100vh;
    padding: 3rem 0;
    position: relative;
}

/* Cards */
.card {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

/* Compact card body spacing - OVERRIDDEN BY ARTICLE-SPECIFIC RULES BELOW */
.card-body {
    padding: 0.75rem 1.25rem 1rem 1.25rem;
}

/* ABSOLUTE NUCLEAR OPTION - ELIMINATE ALL SPACING */
.card-img-top {
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: none !important;
    display: block !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    vertical-align: bottom !important;
}

/* Completely eliminate any gap - target every possible element */
.card .card-img-top + * {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
}

.card-body {
    margin: 0 !important;
    padding: 0 !important;
}

/* Article cards get special ultra-compact treatment */
.article-item.card {
    padding: 0 !important;
    margin-bottom: 1.5rem !important;
}

.article-item.card .card-body {
    padding: 0.25rem 1rem 1rem 1rem !important;
    margin: 0 !important;
}

.article-item .card-img-top {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
}

/* Title flush against image */
.article-item .article-title {
    margin: 0 !important;
    padding: 0.25rem 0 0.5rem 0 !important;
    line-height: 1.2 !important;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #3498db;
}

.card-title {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.card-text {
    color: #495057;
    font-size: 1rem;
    line-height: 1.6;
}

/* Featured Articles */
.featured-article {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    border: none;
}

.featured-article .card-body {
    position: relative;
    z-index: 2;
    padding: 2rem;
}

.featured-article .card-title,
.featured-article .card-text {
    color: white;
}

.featured-article .badge {
    background-color: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

/* Category Badges */
.category-badge {
    background-color: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    margin: 0.25rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category-badge:hover {
    background-color: #2980b9;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

/* Popular Tags */
.popular-tags .badge {
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #dee2e6;
    margin: 0.25rem;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
}

.popular-tags .badge:hover {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* Statistics Cards */
.stats-card {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    border: none;
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.stats-card p {
    color: rgba(255,255,255,0.9);
    margin-bottom: 0;
    font-size: 1rem;
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}

.newsletter-section h3 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 1rem;
}

.newsletter-section p {
    color: #495057;
    margin-bottom: 1.5rem;
}

.newsletter-form .form-control {
    border-radius: 25px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
}

.newsletter-form .form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.newsletter-form .btn {
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    background-color: #3498db;
    border-color: #3498db;
}

.newsletter-form .btn:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-2px);
}

/* Article List */
.article-item {
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.article-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.article-meta {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.article-title {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    text-decoration: none;
}

.article-title:hover {
    color: #3498db;
    text-decoration: none;
}

.article-summary {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.read-more-btn {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    background-color: #2980b9;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .insights-header h1 {
        font-size: 2rem;
    }
    
    .insights-header p {
        font-size: 1.1rem;
    }
    
    .main-container {
        padding: 1.5rem 0;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .stats-card h3 {
        font-size: 2rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e9ecef;
    }
    
    .main-container {
        background-color: #212529;
    }
    
    .card {
        background-color: #2c3e50;
        border-color: #495057;
        color: #e9ecef;
    }
    
    .card-title {
        color: #e9ecef;
    }
    
    .card-text {
        color: #ced4da;
    }
    
    .article-item {
        background-color: #2c3e50;
        border-color: #495057;
    }
    
    .newsletter-section {
        background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    }
    
    .newsletter-section h3 {
        color: #e9ecef;
    }
    
    .newsletter-section p {
        color: #ced4da;
    }
}