/* Combined News & Research page styles */

/* Filter visibility control */
.filters-hidden {
    display: none !important;
}

.combined-header {
    background: linear-gradient(135deg, #004c97 0%, #00355d 100%);
    color: white;
}

.combined-filters {
    border-bottom: 1px solid #dee2e6;
}

.combined-filters .input-group-text {
    background-color: #f8f9fa;
    border-color: #ced4da;
}

.combined-articles {
    min-height: 60vh;
}

.combined-card {
    transition: transform 0.2s ease-in-out;
}

.combined-card:hover {
    transform: translateY(-5px);
}

.combined-article-card {
    border: 1px solid #e3e6f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.combined-article-card:hover {
    border-color: #5a67d8;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* External article specific styling */
.combined-article-card.external-article:hover {
    border-color: #28a745;
    box-shadow: 0 0.5rem 1rem rgba(40, 167, 69, 0.15);
}

/* External link indicator */
.external-link-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: all 0.3s ease;
}

.combined-article-card.external-article:hover .external-link-indicator {
    opacity: 1;
    transform: scale(1.1);
}

.card-title {
    color: #2d3748;
    font-weight: 600;
    line-height: 1.4;
}

.card-text {
    font-size: 0.95rem;
    line-height: 1.5;
}

.badge {
    font-size: 0.75rem;
}

/* Button styling */
.read-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-1px);
}

.external-link-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.external-link-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-1px);
}

/* Category-specific styling */
.combined-card[data-category="research"] .card-title {
    border-left: 4px solid #007bff;
    padding-left: 0.5rem;
}

.combined-card[data-category="health-policy"] .card-title {
    border-left: 4px solid #dc3545;
    padding-left: 0.5rem;
}

.combined-card[data-category="precision-medicine"] .card-title {
    border-left: 4px solid #6f42c1;
    padding-left: 0.5rem;
}

.combined-card[data-category="community-health"] .card-title {
    border-left: 4px solid #fd7e14;
    padding-left: 0.5rem;
}

.combined-card[data-category="technology"] .card-title {
    border-left: 4px solid #20c997;
    padding-left: 0.5rem;
}

.combined-card[data-category="updates"] .card-title {
    border-left: 4px solid #17a2b8;
    padding-left: 0.5rem;
}

.combined-card[data-category="news"] .card-title {
    border-left: 4px solid #ffc107;
    padding-left: 0.5rem;
}

.combined-card[data-category="health"] .card-title {
    border-left: 4px solid #28a745;
    padding-left: 0.5rem;
}

/* Source indicator styling */
.combined-card .fas.fa-globe {
    color: #28a745;
}

.combined-card .fas.fa-user {
    color: #5a67d8;
}

/* Loading states */
#loadingState .spinner-border {
    width: 3rem;
    height: 3rem;
}

#errorState i,
#noResultsState i {
    opacity: 0.6;
}

#loadingState,
#errorState,
#noResultsState {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Modal customizations */
.modal-dialog {
    max-width: 800px;
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #2d3748;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    color: #1a202c;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

/* Search and filter styling */
.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Featured badge styling */
.badge.bg-warning {
    background: linear-gradient(45deg, #ffd700, #ffed4e) !important;
    color: #744210 !important;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
}

/* Tags styling */
.combined-card .badge.bg-light {
    background-color: #f7fafc !important;
    color: #4a5568 !important;
    border: 1px solid #e2e8f0;
    font-weight: 500;
}

/* External articles get green-tinted tags */
.combined-card.external-article .badge.bg-light {
    background-color: #e8f5e8 !important;
    color: #2d5016 !important;
    border: 1px solid #c3e6cb;
}

/* Type indicator */
.type-indicator {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.combined-article-card:hover .type-indicator {
    opacity: 1;
}

.combined-card[data-type="external"] .type-indicator {
    background: rgba(40, 167, 69, 0.9);
}

.combined-card[data-type="popup"] .type-indicator {
    background: rgba(90, 103, 216, 0.9);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .combined-header h1 {
        font-size: 2rem;
    }
    
    .combined-header .lead {
        font-size: 1rem;
    }
    
    .combined-filters .row > div {
        margin-bottom: 1rem;
    }
    
    .combined-card {
        margin-bottom: 1.5rem;
    }
    
    .external-link-indicator {
        opacity: 1;
        top: 5px;
        right: 5px;
        width: 25px;
        height: 25px;
        font-size: 10px;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        max-height: 60vh;
    }
}

/* Print styles */
@media print {
    .combined-filters,
    .modal-footer,
    .read-more-btn,
    .external-link-btn {
        display: none !important;
    }
    
    .combined-article-card {
        break-inside: avoid;
        border: 1px solid #ddd;
        margin-bottom: 1rem;
    }
    
    .combined-article-card.external-article::after {
        content: "Source: " attr(data-url);
        display: block;
        font-size: 0.8rem;
        color: #666;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #eee;
    }
}

/* Accessibility improvements */
.read-more-btn:focus,
.external-link-btn:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.form-control:focus,
.form-select:focus {
    outline: none;
}

.combined-article-card:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Animation for article loading */
.combined-card {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

.combined-card:nth-child(1) { animation-delay: 0.1s; }
.combined-card:nth-child(2) { animation-delay: 0.2s; }
.combined-card:nth-child(3) { animation-delay: 0.3s; }
.combined-card:nth-child(4) { animation-delay: 0.4s; }
.combined-card:nth-child(5) { animation-delay: 0.5s; }
.combined-card:nth-child(6) { animation-delay: 0.6s; }

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .combined-article-card {
        border-width: 2px;
    }
    
    .external-link-indicator {
        background: #000;
        color: #fff;
    }
    
    .external-link-btn,
    .read-more-btn {
        background: #000 !important;
        color: #fff !important;
    }
}

/* Filter section enhancements */
.combined-filters .form-select,
.combined-filters .form-control {
    background-color: #fff;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.combined-filters .form-select:focus,
.combined-filters .form-control:focus {
    background-color: #fff;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Dropdown navigation styling */
.navbar .dropdown-menu {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.navbar .dropdown-item {
    color: #2d3748;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.navbar .dropdown-item:hover {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.navbar .dropdown-item.active {
    background-color: #667eea;
    color: white;
}