/* News Section Style - Converted from WebMuIntrol */

.news-section {
    padding: 100px 0;
    background-image: url('../images/backgruond.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

.news-section .container {
    max-width: 1700px;
    margin: 0 auto;
    padding: 20px 80px 0px 80px;
}

.news-section .section-title {
    color: #fff;
    text-align: center;
    margin-bottom: 30px;
    font-size: 36px;
}

/* Tab Navigation */
.tab-navigation {
    background: rgb(17, 1, 1);
    border-radius: 8px;
    overflow: hidden;
    border-radius: 10px 15px 0 0;
    box-shadow: 0 -8px 32px rgba(61, 2, 2, 0.6), 0 -8px 32px rgba(61, 2, 2, 0.4);
}

.tab-list {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #424242;
    gap: 1px;
    z-index: 10;
}

.tab-item {
    flex: none;
}

.tab-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px 20px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    background: rgb(17, 1, 1);
    z-index: 1;
    flex-grow: 1;
    user-select: none;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 10px 55px 0 0;
    white-space: nowrap;
}

.tab-button:before {
    position: absolute;
    left: -8px;
    top: 0;
    height: 100%;
    width: calc(100% + 16px);
    background: linear-gradient(1turn, #F18D00, rgba(255,144,0,0) 8.57%), 
                radial-gradient(307.71% 364.11% at 43.77% -252.14%, #3C0000 0, #6F0000 100%), 
                #18181d;
    opacity: 0;
    content: "";
    transition: all 0.3s ease;
    z-index: -1;
    border-radius: 10px 0px 0 0;
}

.tab-button:hover {
    color: #fff;
}

.tab-button:hover:before,
.tab-button.active:before {
    opacity: 1;
}

.tab-button.active {
    color: #fff;
}

/* Content Layout */
.content-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 20px;
    align-items: start;
    background: rgb(17, 1, 1);
    width: 100%;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(39, 2, 2, 0.6), -8px 0 32px rgba(61, 2, 2, 0.4), 8px 0 32px rgba(61, 2, 2, 0.4);
    border-radius: 0px 0px 10px 10px;
}

/* Main Content */
.main-content-news {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0px 0px 10px 10px;
    overflow: hidden;
}

.article-display {
    display: none;
    max-width: 100%;
    overflow: hidden;
}

.article-display.active {
    display: block;
}

.article-header {
    border-bottom: 1px solid #333333;
    padding: 20px;
    padding-bottom: 10px;
}

.article-title {
    font-size: 40px;
    font-weight: 700;
    color: #ffffff;
    margin-top: 20px;
    margin-bottom: 15px;
    line-height: 1.3;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    display: block;
}

.article-meta {
    color: #ffffff;
    font-size: 14px;
    margin-bottom: 15px;
}

.article-content {
    font-size: 16px;
    line-height: 1.6;
    color: #ffffff;
    padding: 10px 20px;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

.article-content * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-content img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* News Table Styles */
.article-content table,
.article-content .news-table {
    width: 100%;
    max-width: 1100px;
    margin: 20px auto;
    border-collapse: collapse;
    font-size: 14px;
    background-color: #ffffff;
    overflow: hidden;
    display: table;
}

.article-content table th,
.article-content .news-table th {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-bottom: 2px solid #1ba6f0;
}

.article-content table td,
.article-content .news-table td {
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    color: #2c3e50;
    vertical-align: top;
}

.article-content table tr:nth-child(even),
.article-content .news-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.article-content table tr:hover,
.article-content .news-table tr:hover {
    background-color: #e8f4fd;
}

.placeholder-message {
    text-align: center;
    color: #ffffff;
    font-style: italic;
    padding: 60px 20px;
    background: rgb(17, 1, 1);
    border-radius: 0px 0px 10px 10px;
}

.placeholder-message h3 {
    margin-bottom: 10px;
    color: #ffffff;
}

/* Sidebar */
.sidebar-news {
    background: rgb(17, 1, 1);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    height: fit-content;
    max-width: 100%;
    overflow: hidden;
    max-height: 800px;
    overflow-y: auto;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #ffffff;
    border-bottom: 2px solid #3d3d3d;
    padding-bottom: 8px;
}

.sidebar-item {
    position: relative;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 5px;
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    border-radius: 8px;
}

.sidebar-item:hover {
    background: rgba(241, 141, 0, 0.1);
}

.sidebar-item.active {
    background: linear-gradient(45deg, rgba(241, 141, 0, 0.2), rgba(255, 107, 0, 0.2));
}

.sidebar-item.active::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    width: 3px;
    height: 60%;
    background: #ffd700;
    box-shadow: 
        0 0 5px rgba(255, 215, 0, 1),
        0 0 10px rgba(255, 215, 0, 1),
        0 0 20px rgba(255, 215, 0, 0.8);
}

.sidebar-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 5px;
    line-height: 1.4;
}

.sidebar-item.active .sidebar-item-title {
    color: #F18D00;
    font-weight: 600;
}

.sidebar-item-date {
    font-size: 12px;
    color: #cccccc;
}

.sidebar-item-preview {
    font-size: 12px;
    color: #999999;
    line-height: 1.4;
    margin-top: 5px;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-item-views {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
}

/* Responsive */
@media (max-width: 1200px) {
    .content-layout {
        grid-template-columns: 2fr 1fr;
    }
}

@media (max-width: 768px) {
    .news-section .container {
        padding: 30px;
    }

    .content-layout {
        grid-template-columns: 1fr;
    }

    .tab-list {
        overflow-x: auto;
    }

    .tab-button {
        padding: 12px 16px;
        font-size: 12px;
    }

    .article-title {
        font-size: 24px;
    }

    .sidebar-news {
        max-height: 400px;
    }
}

/* ============================================
   NEWS GRID LAYOUT MỚI
   ============================================ */

.news-body {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-top: 0;
    background: rgb(17, 1, 1);
    border-radius: 0 0 10px 10px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(39,2,2,0.6), -8px 0 32px rgba(61,2,2,0.4), 8px 0 32px rgba(61,2,2,0.4);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Card */
.news-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
    border-color: #F18D00;
    box-shadow: 0 10px 30px rgba(241,141,0,0.2);
}

.card-thumb {
    width: 100%;
    height: 150px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.card-category-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    color: white;
}

.card-body {
    padding: 14px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-preview {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #888;
}

/* Sidebar mới */
.news-sidebar-right {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.recent-box {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 16px;
}

.recent-title {
    font-size: 14px;
    font-weight: 600;
    color: #F18D00;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.recent-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: opacity 0.2s;
}

.recent-item:hover { opacity: 0.75; }
.recent-item:last-child { border-bottom: none; }

.recent-thumb {
    width: 55px;
    height: 42px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.recent-info { flex: 1; min-width: 0; }

.recent-item-title {
    font-size: 12px;
    color: #ddd;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recent-item-date,
.recent-item-views {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
}

/* Detail View */
.back-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: #aaa;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.2s;
    font-size: 13px;
}

.back-btn:hover {
    color: #fff;
    border-color: #F18D00;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 30px;
    background: rgb(17,1,1);
    border-radius: 0 0 10px 10px;
    padding: 20px;
}

.detail-category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    margin-bottom: 12px;
}

.detail-title {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    line-height: 1.3;
}

.detail-meta-row {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
}

.detail-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 16px 0;
}

.detail-content {
    color: #ccc;
    line-height: 1.8;
    font-size: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .news-body,
    .detail-grid {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .news-sidebar-right {
        display: none;
    }
}
