/* =========================================
   News Index Modern Redesign (v3.1)
   ========================================= */

:root {
    --primary-blue: #2563eb;
    --secondary-blue: #1e40af;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --bg-light: #f9fafb;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    background-color: var(--bg-light);
}

/* --- Hero Section --- */
.news-hero {
    background: linear-gradient(135deg, #111827 0%, #1e3a8a 50%, #2563eb 100%);
    padding: 160px 0 160px; /* Increased padding for more space */
    color: white;
    position: relative;
    margin-bottom: 0;
    overflow: hidden;
}

/* Background Pattern */
.hero-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.3;
    z-index: 1;
}

/* Floating Shapes */
.hero-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: 1;
    animation: floatShape 10s infinite alternate ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: rgba(6, 182, 212, 0.2); /* Cyan */
    top: -50px;
    left: -50px;
    animation-delay: 0s;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: rgba(37, 99, 235, 0.2); /* Blue */
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: rgba(139, 92, 246, 0.25); /* Violet */
    top: 20%;
    right: 15%;
    filter: blur(40px);
    animation: floatShape 8s infinite alternate-reverse ease-in-out;
}

@keyframes floatShape {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 30px); }
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
    backdrop-filter: blur(4px);
    color: #93c5fd;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    margin: 0 auto 40px;
    line-height: 1.6;
    max-width: 640px;
}

/* Search Box */
.hero-search-wrapper {
    margin-bottom: 32px;
}

.hero-search-form {
    display: flex;
    align-items: center;
    background: white;
    padding: 8px;
    border-radius: 50px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    max-width: 560px;
    margin: 0 auto;
    border: 4px solid rgba(255,255,255,0.1);
    transition: transform 0.3s;
}

.hero-search-form:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.2);
}

.search-icon {
    color: #9ca3af;
    font-size: 1.2rem;
    margin-left: 16px;
    margin-right: 12px;
}

.hero-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    color: #1f2937;
    background: transparent;
    padding: 8px 0;
}

.hero-search-input::placeholder {
    color: #9ca3af;
}

.hero-search-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 1rem;
}

.hero-search-btn:hover {
    background: var(--secondary-blue);
}

/* Quick Tags */
.hero-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.hero-tags a {
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.hero-tags a:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* Bottom Wave */
.hero-wave {
    position: absolute;
    bottom: -1px; /* Fix gap */
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 5;
}

.hero-wave svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 80px;
}

/* --- Layout Container --- */
.news-container {
    padding: 60px 0 100px; /* Top padding for separation from hero */
    max-width: 1280px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.layout-grid {
    display: grid;
    grid-template-columns: 1fr 340px; /* Slightly wider sidebar */
    gap: 48px;
    align-items: start;
}

/* --- News Grid (Main Content) --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px; /* Increased gap for cleaner look */
}

/* --- News Card --- */
.news-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(229, 231, 235, 0.4);
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 10px;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--hover-shadow);
    border-color: rgba(37, 99, 235, 0.2);
}

.card-img-wrapper {
    position: relative;
    padding-top: 60%; /* Slightly taller than 16:9 for better balance */
    overflow: hidden;
    background-color: #f3f4f6;
}

.card-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-card:hover .card-img-wrapper img {
    transform: scale(1.08);
}

.category-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-blue);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    z-index: 2;
}

.card-body {
    padding: 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: #9ca3af;
    margin-bottom: 16px;
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-meta i {
    font-size: 0.9em;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 16px;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-title a {
    color: inherit;
    text-decoration: none;
    background: linear-gradient(to right, var(--primary-blue), var(--primary-blue));
    background-size: 0% 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.3s;
    padding-bottom: 2px;
}

.news-card:hover .card-title a {
    background-size: 100% 2px;
    color: var(--primary-blue);
}

.card-summary {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.read-more-link {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
    transition: gap 0.2s;
}

.read-more-link:hover {
    gap: 12px;
}

/* --- Sidebar Widgets --- */
.widget {
    background: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--card-shadow);
    margin-bottom: 32px;
    border: 1px solid rgba(229, 231, 235, 0.5);
}

.widget-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    padding-bottom: 16px;
    border-bottom: 2px solid #f3f4f6;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-blue);
    border-radius: 2px;
}

.hot-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hot-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    group: hover;
}

.rank-badge {
    width: 24px;
    height: 24px;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s;
}

.hot-item:hover .rank-badge {
    background: var(--primary-blue);
    color: white;
}

.rank-1 { background: #fee2e2; color: #ef4444; }
.rank-2 { background: #ffedd5; color: #f97316; }
.rank-3 { background: #fef9c3; color: #eab308; }

.hot-info {
    flex: 1;
}

.hot-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.5;
    display: block;
    margin-bottom: 6px;
    text-decoration: none;
    transition: color 0.2s;
}

.hot-title:hover {
    color: var(--primary-blue);
}

.hot-views {
    font-size: 0.8rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Contact Widget */
.contact-widget {
    background: linear-gradient(145deg, #1e3a8a, #2563eb);
    color: white;
    text-align: center;
    padding: 40px 32px;
    border: none;
}

.contact-inner .icon-wrapper {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 1.75rem;
    backdrop-filter: blur(4px);
}

.contact-widget h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    font-weight: 800;
}

.contact-widget p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 32px;
    line-height: 1.6;
}

.contact-btn {
    display: inline-block;
    background: white;
    color: var(--primary-blue);
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.contact-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    background-color: #f8fafc;
}

/* --- Pagination --- */
.pagination-wrapper {
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 10px;
    padding-left: 0;
    list-style: none;
}

/* Support both generic list and Bootstrap-style classes */
.pagination li a, 
.pagination li span,
.page-item .page-link {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 600;
}

.pagination li.active span,
.page-item.active .page-link {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
    z-index: 1;
}

.pagination li a:hover,
.page-item .page-link:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateY(-2px);
    background-color: white;
}

.pagination li.disabled span,
.page-item.disabled .page-link {
    color: #d1d5db;
    background: #f9fafb;
    border-color: #e5e7eb;
    cursor: not-allowed;
    transform: none;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 80px 0;
    color: #9ca3af;
    background: white;
    border-radius: 20px;
    border: 1px dashed #e5e7eb;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #d1d5db;
}

/* =========================================
   News Detail Page Styles
   ========================================= */

.news-page-wrapper {
    padding: 40px 0;
    background-color: var(--bg-light);
}

.breadcrumb-section {
    background-color: white;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary-blue);
}

.separator {
    font-size: 0.7rem;
}

.main-content-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.news-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 48px;
    margin-top: 40px;
}

.news-main-column {
    background-color: white;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
}

.article-header {
    margin-bottom: 32px;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 24px;
}

.article-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 16px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-icon {
    font-size: 1.1rem;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-main);
    margin-bottom: 32px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

.article-content p {
    margin-bottom: 1.5em;
}

.article-content h2, .article-content h3 {
    margin-top: 2em;
    margin-bottom: 1em;
    color: var(--text-main);
    font-weight: 700;
}

.article-footer {
    border-top: 1px solid #f3f4f6;
    padding-top: 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.share-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.share-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s;
    text-decoration: none;
}

.social-btn:hover {
    background-color: var(--primary-blue);
    color: white;
}

.prev-next-nav {
    display: flex;
    gap: 16px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    background-color: white;
    border: 1px solid #e5e7eb;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.2s;
}

.btn-back:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.news-sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.sidebar-widget {
    background-color: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--card-shadow);
}

.hot-news-widget .widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: none;
    padding-bottom: 0;
}

.hot-news-widget .widget-title::after {
    display: none;
}

.title-line {
    flex: 1;
    height: 1px;
    background-color: #e5e7eb;
    margin-left: 12px;
}

.hot-news-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hot-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.rank-num {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.hot-link {
    text-decoration: none;
    color: var(--text-main);
    flex: 1;
}

.hot-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hot-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
}

/* Contact Widget specific override for sidebar */
.news-sidebar-column .contact-widget {
    padding: 32px;
    background: linear-gradient(145deg, #1e3a8a, #2563eb);
}

.contact-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.contact-card-inner .contact-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.btn-trial {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 50px;
    background-color: rgba(255,255,255,0.1);
    color: white;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    margin-top: 12px;
    font-size: 0.9rem;
}

.btn-trial:hover {
    background-color: rgba(255,255,255,0.2);
}







/* Responsive Styles for News Detail Page */
@media (max-width: 1024px) {
    .layout-grid {
        grid-template-columns: 1fr; /* Stack sidebar below */
        gap: 60px;
    }
    
    .sidebar-column {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .news-layout {
        grid-template-columns: 1fr;
    }

    .news-sidebar-column {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .sidebar-widget {
        flex: 1 1 calc(50% - 16px);
    }
}

@media (max-width: 768px) {
    .news-hero {
        padding: 120px 0 60px; /* Adjust for smaller header/screens */
    }

    .news-grid {
        grid-template-columns: 1fr; /* 1 column on mobile */
    }
    
    .sidebar-column {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }

    .news-container {
        padding-top: 40px;
    }
    
    .card-img-wrapper {
        padding-top: 65%; /* Taller images on mobile */
    }

    .article-title {
        font-size: 1.5rem;
    }

    .article-meta {
        gap: 16px;
        font-size: 0.85rem;
    }

    .article-content {
        font-size: 1rem;
        line-height: 1.7;
    }

    .news-sidebar-column {
        flex-direction: column;
    }

    .sidebar-widget {
        flex: 1 1 100%;
    }
    
    .article-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .prev-next-nav {
        width: 100%;
    }
    
    .btn-back {
        width: 100%;
        justify-content: center;
    }
}
