* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.4;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-size: 13px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 15px;
    width: 100%;
    box-sizing: border-box;
}

/* FIXED: Header ad container - FORCE horizontal ads with max-height */
.header-ad {
    width: 100%;
    max-width: 100%;
    margin: 0 0 20px 0;
    min-height: 90px;
    max-height: 120px; /* Prevents vertical ads */
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Content wrapper for main content and sidebar */
.content-wrapper {
    display: flex;
    gap: 20px;
    width: 100%;
    align-items: flex-start;
    flex-wrap: nowrap;
}

/* Header Styles - Modern Gradient */
.header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: none;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    font-weight: bold;
}

.site-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-menu a {
    text-decoration: none;
    color: #e2e8f0;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 6px;
    white-space: nowrap;
}

.nav-menu a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 22px;
    height: 2px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Main Content - Glass Morphism Effect */
.main-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 0;
}

/* FIXED: Sidebar width increased to 360px for better 336x280 ad display */
.sidebar {
    width: 360px;
    flex-shrink: 0;
}

/* Newspaper Grid - Modern Cards */
.newspaper-grid {
    margin-top: 15px;
}

.category-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.category-section:last-child {
    border-bottom: none;
}

.category-title {
    color: #1e3a8a;
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #6366f1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

/* Desktop: 5 items per row for more space */
.newspaper-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.newspaper-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.newspaper-item:hover {
    border-color: #6366f1;
    background: #f8faff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}

.newspaper-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    text-decoration: none;
    color: inherit;
    min-height: 44px;
    gap: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.newspaper-favicon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 4px;
    padding: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.newspaper-favicon img {
    width: 100%;
    height: 100%;
    border-radius: 3px;
}

/* Single line newspaper names with ellipsis and tooltip */
.newspaper-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.newspaper-link:hover .newspaper-name {
    color: #1e3a8a;
    font-weight: 600;
}

/* Directory Stats Section - Improved spacing */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-category {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.stat-category:hover {
    border-color: #6366f1;
    background: #f8faff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.stat-category-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #374151;
}

.stat-category-count {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e3a8a;
    background: #f0f5ff;
    padding: 4px 10px;
    border-radius: 12px;
    min-width: 40px;
    text-align: center;
}

/* Add space after colon in directory stats */
.stat-category-name::after {
    content: ":";
    margin-right: 8px;
}

/* About Section - Improved spacing and readability */
.about-section {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 30px;
    margin-top: 10px;
}

.about-content {
    color: #374151;
    line-height: 1.7;
    font-size: 0.95rem;
}

.about-content p {
    margin-bottom: 20px;
    text-align: justify;
}

.about-content strong {
    color: #1e3a8a;
    font-weight: 600;
}

.about-content p:last-child {
    margin-bottom: 0;
}

/* Search Box - Modern Style */
.search-box {
    margin: 15px 0;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.search-box input:focus {
    border-color: #6366f1;
    background: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}

.search-box::after {
    content: "🔍";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Section Description */
.section-description {
    color: #6b7280;
    font-size: 0.85rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

/* Sidebar Widgets - Glass Morphism */
.sidebar-widgets {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.widget {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.widget h3 {
    color: #1e3a8a;
    margin-bottom: 12px;
    font-size: 0.95rem;
    padding-bottom: 8px;
    border-bottom: 2px solid #6366f1;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Quick Navigation */
.quick-nav .nav-list, .custom-menu .nav-list {
    list-style: none;
}

.quick-nav .nav-list li, .custom-menu .nav-list li {
    margin-bottom: 8px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    padding: 4px 0;
}

.quick-nav .nav-list li:hover, .custom-menu .nav-list li:hover {
    border-left-color: #6366f1;
    padding-left: 12px;
    background: #f8faff;
    border-radius: 0 6px 6px 0;
}

.quick-nav .nav-list a, .custom-menu .nav-list a {
    text-decoration: none;
    color: #6b7280;
    display: block;
    padding: 6px 8px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    font-weight: 500;
    border-radius: 4px;
}

.quick-nav .nav-list a:hover, .custom-menu .nav-list a:hover {
    color: #1e3a8a;
    font-weight: 600;
}

/* Enhanced Useful Links styling */
.custom-menu .nav-list li {
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 6px;
    border: 1px solid #e2e8f0;
}

.custom-menu .nav-list li:hover {
    background: #f0f9ff;
    border-color: #6366f1;
    transform: translateX(4px);
}

.custom-menu .nav-list a {
    padding: 8px 12px;
    color: #475569;
    font-weight: 500;
}

.custom-menu .nav-list a:hover {
    color: #1e3a8a;
    background: none;
}

/* FIXED: Ad Containers with proper dimensions */
.ad-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
}


    min-width: 336px;
    min-height: 280px;
    max-width: 360px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* CRITICAL: Force header ads to be horizontal (leaderboard style) */
.header-ad ins.adsbygoogle {
    display: block !important;
    width: 100% !important;
    max-width: 970px !important;
    min-width: 320px !important;
    height: 90px !important;
    max-height: 90px !important;
    margin: 0 auto !important;
}

/* CRITICAL: Force sidebar ads to be 336x280 rectangle */
.ad-widget ins.adsbygoogle {
    display: inline-block !important;
    width: 336px !important;
    height: 280px !important;
    margin: 0 auto !important;
}

/* Footer ad - similar to header, horizontal */
.main-content > .ad-widget:last-child ins.adsbygoogle {
    display: block !important;
    width: 100% !important;
    max-width: 970px !important;
    min-width: 320px !important;
    height: 90px !important;
    margin: 0 auto !important;
}

/* Footer - Modern Gradient */
.footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    margin-top: 50px;
    border-top: none;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 15px 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}

.footer-section h3 {
    margin-bottom: 15px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 8px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: #6366f1;
    border-radius: 2px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #cbd5e0;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    padding: 2px 0;
    display: inline-block;
}

.footer-section a:hover {
    color: white;
    transform: translateX(5px);
}

.social-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.social-link {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.social-link:hover {
    background: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding: 20px 0;
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
    background: rgba(15, 23, 42, 0.8);
}

/* Loading & No Data States */
.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-style: italic;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border: 2px dashed #d1d5db;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border: 2px dashed #d1d5db;
    margin: 15px 0;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        padding: 0 12px;
    }
    
    .header-container {
        padding: 0 12px;
    }
    
    .newspaper-list {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .newspaper-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Adjust sidebar on tablets */
    .sidebar {
        width: 336px;
    }
}

@media (max-width: 768px) {
    .container {
        gap: 15px;
        padding: 0 10px;
    }
    
    .content-wrapper {
        flex-direction: column;
    }
    
    .main-content {
        order: 0;
        width: 100%;
        min-width: auto;
    }
    
    .sidebar {
        width: 100%;
        order: 1;
    }
    
    /* Disable sticky on mobile */
    .sticky-ad {
        position: relative;
        top: auto;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
        flex-direction: column;
        padding: 15px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.2);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .newspaper-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .about-section {
        padding: 20px;
    }
    
    .about-content {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .ad-container {
        padding: 10px;
    }
    
    .header-ad {
        min-height: 50px;
        max-height: 100px;
    }
    
    /* Mobile: Allow responsive ads */
    .header-ad ins.adsbygoogle {
        width: 100% !important;
        height: auto !important;
        min-height: 50px !important;
        max-height: 100px !important;
    }
    
    .ad-widget {
        min-width: 100%;
        min-height: 250px;
    }
    
    /* Mobile ads: 300x250 medium rectangle */
    .ad-widget ins.adsbygoogle {
        width: 300px !important;
        height: 250px !important;
        max-width: 100%;
    }
    
    /* In-content ads fully responsive on mobile */
    .in-content-ad ins.adsbygoogle {
        width: 100% !important;
        height: auto !important;
        min-height: 250px !important;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 8px;
    }
    
    .header-container {
        padding: 0 8px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    /* FIXED: Show 2 newspaper names per row on mobile */
    .newspaper-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .newspaper-link {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .newspaper-favicon {
        width: 16px;
        height: 16px;
    }
    
    .newspaper-name {
        font-size: 0.8rem;
    }
    
    .widget {
        padding: 15px;
    }
    
    .about-section {
        padding: 15px;
    }
    
    .about-content {
        font-size: 0.85rem;
        line-height: 1.6;
    }
    
    .about-content p {
        margin-bottom: 16px;
    }
}

@media (max-width: 400px) {
    /* Keep 2 columns even on very small screens */
    .newspaper-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .newspaper-link {
        padding: 6px 8px;
    }
    
    .newspaper-name {
        font-size: 0.75rem;
    }
}

/* Very large screens - show 5 items (consistent) */
@media (min-width: 1400px) {
    .newspaper-list {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Animation for mobile menu toggle */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Tooltip styles for newspaper names */
.newspaper-link {
    position: relative;
}

.newspaper-link:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e3a8a;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.newspaper-link:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% - 5px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e3a8a;
    z-index: 1000;
}