/* Page Header Section */
.pg-header {
    background-image: url('https://www.dxn2u.com/news/images/Slider-News.jpg');
}

/* News Listing Section */
.news-listing {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 5rem;
    display: flex;
    gap: 2rem;
}

.news-sidebar {
    width: 250px;
    min-width: 250px;
    height: fit-content;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
    padding: 1rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
    border-radius: 4px;
    background-color: #f5f5f5;
    position: relative;
}

.sidebar-item:hover, .sidebar-item.active {
    background-color: #19B5B8;
}

.sidebar-item img {
    width: 20px;
    height: 20px;
    margin-right: 1rem;
}

.sidebar-item span {
    color: #e94724;
    font-size: 0.95rem;
    font-weight: bold;
}

.sidebar-item:hover span, .sidebar-item.active span {
    color: white;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #19B5B8;
    border-radius: 0 2px 2px 0;
}

/* News Grid Styles */
.news-grid {
    flex: 1;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.news-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    transition: transform 0.3s ease;
    flex-basis: calc(50% - 1.5rem);
}

.news-item:hover {
    transform: translateY(-5px);
}

.news-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 105px;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.day-name {
    background: #E74C3C;
    color: white;
    width: 100%;
    text-align: center;
    padding: 7px 0 5px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.day {
    font-size: 3rem;
    font-weight: bold;
    color: #333;
    padding: 10px 0 5px;
}

.month {
    color: #666;
    font-size: 0.9rem;
    padding-bottom: 10px;
    text-transform: uppercase;
}

.news-date + .news-details {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
}

.news-details {
    display: flex;
    gap: 1rem;
    flex: 1;
    align-items: center;
}

.news-details h3 {
    font-size: 1rem;
    color: #333;
    margin: 0;
    line-height: 1.4;
}

.news-flag {
    width: 40px;
    object-fit: cover;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.25));
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Latest News Slider Styles */
.latest-news-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 0 40px;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
}

.slide.active {
    opacity: 1;
    position: relative;
    pointer-events: auto;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: #00b8b8;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.slider-nav:hover {
    background: #009999;
}

.slider-nav.prev {
    left: 0;
}

.slider-nav.next {
    right: 0;
}

/* Ensure news-item in slider maintains its style */
.latest-news-slider .news-item {
    margin: 0 auto;
    max-width: 800px;
} 

/* Image News Slider Styles */
.image-news-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 21/8;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.image-news-slider .slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.image-news-slider .slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.image-news-slider .slide.active {
    opacity: 1;
    z-index: 1;
}

.slide-content {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide-image {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.slide-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.5));
    display: flex;
    align-items: center;
    gap: 20px;
}

.slide-info .news-date {
    background: white;
    min-width: 120px;
}

.slide-info .news-details {
    color: white;
}

.slide-info .news-details h3 {
    color: white;
    font-size: 1.2rem;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: #19B5B8;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.3s ease;
}

.slider-nav:hover {
    background: rgba(0,184,184,1);
}

.slider-nav.prev {
    left: 20px;
}

.slider-nav.next {
    right: 20px;
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 2;
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background: white;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .news-sidebar {
        width: 210px;
        min-width: 210px;
    }

    .news-listing {
        padding: 3rem;
    }

    .news-item {
        flex-basis: calc(50% - 0.75rem);
    }

    .slide-info .news-date {
        min-width: 100px;
    }

    .slide-info .news-date .day-name {
        font-size: 0.7rem;
    }

    .slide-info .news-date .day {
        font-size: 2rem;
    }

    .slide-info .news-date .month {
        font-size: 0.8rem;
    }
}

@media (max-width: 992px) {
    .news-listing {
        flex-direction: column;
        padding: 2rem;
    }

    .news-sidebar {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .news-listing {
        padding: 1.5rem;
    }

    .news-item {
        padding: 1rem;
        gap: 1rem;
    }

    .news-date {
        min-width: 90px;
    }

    .day {
        font-size: 2.5rem;
    }

    .slide-info .news-date {
        flex-direction: row;
    }

    .slide-info .news-date .day-name {
        padding: 9px;
    }

    .slide-info .news-date .day {
        font-size: 1rem;
        padding: 5px 0 5px 7px;
    }

    .slide-info .news-date .month {
        text-wrap: nowrap;
        padding: 9px 8px 7px 6px;
    }

    .news-modal .modal-content {
        width: 95%;
        margin: 30px auto;
    }
}

@media (max-width: 576px) {
    .news-listing {
        padding: 1rem;
    }

    .news-item {
        flex-direction: column;
        text-align: center;
    }

    .news-date {
        min-width: 120px;
        margin: 0 auto;
    }

    .news-date + .news-details {
        align-items: center;
    }

    .slide-info {
        padding: 15px;
    }

    .slide-info .news-details h3 {
        font-size: 1rem;
    }

    .slider-nav {
        width: 35px;
        height: 35px;
    }

    .slider-nav.prev {
        left: 10px;
    }

    .slider-nav.next {
        right: 10px;
    }

    .news-modal .modal-header {
        flex-direction: column;
        text-align: center;
    }

    .news-modal .modal-title {
        font-size: 1.2rem;
    }

    .news-modal .modal-date-range {
        justify-content: center;
        margin-top: 10px;
    }
}

/* Modal Styles */
.news-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
}

.news-modal .modal-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.news-modal .modal-content {
    position: relative;
    background-color: #fff;
    margin: 50px auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: modalFadeIn 0.3s ease-out;
    max-height: 90vh;
    overflow-y: scroll;
}

.news-modal .close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.news-modal .close-modal:hover {
    color: #333;
}

.news-modal .modal-header {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.news-modal .modal-date {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    flex-shrink: 0;
}

.news-modal .modal-title-container {
    display: flex;
    gap: 10px;
    flex: 1;
    flex-direction: column;
    justify-content: center;
}

.news-modal .modal-flag {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.news-modal .modal-title {
    color: #333;
    margin: 0;
    font-size: 1.5rem;
}

.news-modal .modal-body {
    color: #666;
    line-height: 1.6;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Make news titles clickable */
.news-title {
    cursor: pointer;
    transition: color 0.3s ease;
}

.news-title:hover {
    color: #19B5B8;
}

.news-modal .modal-date-range {
    color: #666;
    font-size: 0.9rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-modal .modal-date-range i {
    color: #19B5B8;
}

.news-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.news-date-range {
    color: #666;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.news-date-range i {
    color: #19B5B8;
}

@media (max-width: 576px) {
    .news-text {
        align-items: center;
    }
    
    .news-date-range {
        justify-content: center;
    }
}