/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex; cursor: pointer;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo h1 {
    color: #3a86ff;
    font-size: 1.8rem;
}

.logo p {
    font-size: 0.9rem;
    color: #666;
}

nav ul {
    display: flex; cursor: pointer;
    list-style: none;
}

nav ul li {
    margin-left: 25px;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #3a86ff;
}

/* Ad Banner Styles */
.ad-banner {
    text-align: center;
    padding: 15px;
    background-color: #fff;
    margin: 20px auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.ad-banner.top-ad {
    max-width: 1000px;
}

.ad-banner.middle-ad {
    max-width: 728px;
    margin: 30px auto;
}

.ad-banner.footer-ad {
    max-width: 1000px;
    margin: 20px auto 0 auto;
}

/* Main Content Styles */
main {
    padding: 25px 0;
}

.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

#rss-feed-content h2 {
    margin-bottom: 20px;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #3a86ff;
}

.news-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 3fr 1fr; /* 3 parts main content, 1 part sidebar */
    gap: 40px;
    margin-top: 20px;
}

#rss-feed-content h2 {
    margin-bottom: 20px;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #3a86ff;
}

.news-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Category Section */
.category-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px 0;
    border-bottom: 1px solid #dce6f5;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    margin: 20px 20px 25px;
}

.category-section h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    padding-left: 20px;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
}

.category-section h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 20px;
    width: 50px;
    height: 3px;
    background: linear-gradient(to right, #4361ee, #f72585);
    border-radius: 2px;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 20px;
    justify-content: center;
    margin-top: 10px;
}

.category-item {
    padding: 10px 20px;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca0 100%);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.category-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.category-item:hover::before {
    left: 100%;
}

.category-item:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 16px rgba(67, 97, 238, 0.4);
    background: linear-gradient(135deg, #f72585 0%, #b5179e 100%);
    color: white;
}

.category-item.active {
    background: linear-gradient(135deg, #f72585 0%, #b5179e 100%);
    color: white;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 16px rgba(247, 37, 133, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Popular News Section */
.popular-news-section {
    background: linear-gradient(135deg, #e8f4f8 0%, #d6eaf8 100%);
    padding: 30px 0;
    border-bottom: 1px solid #c7ecee;
    margin-bottom: 30px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    border-radius: 15px;
    margin: 25px 20px;
}

.popular-news-section h3 {
    margin-bottom: 25px;
    color: #1a2a6c;
    padding-left: 20px;
    font-size: 1.6rem;
    font-weight: 700;
    position: relative;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.popular-news-section h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 20px;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, #4361ee, #3a0ca0);
    border-radius: 2px;
}

.popular-news-container {
    overflow: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(31, 38, 135, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
    height: 110px;
    width: 100%;
    max-width: 100%;
    backdrop-filter: blur(4px);
}

.popular-news-scrolling {
    display: flex; cursor: pointer;
    width: 200%; /* Double width to ensure seamless looping with duplicates */
    padding: 15px 10px;
    height: 100%;
    align-items: center;
    gap: 25px; /* Add space between items */
}

.popular-news-scrolling.scrolling {
    animation: scroll-left 120s linear infinite; /* Slower for more items - 120s duration */
}

.popular-news-scrolling:hover {
    animation-play-state: paused;
}

/* Continuous loop animation - left to right */
@keyframes scroll-left {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-100%);
    }
}

.popular-news-item {
    flex: 0 0 auto;
    min-width: 380px;
    max-width: 380px;
    padding: 18px 24px;
    margin: 0 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 15px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    height: 80px;
    border: 1px solid #d1e5ff;
    position: relative;
    overflow: hidden;
}

.popular-news-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #4361ee, #3a0ca0);
}

.popular-news-item:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 12px 25px rgba(67, 97, 238, 0.3);
    border-color: #4361ee;
    background: linear-gradient(135deg, #f8fbff 0%, #e6f0ff 100%);
}

.popular-news-content h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: #1a2a6c;
    cursor: pointer;
    line-height: 1.4;
    height: auto;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: 600;
    transition: all 0.3s ease;
}

.popular-news-item:hover .popular-news-content h4 {
    color: #3a0ca0;
    text-shadow: 0 0 8px rgba(58, 12, 160, 0.2);
}

.popular-news-content .meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f0f5ff;
}

.popular-news-content .meta span:first-child {
    color: #4361ee;
    font-weight: 500;
}

/* Static items for initial display */
.popular-news-static-item {
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
    border-radius: 15px;
    padding: 18px 24px;
    margin: 0 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #d1e5ff;
    position: relative;
    overflow: hidden;
    min-width: 350px;
}

.popular-news-static-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #3a0ca0, #4361ee);
}

.popular-news-static-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(67, 97, 238, 0.25);
    border-color: #4361ee;
    background: linear-gradient(135deg, #f8fbff 0%, #e6f0ff 100%);
}

.popular-news-content {
    display: flex; cursor: pointer;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.popular-news-content h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #2c3e50;
    cursor: pointer;
    line-height: 1.3;
    height: auto;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: 600;
    flex: 1;
    align-items: center;
}

.popular-news-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
}

.popular-news-content h4:hover {
    color: #3a86ff;
    text-decoration: none;
}

/* Remove meta styling since we're not showing it anymore */

@keyframes scroll-left {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Smooth scrolling enhancement */
.popular-news-scrolling {
    will-change: transform;
}

/* News Grid Container - for 3 rows display */
.news-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 20px 0 30px;
}

/* News Items */
.news-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; cursor: pointer;
    flex-direction: column;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.news-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

/* Fade in animation for news items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ad placement styling */
.news-ad {
    grid-column: 1 / -1; /* Span the full width */
    margin: 25px 0;
    text-align: center;
}

.ad-placeholder {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
}

/* Delay for staggered animation */
.news-item:nth-child(1) { animation-delay: 0.1s; }
.news-item:nth-child(2) { animation-delay: 0.2s; }
.news-item:nth-child(3) { animation-delay: 0.3s; }
.news-item:nth-child(4) { animation-delay: 0.4s; }
.news-item:nth-child(5) { animation-delay: 0.5s; }
.news-item:nth-child(6) { animation-delay: 0.6s; }
.news-item:nth-child(7) { animation-delay: 0.7s; }
.news-item:nth-child(8) { animation-delay: 0.8s; }
.news-item:nth-child(9) { animation-delay: 0.9s; }

.news-item h3 {
    margin-bottom: 10px;
    color: #222;
    flex-grow: 1;
    cursor: pointer;
}

.news-item h3:hover {
    color: #3a86ff;
    text-decoration: underline;
}

.news-item .meta {
    display: flex; cursor: pointer;
    justify-content: space-between;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 5px;
}

.news-item .news-image {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover; cursor: pointer;
    border-radius: 6px;
    margin: 10px 0;
}

.news-item p {
    margin-bottom: 15px;
    color: #555;
    flex-grow: 1;
}

.news-item a {
    display: inline-block;
    color: #3a86ff;
    text-decoration: none;
    font-weight: 500;
    align-self: flex-start;
    margin-top: 10px;
}

.news-item a:hover {
    text-decoration: underline;
}

/* Sidebar Styles */
.sidebar-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    padding: 20px;
    margin-top: 20px;
}

.sidebar-container h3 {
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3a86ff;
}

.sidebar-news-item {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
}

.sidebar-news-item:last-child {
    border-bottom: none;
}

.sidebar-news-item h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: #222;
    cursor: pointer;
}

.sidebar-news-item h4:hover {
    color: #3a86ff;
    text-decoration: underline;
}

.sidebar-news-item .meta {
    display: flex; cursor: pointer;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.sidebar-news-item a {
    color: #3a86ff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.sidebar-news-item a:hover {
    text-decoration: underline;
}

/* Load More Button */
.load-more-btn {
    display: block;
    margin: 30px auto;
    padding: 12px 30px;
    background-color: #3a86ff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.load-more-btn:hover {
    background-color: #2a75e6;
}

.load-more-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Responsive Design for New Elements */
@media (min-width: 992px) {
    .main-content-wrapper {
        grid-template-columns: 3fr 1fr;
        gap: 40px;
    }
    
    .popular-news-scrolling {
        height: 80px;
    }
    
    .popular-news-item {
        min-width: 400px;
        height: 60px;
        display: flex; cursor: pointer;
        align-items: center;
    }
    
    .popular-news-content h4 {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }
    
    .popular-news-content .meta {
        flex-direction: column;
        align-items: flex-start;
        margin-left: 10px;
    }
}

/* Static Page Content */
.page-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    padding: 30px;
    
}

.page-content h1 {
    margin-bottom: 20px;
    color: #222;
    padding-bottom: 10px;
    border-bottom: 2px solid #3a86ff;
}

.page-content h2 {
    margin: 25px 0 15px 0;
    color: #333;
}

.page-content p {
    margin-bottom: 15px;
    color: #555;
    line-height: 1.7;
}

.page-content ul {
    margin: 15px 0 15px 30px;
}

.page-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Footer Styles */
footer {
    background-color: #343a40;
    color: #fff;
    padding-top: 40px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding-bottom: 30px;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 15px;
    color: #f8f9fa;
}

.footer-section p {
    color: #adb5bd;
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #495057;
    padding: 20px 0;
    text-align: center;
    color: #adb5bd;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        max-width: 95%;
    }
}

@media (max-width: 992px) {
    .container {
        padding: 0 15px;
    }
    
    .ad-banner.top-ad,
    .ad-banner.middle-ad,
    .ad-banner.footer-ad {
        padding: 10px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 10px 0;
    }
    
    header .container {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .logo h1 {
        font-size: 1.6rem;
    }
    
    .logo p {
        font-size: 0.85rem;
    }
    
    nav ul {
        margin-top: 10px;
        justify-content: center;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    nav ul li {
        margin: 3px 6px;
    }
    
    nav ul li a {
        font-size: 0.95rem;
        padding: 5px 8px;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .news-item {
        padding: 18px;
    }
    
    .page-content {
        padding: 25px 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 25px;
    }
    
    .footer-section ul {
        padding: 0;
        margin: 12px 0;
    }
    
    .ad-banner {
        padding: 12px 8px;
    }
    
    .ad-banner.top-ad,
    .ad-banner.middle-ad,
    .ad-banner.footer-ad {
        margin: 20px auto;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 0.9rem;
    }
    
    header .container {
        padding: 10px 15px;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    nav ul li {
        margin: 2px 4px;
        font-size: 0.9rem;
    }
    
    nav ul li a {
        padding: 4px 6px;
    }
    
    .news-item {
        padding: 15px;
    }
    
    .news-item h3 {
        font-size: 1.1rem;
    }
    
    .news-item .meta {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
    
    .page-content {
        padding: 20px 15px;
    }
    
    .page-content h1 {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }
    
    .page-content h2 {
        font-size: 1.1rem;
        margin: 20px 0 12px 0;
    }
    
    .page-content p {
        margin-bottom: 12px;
    }
    
    .page-content ul {
        margin: 12px 0 12px 20px;
    }
    
    .footer-section h3,
    .footer-section h4 {
        margin-bottom: 10px;
    }
    
    .ad-banner {
        padding: 10px 5px;
    }
}

/* Countdown Section */
.countdown-section {
    text-align: center;
    padding: 20px 0;
    margin-top: 20px;
    border-top: 1px solid #dee2e6;
}

.countdown-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.countdown-item {
    background: linear-gradient(135deg, #4361ee, #3a0ca0);
    color: white;
    border-radius: 8px;
    padding: 10px 15px;
    min-width: 60px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.countdown-item span {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1.2;
}

.countdown-item small {
    font-size: 0.7rem;
    text-transform: uppercase;
    opacity: 0.8;
}

.countdown-separator {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
}

/* View Count Styles */
.view-count {
    background: linear-gradient(135deg, #4cc9f0, #4361ee);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.popular-news-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
}


/* Category Tag Styles */
.category-tag {
    background: linear-gradient(135deg, #4361ee, #3a0ca0);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

/* Article Iframe Styles */
.article-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.article-header h1 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.8rem;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    color: #6c757d;
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 10px;
}

.article-iframe-container {
    width: 100%;
    height: 90vh;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    background: #fff;
    margin-bottom: 30px;
}

#article-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #f8f9fa;
}

/* Responsive design for article page */
@media (max-width: 768px) {
    .article-header h1 {
        font-size: 1.5rem;
    }
    
    .article-iframe-container {
        height: 75vh;
        margin-bottom: 20px;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .article-header h1 {
        font-size: 1.3rem;
    }
    
    .article-iframe-container {
        height: 70vh;
    }
}
/* Sidebar Styles for Post Page */
.content-wrapper {
    display: grid;
    grid-template-columns: 3fr 1fr; /* 3 parts main content, 1 part sidebar */
    gap: 40px;
    margin-top: 20px;
}

.main-content {
    /* Main content area for the article */
}

.sidebar {
    /* Sidebar for related posts */
}

.sidebar-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    padding: 20px;
    margin-top: 20px;
    position: sticky;
    top: 20px;
}

.sidebar-container h3 {
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3a86ff;
}

.related-post-item {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
}

.related-post-item:last-child {
    border-bottom: none;
}

.related-post-item h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: #222;
    cursor: pointer;
}

.related-post-item h4:hover {
    color: #3a86ff;
    text-decoration: underline;
}

.related-post-item .meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.related-post-item a {
    color: #3a86ff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.related-post-item a:hover {
    text-decoration: underline;
}

/* Responsive design for post page */
@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr; /* Stack on smaller screens */
        gap: 30px;
    }
    
    .sidebar-container {
        position: static; /* Remove sticky positioning on small screens */
    }
}
/* Related Posts with Thumbnails */
.related-post-item {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
}

.related-post-item:last-child {
    border-bottom: none;
}

.related-post-item h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: #222;
    cursor: pointer;
    align-self: flex-start;
}

.related-post-item h4:hover {
    color: #3a86ff;
    text-decoration: underline;
}

.related-post-thumbnail {
    width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
}

.related-post-item .meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
    margin: 5px 0;
}

.related-post-item a {
    color: #3a86ff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    align-self: flex-start;
}

.related-post-item a:hover {
    text-decoration: underline;
}
/* Overlay Main Ad Styles */
.overlay-main-ad {
    text-align: center;
    margin: 20px auto;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 2; /* Above other overlay content */
    max-width: 750px; /* Match the ad width */
}

.overlay-main-ad .adsbygoogle {
    margin: 0 auto;
    display: block !important;
}

/* Ensure the ad-overlay-container is properly aligned for centering */
.ad-overlay-container {
    width: 100%;
    height: 100%;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box;
    position: relative;
    color: white;
    overflow: visible !important;
}

/* View Count Styles for Post Page */
.view-count-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.view-count {
    background: linear-gradient(135deg, #4361ee, #3a0ca0);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-count i {
    font-size: 1rem;
}
/* Ad Banner Styles for Post Page Sidebar */
.ad-banner.sidebar-ad {
    text-align: center;
    padding: 15px;
    background-color: #fff;
    margin: 0 0 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    border-radius: 4px;
    max-width: 100%;
}

.ad-banner.sidebar-ad ins {
    max-width: 100%;
}
/* Comment Section Styles */
.comment-section {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.comment-section h3 {
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3a86ff;
}

.comment-form {
    margin-bottom: 20px;
}

.comment-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 10px;
    resize: vertical;
    min-height: 80px;
}

.comment-btn {
    background: linear-gradient(135deg, #4361ee, #3a0ca0);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

.comment-btn:hover {
    background: linear-gradient(135deg, #3a0ca0, #4361ee);
}

.comment-list {
    margin-top: 20px;
}

.comment-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #3a86ff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.comment-author {
    font-weight: bold;
    color: #3a86ff;
    margin-bottom: 5px;
}

.comment-date {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.comment-text {
    color: #333;
    line-height: 1.5;
}
/* Ad Banner Styles for Comments Section */
.ad-banner.comments-ad {
    text-align: center;
    padding: 15px;
    background-color: #fff;
    margin: 25px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    border-radius: 4px;
}
/* Loading Animation Styles */
.loading-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3a86ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.loading-text {
    text-align: center;
    color: #666;
    font-size: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Related Posts Loading Animation */
.related-post-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 0;
}

.related-post-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4361ee;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
}

/* Iframe Loading Animation */
.iframe-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 90vh;
    width: 100%;
    background: #f8f9fa;
    position: relative; /* Ensure proper positioning context */
    z-index: 1; /* Lower z-index than ad overlay */
}

.iframe-loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e9ecef;
    border-top: 5px solid #3a86ff;
    border-radius: 50%;
    animation: spin 2s linear infinite;
    margin-bottom: 20px;
}
/* YouTube-style Ad Overlay - Full width/height with only blur effect, no background */
.ad-overlay-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent; /* No background color */
    backdrop-filter: blur(8px); /* Full blur effect on background */
    -webkit-backdrop-filter: blur(8px); /* Safari support */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align to top to match YouTube style */
    align-items: center;
    z-index: 10000;
    color: white; /* White text for visibility */
    text-align: left;
    padding: 0;
    margin: 0;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    box-sizing: border-box;
    overflow: hidden;
}

.ad-overlay-iframe.show {
    opacity: 1;
}

.ad-overlay-content {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
    padding: 16px;
}

/* YouTube-style ad container */
.ad-overlay-container {
    width: 100%;
    height: 100%;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
    color: white;
    overflow: hidden;
}

/* YouTube-style ad content area - maximum height with fully transparent background */
.ad-overlay-ins {
    width: 100% !important;
    height: 100% !important;
    min-height: 95% !important; /* Ensure maximum possible height */
    background-color: transparent !important; /* Fully transparent background - force override */
    backdrop-filter: none !important; /* No blur on ad area itself - force override */
    -webkit-backdrop-filter: none !important; /* No blur on ad area itself - force override */
    border: none !important;
    text-align: center !important;
    display: flex !important; /* Changed back to flex to ensure proper AdSense ad display */
    align-items: center !important;
    justify-content: center !important;
    color: transparent !important; /* Make any placeholder text invisible */
    font-size: 0 !important; /* Make any placeholder text invisible */
    box-sizing: border-box !important;
    border-radius: 0 !important;
    position: absolute !important; /* Changed back to absolute but ensure proper sizing */
    top: 0 !important;
    left: 0 !important;
    z-index: 1 !important; /* Lower than header and skip button */
    overflow: visible !important; /* Ensure ad content is visible */
    min-width: 300px !important; /* Ensure minimum width for AdSense */
}



/* YouTube-style skip button container positioned in bottom-right corner */
.skip-ad-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 100; /* Higher z-index to appear above ad */
}

.skip-timer {
    background-color: rgba(0, 0, 0, 0.8); /* Dark background for visibility */
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 8px;
    min-width: 120px;
    text-align: center;
}

.skip-button {
    background-color: rgba(255, 255, 255, 0.9); /* Light background for contrast */
    color: #000;
    border: none;
    padding: 10px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.skip-button:hover {
    opacity: 0.8;
}

.skip-button:enabled {
    opacity: 1;
    background-color: white;
    color: #000;
}

.skip-button:enabled:hover {
    background-color: #f0f0f0;
    color: #000;
}



/* Ensure iframe container properly contains the overlay */
.article-iframe-container {
    width: 100%;
    height: 90vh;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden; /* Ensure nothing spills outside */
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    background: #fff;
    margin-bottom: 30px;
    position: relative; /* Ensure absolute positioned overlay works correctly */
}

/* Ensure iframe container properly contains the overlay */
.article-iframe-container {
    width: 100%;
    height: 90vh;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden; /* Ensure nothing spills outside */
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    background: #fff;
    margin-bottom: 30px;
    position: relative; /* Ensure absolute positioned overlay works correctly */
}

/* Fullscreen Button Styles */
.fullscreen-button-container {
    margin: 0;
    display: inline-block;
}

.fullscreen-btn {
    background: linear-gradient(135deg, #3a86ff, #4361ee);
    color: white;
    border: none;
    padding: 10px;
    font-size: 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    min-width: auto;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.fullscreen-btn:hover {
    background: linear-gradient(135deg, #4361ee, #3a86ff);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.3);
}

.fullscreen-icon {
    font-size: 1.2rem;
    line-height: 1;
}


.fullscreen-btn:focus {
    outline: none;
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

/* View Count and Fullscreen Container - Horizontal Layout */
.view-count-and-fullscreen {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    width: 100%;
}

.view-count-and-fullscreen .view-count-section {
    flex: 1;
    text-align: left;
}

.view-count-and-fullscreen .fullscreen-button-container {
    text-align: right;
    margin-left: auto; /* Pushes to the right */
}
/* View Count and Fullscreen - Side by side layout */
.view-count-section {
    float: left;
    text-align: left;
}

.fullscreen-button-container {
    float: right;
    text-align: right;
}

/* Clear floats */
.view-count-section, .fullscreen-button-container {
    margin: 15px 0;
}

/* Related Posts Views */
.related-post-item .post-views {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
}

.related-post-item .post-views span {
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.related-post-item .post-views i {
    font-style: normal;
    margin-right: 4px;
}
