/* News Page Styles - Following RSS Feed Design */

.news-section {
    height: 100vh;
    padding: 0;
    overflow: hidden;
    margin-top: 0;
}

.news-section .container {
    height: 100%;
    overflow: hidden;
}

.news-section .row {
    height: 100%;
    margin: 0;
    align-items: stretch;
}

.news-section .col-lg-8 {
    height: 100vh;
    overflow: hidden;
    padding: 0;
    padding-right: 0 !important;
}

.news-section .container {
    padding-right: 0 !important;
}

.news-section .row {
    margin-right: 0 !important;
}

.news-section .col-lg-4 {
    height: 100vh;
    overflow: hidden;
    padding: 0;
}

/* Prevent body scroll - only main content scrolls */
body.news-page {
    overflow: hidden;
    height: 100vh;
}

/* Main Content Area - Scrollable */
.news-main-content {
    height: 100vh;
    overflow-y: scroll; /* Changed from auto to scroll to always show scrollbar */
    overflow-x: hidden;
    padding: 2rem;
    padding-right: 0; /* Remove right padding so scrollbar is at page edge */
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(11, 130, 96, 0.4) rgba(11, 130, 96, 0.1);
}

/* Custom scrollbar for main content - positioned at page edge */
.news-main-content::-webkit-scrollbar {
    width: 10px;
}

.news-main-content::-webkit-scrollbar-track {
    background: rgba(11, 130, 96, 0.08);
    border-radius: 10px;
}

.news-main-content::-webkit-scrollbar-thumb {
    background-color: rgba(11, 130, 96, 0.4);
    border-radius: 10px;
}

.news-main-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(11, 130, 96, 0.6);
}

/* News Page Header */
.news-page-header {
    margin-bottom: 2rem;
}

.news-page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.news-page-description {
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* Filter Bar - Improved Design */
.news-filter-bar {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    margin-bottom: 2rem;
}

.news-filter-bar .row {
    align-items: center;
}

.news-filter-bar .form-control {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    background: #f9fafb;
    transition: all 0.3s ease;
    height: auto;
}

.news-filter-bar .form-control:focus {
    border-color: #0b8260;
    box-shadow: 0 0 0 4px rgba(11, 130, 96, 0.1);
    outline: none;
    background: #ffffff;
}

.news-filter-bar .form-control::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.news-filter-bar .form-select {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    background: #f9fafb;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
    padding-right: 2.5rem;
}

.news-filter-bar .form-select:focus {
    border-color: #0b8260;
    box-shadow: 0 0 0 4px rgba(11, 130, 96, 0.1);
    outline: none;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%230b8260' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
}

.news-filter-bar .form-select:hover {
    border-color: #cbd5e1;
    background-color: #ffffff;
}

/* Filter label styling */
.news-filter-bar label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

/* Clear filters button */
#clearFiltersBtn {
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#clearFiltersBtn:hover {
    border-color: #dc2626;
    background: #fee2e2;
    color: #dc2626;
    transform: scale(1.05);
}

#clearFiltersBtn:active {
    transform: scale(0.95);
}

/* Responsive filter bar */
@media (max-width: 991.98px) {
    .news-filter-bar {
        padding: 1rem;
    }
    
    .news-filter-bar .col-md-5,
    .news-filter-bar .col-md-2,
    .news-filter-bar .col-md-1 {
        margin-bottom: 0.75rem;
    }
    
    .news-filter-bar label {
        font-size: 0.75rem;
    }
}

/* News Articles List */
.news-articles-list {
    transition: opacity 0.3s ease;
}

.news-article-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.news-article-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.news-article-image-wrapper {
    width: 100%;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-article-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-article-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #9ca3af;
}

.news-article-image-placeholder .material-symbols-outlined {
    font-size: 48px;
}

.news-article-content {
    padding-left: 0;
}

@media (min-width: 768px) {
    .news-article-content {
        padding-left: 1rem;
    }
}

.news-article-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
    flex-wrap: wrap;
}

.news-article-source {
    color: #0b8260;
    font-weight: 600;
}

.news-article-separator {
    color: #d1d5db;
}

.news-article-author {
    color: #6b7280;
}

.news-article-date {
    color: #9ca3af;
}

.news-article-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.news-article-title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-article-title a:hover {
    color: #0b8260;
}

.news-article-description {
    font-size: 0.9375rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.news-article-read-more {
    color: #0b8260;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease;
}

.news-article-read-more:hover {
    color: #1d4ed8;
}

/* Loading Indicator - Smooth infinite scroll and filtering */
.news-loading-indicator {
    margin: 2rem 0;
    padding: 1.5rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
    position: relative;
}

.news-loading-indicator[style*="display: block"],
.news-loading-indicator.show {
    opacity: 1;
    transform: translateY(0);
    display: block !important;
}

.news-loading-indicator .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 0.25rem;
    border-top-color: #0b8260;
    border-right-color: #0b8260;
    border-bottom-color: transparent;
    border-left-color: transparent;
    animation: spin 0.75s linear infinite;
}

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

.news-loading-indicator p {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* Sidebar Styles */
.news-sidebar-wrapper {
    height: 100vh;
    overflow: hidden;
    padding: 2rem 1rem 2rem 2rem;
    box-sizing: border-box;
}

.news-sidebar {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar for sidebar */
.news-sidebar::-webkit-scrollbar {
    width: 6px;
}

.news-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.news-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.news-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.news-sidebar-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.news-sidebar-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.news-sidebar-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.news-sidebar-card-menu {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-sidebar-card-menu:hover {
    color: #1f2937;
}

.news-sidebar-card-link {
    color: #0b8260;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.news-sidebar-card-link:hover {
    text-decoration: underline;
}

/* RSS List */
.news-sidebar-rss-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-sidebar-rss-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.news-sidebar-rss-item:hover {
    background: #f9fafb;
}

.news-sidebar-rss-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.news-sidebar-rss-icon .material-symbols-outlined {
    font-size: 24px;
}

.news-sidebar-rss-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #0b8260;
    color: #ffffff;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.news-sidebar-rss-info {
    flex: 1;
    min-width: 0;
}

.news-sidebar-rss-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.news-sidebar-rss-meta {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Most Liked News */
.news-sidebar-liked-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-sidebar-liked-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.news-sidebar-liked-item:hover {
    background: #f9fafb;
}

.news-sidebar-liked-image {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f3f4f6;
}

.news-sidebar-liked-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-sidebar-liked-content {
    flex: 1;
    min-width: 0;
}

.news-sidebar-liked-meta {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.news-sidebar-liked-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .news-page-title {
        font-size: 2rem;
    }
    
    .news-sidebar {
        position: relative;
        top: 0;
        right: auto;
        width: 100%;
        max-width: 100%;
        max-height: none;
        margin-top: 2rem;
        overflow: visible;
    }
    
    .news-article-content {
        padding-left: 0;
        margin-top: 1rem;
    }
}

@media (max-width: 575.98px) {
    .news-page-title {
        font-size: 1.75rem;
    }
    
    .news-filter-bar .row > div {
        margin-bottom: 0.75rem;
    }
    
    .news-article-item {
        padding: 1rem;
    }
}

