/* Base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Container and layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Main content layout */
.main-content {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

/* Top content layout */
.top-content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.left-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.right-content {
    width: 380px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    height: fit-content;
    align-self: flex-start;
}

/* Content Grid Layout */
.content-wrapper {
    width: 100%;
    margin: 0;
}

.grid-layout {
    display: grid;
    gap: 20px;
}

/* Grid Layout Variations */
.grid-layout {
    grid-template-columns: 1fr;  /* Default single column */
}

/* Two Column Layout */
.grid-layout:has(.left-column):not(:has(.right-column)),
.grid-layout:has(.right-column):not(:has(.left-column)) {
    grid-template-columns: 300px 1fr;
}

/* Three Column Layout */
.grid-layout:has(.left-column):has(.right-column) {
    grid-template-columns: 250px 1fr 250px;
}

/* Column Styles */
.column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.left-column,
.right-column {
    width: 100%;
}

.main-column {
    min-width: 0;
}

/* Live News Section */
.live-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px;
    margin-bottom: 20px;
    margin-top: 20px;
}

.live-news-carousel {
    position: relative;
    overflow: hidden;
    padding: 0 40px;
}

.live-news-list {
    display: flex;
    transition: transform 0.3s ease;
}

.live-news-item {
    flex: 0 0 calc(25% - 15px);
    margin-right: 20px;
    position: relative;
}

.live-news-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 4px;
}

.live-news-item p {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

.live-carousel-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    z-index: 2;
    pointer-events: none;
}

.live-carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    color: #333;
    font-size: 18px;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.live-prev {
    left: 5px;
}

.live-next {
    right: 5px;
}

.live-carousel-button:hover {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Featured News Section */
.featured-news {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.main-banner-slider {
    position: relative;
}

.main-banner-wrapper {
    overflow: hidden;
}

.main-banner-list {
    display: flex;
    transition: transform 0.3s ease;
}

.main-banner {
    flex: 0 0 100%;
    position: relative;
}

.main-banner img {
    width: 100%;
    height: 450px;
    object-fit: cover;
}

.main-banner h2 {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    font-size: 24px;
    line-height: 1.3;
}

.slider-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.slider-dot.active {
    background: #fff;
    transform: scale(1.2);
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #333;
    font-size: 20px;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.slider-prev {
    left: 20px;
}

.slider-next {
    right: 20px;
}

.slider-arrow:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Most Read Section */
.most-read-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    padding: 0;
    margin: 0;
}

.tab-button {
    flex: 1;
    padding: 15px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    font-size: 14px;
    text-align: center;
    position: relative;
}

.tab-button i {
    margin-right: 6px;
}

.tab-button.active {
    color: #1a73e8;
    background: #fff;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #1a73e8;
}

.tab-content {
    display: none;
    padding: 15px;
    height: 400px;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

.most-read-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.most-read-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.most-read-item a {
    display: flex;
    gap: 15px;
    text-decoration: none;
    color: inherit;
}

.most-read-item img {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
}

.most-read-item h3 {
    font-size: 14px;
    margin-bottom: 5px;
    line-height: 1.4;
    color: #333;
    font-weight: 500;
}

.most-read-item span {
    font-size: 12px;
    color: #666;
    display: block;
}

/* Banner Styles */
.banner-container {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.banner-link {
    display: block;
    width: 100%;
    height: 100%;
}

.banner-image,
.banner-video {
    width: 100%;
    height: auto;
    display: block;
}

/* Fixed height banners */
.top-banner,
.bottom-banner {
    height: 150px;
}

.top-banner .banner-image,
.bottom-banner .banner-image {
    height: 100%;
    object-fit: cover;
}

/* Auto height banners */
.middle-banner,
.most-read-top-banner {
    height: auto;
}

.middle-banner {
    margin: 0;
}

.most-read-top-banner {
    margin-bottom: 20px;
}

/* Video Badge */
.video-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1;
}

.video-badge i {
    margin-right: 4px;
}

/* Custom Scrollbar */
.tab-content::-webkit-scrollbar {
    width: 6px;
}

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

.tab-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.tab-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive Design */
@media (max-width: 1200px) {
    /* Two Column Layout */
    .grid-layout:has(.left-column):not(:has(.right-column)),
    .grid-layout:has(.right-column):not(:has(.left-column)) {
        grid-template-columns: 250px 1fr;
    }

    /* Three Column Layout */
    .grid-layout:has(.left-column):has(.right-column) {
        grid-template-columns: 220px 1fr 220px;
    }
}

@media (max-width: 992px) {
    .grid-layout {
        grid-template-columns: 1fr !important;  /* Force single column on mobile */
    }

    .column {
        width: 100%;
    }

    .live-news-item {
        flex: 0 0 calc(50% - 15px);
    }
    
    .main-banner img {
        height: 300px;
    }

    .main-banner h2 {
        font-size: 18px;
    }

    .tab-content {
        height: 300px;
    }

    .section-content {
        max-height: 400px;
    }

    .top-banner,
    .bottom-banner {
        height: 120px;
    }
}

@media (max-width: 576px) {
    .live-news-item {
        flex: 0 0 calc(100% - 15px);
    }
    
    .main-banner img {
        height: 200px;
    }
    
    .most-read-item img {
        width: 80px;
        height: 60px;
    }

    .main-banner h2 {
        font-size: 16px;
        padding: 15px;
    }

    .slider-arrow {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .slider-prev {
        left: 10px;
    }

    .slider-next {
        right: 10px;
    }

    .top-banner,
    .bottom-banner {
        height: 100px;
    }

    .most-read-top-banner {
        height: 180px;
    }
}

/* Section List Style */
.section-list {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    margin-bottom: 20px;
}

.section-list:last-child {
    margin-bottom: 0;
}

.section-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.section-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin: 0;
}

.section-content {
    padding: 15px;
    max-height: 500px;
    overflow-y: auto;
}

.section-list-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.section-list-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.section-list-item a {
    display: flex;
    gap: 15px;
    text-decoration: none;
    color: inherit;
}

.section-thumbnail {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
}

.section-item-content {
    flex: 1;
    min-width: 0;
}

.section-item-content h3 {
    font-size: 14px;
    margin: 0 0 5px;
    line-height: 1.4;
    color: #333;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-clamp: 2;
}

.section-item-content span {
    font-size: 12px;
    color: #666;
    display: block;
}

/* Custom Scrollbar */
.section-content::-webkit-scrollbar {
    width: 6px;
}

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

.section-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.section-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

@media (max-width: 992px) {
    .section-content {
        max-height: 400px;
    }
}

@media (max-width: 576px) {
    .section-thumbnail {
        width: 80px;
        height: 60px;
    }
    
    .section-item-content h3 {
        font-size: 13px;
    }
}

/* Mixed Layout Styles */
.mixed-layout {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px;
}

.mixed-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.mixed-grid-item {
    position: relative;
}

.mixed-grid-item a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.mixed-grid-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.mixed-grid-content {
    margin-top: 10px;
}

.mixed-grid-title {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 8px;
    color: #333;
}

.mixed-grid-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-clamp: 2;
}

.mixed-grid-meta {
    font-size: 12px;
    color: #888;
}

.mixed-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.mixed-list-item {
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mixed-list-item a {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.mixed-list-thumbnail {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.mixed-list-content {
    flex: 1;
    min-width: 0;
}

.mixed-list-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0 0 5px;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-clamp: 2;
}

.mixed-list-date {
    font-size: 12px;
    color: #888;
    display: block;
}

/* Responsive Design */
@media (max-width: 992px) {
    .mixed-grid {
        grid-template-columns: 1fr;
    }
    
    .mixed-list {
        grid-template-columns: 1fr;
    }
    
    .mixed-grid-image {
        height: 180px;
    }
}

@media (max-width: 576px) {
    .mixed-grid-image {
        height: 160px;
    }
    
    .mixed-list-thumbnail {
        width: 80px;
        height: 60px;
    }
    
    .mixed-grid-title,
    .mixed-list-title {
        font-size: 13px;
    }
}

/* Grid Layout Styles */
.category-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.category-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.category-news-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.category-news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.category-news-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-news-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.category-news-content {
    padding: 15px;
}

.category-news-title {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0 0 10px;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-clamp: 2;
}

.category-news-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-clamp: 2;
}

.category-news-meta {
    font-size: 12px;
    color: #888;
}

/* Grid Layout Responsive */
@media (max-width: 992px) {
    .category-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-news-image {
        height: 160px;
    }
}

@media (max-width: 576px) {
    .category-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .category-news-image {
        height: 200px;
    }
    
    .category-news-title {
        font-size: 15px;
    }
}
