/* ==================== News Pages CSS ==================== */

/* ==================== Variables ==================== */
:root {
    --news-header-height: 60px;
    --news-primary: #1e88e5;
    --news-primary-dark: #1565c0;
    --desktop-header-height: 120px;
}

/* ==================== Desktop Header Visibility ==================== */
.news-page .desktop-header,
.news-detail-page .desktop-header {
    display: none;
}

@media (min-width: 992px) {
    .news-page .desktop-header,
    .news-detail-page .desktop-header {
        display: block;
    }

    .news-page .news-header,
    .news-detail-page .news-header {
        display: none;
    }

    .news-page .bottom-nav,
    .news-detail-page .bottom-nav {
        display: none;
    }

    .news-page.has-bottom-nav,
    .news-detail-page.has-bottom-nav {
        padding-bottom: 40px;
    }

    .news-page .sidebar,
    .news-detail-page .sidebar,
    .news-page .sidebar-overlay,
    .news-detail-page .sidebar-overlay {
        display: none !important;
    }
}

/* ==================== Desktop Header Styles ==================== */
.desktop-header {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.desktop-header > .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f7fa;
    border-radius: 10px;
    color: var(--news-primary);
    font-size: 1.25rem;
    text-decoration: none;
    transition: all 0.2s;
}

.header-back-btn:hover {
    background: #e3f2fd;
    color: var(--news-primary-dark);
    transform: translateX(-2px);
}

.header-brand-section .brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.header-brand-section .brand-logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.header-brand-section .brand-text {
    display: flex;
    flex-direction: column;
}

.header-brand-section .brand-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--news-primary-dark);
}

.header-brand-section .brand-name-en {
    font-size: 0.75rem;
    color: #6c757d;
}

.header-user-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-console-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--news-primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.header-console-btn:hover {
    background: var(--news-primary-dark);
    color: white;
}

.header-login-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--news-primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.header-login-btn:hover {
    background: var(--news-primary-dark);
    color: white;
}

.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f5f7fa;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-menu-toggle:hover {
    background: #e3f2fd;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    background: var(--news-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1001;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    background: var(--news-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
}

.dropdown-user-info {
    display: flex;
    flex-direction: column;
}

.dropdown-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
}

.dropdown-user-username {
    font-size: 0.75rem;
    color: #6c757d;
}

.user-dropdown-divider {
    height: 1px;
    background: #e9ecef;
    margin: 4px 8px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.user-dropdown-item:hover {
    background: #f5f7fa;
}

.user-dropdown-item.text-danger {
    color: #e53935;
}

.user-dropdown-item.text-danger:hover {
    background: #ffebee;
}

/* ==================== Desktop Navbar (Navigation Bar) ==================== */
.desktop-navbar {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
}

.desktop-navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.desktop-navbar .navbar-container {
    display: flex;
    align-items: center;
    gap: 0;
}

/* Desktop Navbar Item Link */
.navbar-item-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.navbar-item-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    border-bottom-color: white;
}

/* Navbar Dropdown */
.navbar-dropdown {
    position: relative;
}

.navbar-dropdown .navbar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    cursor: pointer;
}

.navbar-dropdown .navbar-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.navbar-dropdown .navbar-item i.bi-chevron-down {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.navbar-dropdown:hover .navbar-item i.bi-chevron-down {
    transform: rotate(180deg);
}

/* Dropdown Panel */
.dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.navbar-dropdown:hover .dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.panel-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 16px;
    gap: 24px;
}

.panel-section {
    min-width: 0;
}

.panel-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding: 0 8px;
}

.panel-link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 8px;
    color: inherit;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}

.panel-link:hover {
    background: #f5f7fa;
}

.panel-link i {
    font-size: 1.25rem;
    color: var(--news-primary);
    margin-top: 2px;
}

.panel-link div {
    display: flex;
    flex-direction: column;
}

.panel-link span {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a1a1a;
}

.panel-link small {
    font-size: 0.75rem;
    color: #9e9e9e;
}

/* Navbar Search */
.navbar-search {
    display: flex;
    align-items: center;
    margin-left: auto;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    overflow: hidden;
}

.navbar-search .search-input {
    width: 200px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: white;
    font-size: 0.85rem;
    font-family: 'Prompt', sans-serif;
    outline: none;
}

.navbar-search .search-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.navbar-search .search-btn {
    padding: 8px 12px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.navbar-search .search-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* ==================== News Page Layout ==================== */
.news-page,
.news-detail-page {
    background: #f5f7fa;
    min-height: 100vh;
    padding-bottom: 40px;
}

.news-page.has-bottom-nav,
.news-detail-page.has-bottom-nav {
    padding-bottom: calc(var(--bottom-nav-height, 65px) + 20px);
}

/* ==================== News Header ==================== */
.news-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.news-header .container {
    max-width: 1200px;
}

.news-header .header-content {
    display: flex;
    align-items: center;
    height: var(--news-header-height);
    gap: 12px;
}

.header-back,
.header-menu-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--news-primary);
    font-size: 1.25rem;
    border-radius: 50%;
    transition: background 0.2s;
    border: none;
    background: none;
    cursor: pointer;
    text-decoration: none;
}

.header-back:hover,
.header-menu-toggle:hover {
    background: #e3f2fd;
    color: var(--news-primary-dark);
}

.header-brand {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.header-title {
    display: flex;
    flex-direction: column;
}

.header-title .title-main {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.2;
}

.header-title .title-sub {
    font-size: 0.75rem;
    color: #6c757d;
    line-height: 1.2;
}

.header-search-toggle,
.header-share {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.25rem;
    border: none;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.header-search-toggle:hover,
.header-share:hover {
    background: #e3f2fd;
    color: var(--news-primary);
}

/* ==================== Search & Filter Bar ==================== */
.search-filter-bar {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 12px 0;
}

.search-filter-bar .container {
    max-width: 1200px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f7fa;
    border-radius: 12px;
    padding: 0 16px;
    margin-bottom: 12px;
}

.search-box i {
    color: #9e9e9e;
    font-size: 1rem;
}

.search-box input {
    flex: 1;
    border: none;
    background: none;
    padding: 12px;
    font-size: 0.95rem;
    font-family: 'Prompt', sans-serif;
    outline: none;
}

.search-box input::placeholder {
    color: #9e9e9e;
}

.search-clear {
    border: none;
    background: none;
    color: #9e9e9e;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear:hover {
    color: #e53935;
}

/* Filter Chips */
.filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #f5f7fa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #616161;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Prompt', sans-serif;
}

.filter-chip:hover {
    background: #e3f2fd;
    border-color: var(--news-primary);
    color: var(--news-primary);
}

.filter-chip.active {
    background: var(--news-primary);
    border-color: var(--news-primary);
    color: white;
}

/* ==================== News Main Content ==================== */
.news-main {
    padding-top: 20px;
}

.news-main .container {
    max-width: 1200px;
}

/* Results Info */
.results-info {
    margin-bottom: 16px;
    padding: 0 4px;
}

.results-count {
    font-size: 0.9rem;
    color: #6c757d;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

@media (max-width: 576px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* News Card Item */
.news-card-item {
    display: block;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    animation: fadeInUp 0.4s ease-out both;
    text-decoration: none;
    color: inherit;
}

.news-card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    text-decoration: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card-image {
    position: relative;
    height: 160px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-card-image .news-icon {
    font-size: 3rem;
    color: rgba(255,255,255,0.5);
}

.news-pinned {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: rgba(255, 193, 7, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.news-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(4px);
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
}

.news-card-body {
    padding: 16px;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.news-date,
.news-views {
    font-size: 0.75rem;
    color: #9e9e9e;
    display: flex;
    align-items: center;
}

.news-card-item .news-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-item .news-excerpt {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0 0 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    font-size: 0.85rem;
    color: var(--news-primary);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.news-card-item:hover .read-more {
    text-decoration: underline;
}

/* ==================== Loading & States ==================== */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 12px;
    color: #6c757d;
}

.load-more-container {
    display: flex;
    justify-content: center;
    padding: 32px 0;
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    padding: 12px 32px;
    background: var(--news-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Prompt', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-load-more:hover {
    background: var(--news-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3);
}

.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.no-results i {
    font-size: 4rem;
    color: #e0e0e0;
    margin-bottom: 16px;
}

.no-results h5 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #424242;
    margin-bottom: 8px;
}

.no-results p {
    font-size: 0.95rem;
    color: #9e9e9e;
    margin-bottom: 20px;
}

.end-results {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px;
    color: #9e9e9e;
    font-size: 0.9rem;
}

.end-results i {
    color: #43a047;
}

/* ==================== Scroll to Top ==================== */
.scroll-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--news-primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-top-btn:hover {
    background: var(--news-primary-dark);
    transform: translateY(-2px);
}

.has-bottom-nav .scroll-top-btn {
    bottom: calc(var(--bottom-nav-height, 65px) + 16px);
}

/* ==================== News Detail Page ==================== */
.news-featured-image {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.news-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
}

.news-featured-placeholder {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-featured-placeholder i {
    font-size: 4rem;
    color: rgba(255,255,255,0.4);
}

@media (min-width: 768px) {
    .news-featured-image {
        height: 400px;
    }
    .news-featured-placeholder {
        height: 280px;
    }
}

/* Article */
.news-article {
    background: white;
    border-radius: 16px 16px 0 0;
    margin-top: -24px;
    position: relative;
    padding: 24px;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
    .news-article {
        max-width: 800px;
        margin: -48px auto 0;
        border-radius: 16px;
    }
}

.article-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.article-type {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
}

.article-pinned {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #fff8e1;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #f57f17;
}

.article-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.4;
    margin: 0 0 16px;
}

@media (min-width: 768px) {
    .article-title {
        font-size: 1.75rem;
    }
}

.article-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #6c757d;
}

.info-item i {
    color: #9e9e9e;
}

/* Article Content */
.article-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #1a1a1a;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content a {
    color: var(--news-primary);
    text-decoration: underline;
}

.article-content blockquote {
    border-left: 4px solid var(--news-primary);
    padding-left: 16px;
    margin: 1rem 0;
    font-style: italic;
    color: #555;
}

/* Attachments */
.article-attachments {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e9ecef;
}

.article-attachments h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f5f7fa;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.attachment-item:hover {
    background: #e3f2fd;
    transform: translateX(4px);
}

.attachment-icon {
    font-size: 1.75rem;
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-size {
    display: block;
    font-size: 0.75rem;
    color: #9e9e9e;
}

.attachment-download {
    color: var(--news-primary);
    font-size: 1.25rem;
}

/* Share */
.article-share {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.share-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #6c757d;
}

.share-buttons {
    display: flex;
    gap: 8px;
}

.share-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.1rem;
    color: white;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.share-btn:hover {
    transform: scale(1.1);
}

.share-facebook {
    background: #1877f2;
}

.share-twitter {
    background: #1da1f2;
}

.share-line {
    background: #00b900;
}

.share-copy {
    background: #6c757d;
}

/* Related News */
.related-news {
    margin-top: 40px;
}

.related-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

@media (min-width: 992px) {
    .related-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 576px) {
    .related-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

.related-card {
    display: block;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.related-image {
    height: 100px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-image i {
    font-size: 2rem;
    color: rgba(255,255,255,0.5);
}

.related-body {
    padding: 12px;
}

.related-date {
    font-size: 0.7rem;
    color: #9e9e9e;
}

.related-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 4px 0 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Back to List */
.back-to-list {
    margin-top: 40px;
    text-align: center;
    padding-bottom: 40px;
}

/* Not Found */
.not-found-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.not-found-icon {
    width: 100px;
    height: 100px;
    background: #f5f7fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.not-found-icon i {
    font-size: 3rem;
    color: #bdbdbd;
}

.not-found-container h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.not-found-container p {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 24px;
}

/* ==================== Mobile Responsiveness ==================== */
@media (max-width: 576px) {
    .news-header .header-content {
        gap: 8px;
    }

    .header-title .title-main {
        font-size: 0.9rem;
    }

    .header-title .title-sub {
        font-size: 0.7rem;
    }

    .search-filter-bar {
        padding: 10px 0;
    }

    .search-box {
        padding: 0 12px;
    }

    .search-box input {
        padding: 10px;
        font-size: 0.9rem;
    }

    .filter-chip {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .news-article {
        padding: 20px 16px;
    }

    .article-title {
        font-size: 1.25rem;
    }

    .article-info {
        gap: 12px;
    }

    .info-item {
        font-size: 0.8rem;
    }

    .article-content {
        font-size: 0.95rem;
    }
}

/* ==================== Image Gallery ==================== */
.attachment-images {
    margin-bottom: 24px;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

@media (min-width: 768px) {
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f7fa;
    aspect-ratio: 4/3;
    cursor: pointer;
}

.gallery-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-thumbnail {
    transform: scale(1.05);
}

.gallery-download {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.2s;
    text-decoration: none;
}

.gallery-item:hover .gallery-download {
    opacity: 1;
}

.gallery-download:hover {
    background: var(--news-primary);
    color: white;
}

/* ==================== Lightbox ==================== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 16px;
}

.lightbox-next {
    right: 16px;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: calc(85vh - 60px);
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-caption {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    text-align: center;
    max-width: 80%;
    word-break: break-word;
}

.lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 16px;
    border-radius: 20px;
}

/* Mobile lightbox adjustments */
@media (max-width: 768px) {
    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }

    .lightbox-caption {
        font-size: 0.8rem;
        padding: 0 16px;
    }
}

/* ==================== PDF Preview ==================== */
.attachment-pdfs {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.pdf-preview-container {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.pdf-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.pdf-header i {
    font-size: 1.5rem;
}

.pdf-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a1a1a;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-size {
    font-size: 0.8rem;
    color: #6c757d;
}

.pdf-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.pdf-actions .btn {
    font-size: 0.8rem;
    padding: 6px 12px;
}

.pdf-embed {
    width: 100%;
    max-height: 600px;
    background: #f0f0f0;
    overflow-y: auto;
    overflow-x: hidden;
}

.pdf-scroll-container {
    scrollbar-width: thin;
    scrollbar-color: #888 #f0f0f0;
}

.pdf-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.pdf-scroll-container::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.pdf-scroll-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.pdf-pages-container {
    display: none;
    padding: 10px;
}

.pdf-page-wrapper {
    margin-bottom: 16px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.pdf-page-number {
    background: #f8f9fa;
    padding: 6px 12px;
    font-size: 0.75rem;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
}

.pdf-page-canvas {
    display: block;
    width: 100%;
    height: auto;
}

.pdf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6c757d;
}

.pdf-loading p {
    margin-top: 12px;
    font-size: 0.9rem;
}

.pdf-page-info {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Fullscreen PDF Scroll */
.pdf-fullscreen-scroll {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
}

.pdf-fullscreen-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-bottom: 40px;
}

.pdf-fullscreen-page {
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border-radius: 4px;
    overflow: hidden;
}

.pdf-fullscreen-page-num {
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 16px;
    font-size: 0.85rem;
    text-align: center;
}

.pdf-fullscreen-canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Mobile PDF adjustments */
@media (max-width: 768px) {
    .pdf-header {
        padding: 10px 12px;
    }

    .pdf-name {
        flex: 100%;
        order: 2;
        margin-top: 4px;
    }

    .pdf-size {
        order: 1;
        margin-left: auto;
    }

    .pdf-actions {
        order: 3;
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
    }

    .pdf-actions .btn {
        flex: 1;
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    .pdf-embed {
        max-height: 450px;
    }

    .pdf-page-info {
        display: none;
    }
}

/* ==================== PDF Viewer Modal ==================== */
.pdf-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.pdf-viewer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.pdf-viewer-container {
    width: 95vw;
    height: 95vh;
    max-width: 1200px;
    background: #2d2d2d;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pdf-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #1a1a1a;
    color: white;
}

.pdf-viewer-title {
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 16px;
}

.pdf-viewer-actions {
    display: flex;
    gap: 8px;
}

.pdf-viewer-body {
    flex: 1;
    background: #525659;
    overflow: hidden;
    position: relative;
}

.pdf-viewer-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Mobile PDF viewer adjustments */
@media (max-width: 768px) {
    .pdf-viewer-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .pdf-viewer-header {
        padding: 10px 12px;
    }

    .pdf-viewer-title {
        font-size: 0.85rem;
    }

    .pdf-viewer-actions .btn span {
        display: none;
    }
}


/* Filter chips horizontal scroll on small screens */
@media (max-width: 991.98px) {
    .search-filter-bar .container {
        padding-left: 0;
        padding-right: 0;
    }

    .filter-chips {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px 16px;
        gap: 8px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .filter-chips::-webkit-scrollbar {
        display: none;
    }

    .filter-chip {
        flex-shrink: 0;
        white-space: nowrap;
    }
}
