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

        body {
            font-family: 'Noto Sans Bengali', Arial, sans-serif;
            background: #f8f9fa;
            min-height: 100vh;
            line-height: 1.6;
            color: #333;
        }

        /* Desktop Header */
        .desktop-header {
            background: white;
            margin: 20px;
            padding: 20px 30px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            border-radius: 15px;
            border: 1px solid #e9ecef;
        }

        .desktop-header h1 {
            text-align: center;
            font-size: 2.5rem;
            font-weight: 700;
            color: #333;
            margin-bottom: 20px;
        }

        .nav-tabs {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-bottom: 20px;
        }

        .nav-tab {
            padding: 10px 20px;
            background: #1E5631;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .nav-tab:hover {
            background: #1E5631;
            transform: translateY(-2px);
        }

        .nav-tab.active {
            background: #1E5631;
        }

        .search-container {
            max-width: 600px;
            margin: 0 auto 20px;
            position: relative;
        }

        .search-input {
            width: 100%;
            padding: 15px 50px 15px 20px;
            border: 2px solid #e9ecef;
            border-radius: 8px;
            font-size: 1.1rem;
            background: white;
            transition: all 0.3s ease;
        }

        .search-input:focus {
            outline: none;
            border-color: #1E5631;
            box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.1);
        }

        .search-icon {
            position: absolute;
            right: 20px;
            top: 50%;
            transform: translateY(-50%);
            color: #6f42c1;
            font-size: 1.2rem;
        }

        .categories {
            display: flex;
            justify-content: center;
            gap: 15px;
            flex-wrap: wrap;
            margin-bottom: 10px;
        }

        .category-btn {
            padding: 10px 20px;
            background: white;
            border: 2px solid #e9ecef;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 500;
            color: #333;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .category-btn:hover, .category-btn.active {
            background: #1E5631;
            color: white;
            border-color: #1E5631;
        }

        /* Logo Styles */
        .header-brand, .mobile-header-brand {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .logo-container {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

        .header-logo, .mobile-logo {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .mobile-header-brand .logo-container {
            width: 55px;
            height: 55px;
        }
        /* Mobile Search Bar Styles */
        .mobile-search-bar {
            display: none;
            padding: 10px 15px;
            background: white;
            border-bottom: 1px solid #e9ecef;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .mobile-search-container {
            display: flex;
            align-items: center;
            gap: 10px;
            max-width: 100%;
        }

        .search-config-dropdown {
            position: relative;
        }

        .config-btn {
            background: #1E5631;
            color: white;
            border: none;
            padding: 10px 12px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            transition: background-color 0.2s;
        }

        .config-btn:hover {
            background: #0f3319;
        }
        /* Filter icon styling inside search input */
        #configDropdown {
            transition: color 0.2s ease;
        }

        #configDropdown:hover {
            color: #0f3319 !important;
        }

        /* Dropdown positioning adjustment for right alignment */
        #dropdownMenu {
            right: 10px !important;
            left: auto !important;
        }

        .dropdown-menu {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            background: white;
            border: 1px solid #ddd;
            border-radius: 6px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            z-index: 1000;
            min-width: 150px;
            margin-top: 2px;
        }

        .dropdown-item {
            padding: 10px 15px;
            cursor: pointer;
            font-size: 14px;
            transition: background-color 0.2s;
            white-space: nowrap;
        }

        .dropdown-item:hover {
            background: #f8f9fa;
        }

        .dropdown-item:first-child {
            border-radius: 6px 6px 0 0;
        }

        .dropdown-item:last-child {
            border-radius: 0 0 6px 6px;
        }

        .mobile-search-input {
            flex: 1;
            padding: 10px 15px;
            border: 2px solid #e9ecef;
            border-radius: 6px;
            font-size: 14px;
            font-family: 'Noto Sans Bengali', sans-serif;
            background: white;
        }

        .mobile-search-input:focus {
            outline: none;
            border-color: #1E5631;
            box-shadow: 0 0 0 2px rgba(30, 86, 49, 0.1);
        }

        .mobile-search-btn {
            background: #1E5631;
            color: white;
            border: none;
            padding: 10px 15px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            transition: background-color 0.2s;
        }

        .mobile-search-btn:hover {
            background: #0f3319;
        }

        /* Trending Topics Section Styles */
        .trending-section {
            background: white;
            padding: 20px 30px;
            border-radius: 15px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            border: 1px solid #e9ecef;
            margin-top: 2px;
        }

        .trending-header {
            display: flex;
            align-items: center;
            margin-bottom: 20px;
        }

        .trending-title {
            font-size: 1.4rem;
            font-weight: 600;
            color: #333;
            margin: 0;
            font-family: 'Noto Sans Bengali', Arial, sans-serif;
        }

        .trending-topics {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            align-items: center;
        }

    /* Update the general .trending-topic styles */
    .trending-topic {
        /* Original styles */
        background: #f8f9fa; /* You'll likely want to change this */
        border: 2px solid #e9ecef;
        border-radius: 25px;
        padding: 8px 16px;
        font-size: 0.9rem;
        font-weight: 500;
        color: #333; /* You'll likely want to change this to white if using dark background */
        cursor: pointer;
        transition: all 0.3s ease;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
        font-family: 'Noto Sans Bengali', Arial, sans-serif;

        /* Add the styles from :first-child here to apply to all */
        background: linear-gradient(135deg, #1E5631, #2d8659); /* Apply gradient to all */
        color: white; /* Make text white for dark background */
        border-color: #1E5631;
        position: relative;
        overflow: hidden; /* Needed for the ::before shine */
    }

    /* Move the ::before pseudo-element styles */
    .trending-topic::before { /* Changed from :first-child::before to .trending-topic::before */
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
        transform: rotate(45deg);
        animation: fireShine 2s linear infinite;
    }

    /* Move the fire-icon flicker animation */
    .trending-topic .fire-icon { /* Changed from :first-child .fire-icon to .trending-topic .fire-icon */
        color: #ff6b35;
        font-size: 1rem;
        animation: fireFlicker 1.5s ease-in-out infinite alternate;
    }

    /* Adjust hover for all if they now have the gradient */
    .trending-topic:hover {
        background: linear-gradient(135deg, #0f3319, #1E5631); /* Darker gradient on hover */
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(30, 86, 49, 0.4);
    }

        @keyframes fireShine {
            0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
            100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
        }

        @keyframes fireFlicker {
            0% { 
                color: #ff6b35;
                text-shadow: 0 0 5px #ff6b35;
            }
            50% { 
                color: #ff8c42;
                text-shadow: 0 0 8px #ff8c42, 0 0 12px #ff6b35;
            }
            100% { 
                color: #ff4757;
                text-shadow: 0 0 10px #ff4757, 0 0 15px #ff6b35;
            }
        }

        /* Additional CSS for the fire icon in title */
        .trending-fire-icon {
            color: #ff6b35;
            margin-left: 8px;
            font-size: 1.2rem;
            animation: titleFireFlicker 2s ease-in-out infinite alternate;
        }

        @keyframes titleFireFlicker {
            0% { 
                color: #ff6b35;
                text-shadow: 0 0 3px #ff6b35;
            }
            50% { 
                color: #ff8c42;
                text-shadow: 0 0 6px #ff8c42, 0 0 10px #ff6b35;
            }
            100% { 
                color: #ff4757;
                text-shadow: 0 0 8px #ff4757, 0 0 12px #ff6b35;
            }
        }

        .no-topics-message {
            color: #666;
            font-style: italic;
            padding: 10px 15px;
            background: #f8f9fa;
            border-radius: 8px;
            border: 1px solid #e9ecef;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .no-topics-message i {
            color: #6c757d;
        }

        @media (max-width: 768px) {
            .trending-fire-icon {
                font-size: 1rem;
                margin-left: 6px;
            }
            
            .no-topics-message {
                font-size: 0.8rem;
                padding: 8px 12px;
            }
        }
    /* Mobile Styles for Trending Topics */
    @media (max-width: 768px) {
        .trending-section {
            padding: 15px 15px; /* Reduced padding */
            margin-bottom: 0px;
        }

        .trending-header {
            margin-bottom: 5px;
        }

        .trending-title {
            font-size: 1.1rem;
        }

        .trending-topics {
            gap: 8px; /* Consistent gap between items */
        }

        .trending-topic {
            padding: 6px 10px; /* Reduced padding for smaller buttons */
            font-size: 0.8rem; /* Smaller font size */
            border-radius: 20px;
            /* Allow flex-basis to determine initial size, let it grow/shrink as needed */
            flex-basis: auto; /* Reset any previous flex-basis */
            min-width: unset; /* Remove explicit min-width */
            max-width: 100%; /* Ensure it doesn't exceed its container */
            white-space: normal; /* Allow text to wrap within the button */
            word-break: break-word; /* Break long words if necessary */
            height: auto; /* Allow height to adjust based on content */
        }

        /* To achieve a more dynamic multi-column layout, you can use flex-basis with a percentage */
        /* This will allow items to distribute themselves more evenly across rows */
        .trending-topic {
            /*
            flex-basis: calc(50% - 4px); /* For a 2-column layout on mobile, adjusting for gap */
            /*
            If you want 3 columns on small screens, use:
            flex-basis: calc(33.333% - 5.333px); // (8px * 2 / 3) for gap
            */
            /*
            A simpler approach is to let flex-wrap handle it with just padding and font-size adjustments.
            The `white-space: normal;` is key if text needs to wrap.
            */
            flex-shrink: 1; /* Allow it to shrink */
            flex-grow: 0; /* Don't force it to grow to fill space unless needed */
            
            /* Instead of explicit fixed widths, let content dictate some minimum width */
            min-width: fit-content; /* Or a small px value if you want a guaranteed minimum */
            text-align: center; /* Center text within the button */
            justify-content: center; /* Center content if using display:flex on the button itself */
        }

        /* Remove the specific nth-child rules for widths and ::after pseudo-elements */
        .trending-topic:nth-child(1),
        .trending-topic:nth-child(2),
        .trending-topic:nth-child(3),
        .trending-topic:nth-child(4),
        .trending-topic:nth-child(5),
        .trending-topic:nth-child(6),
        .trending-topic:nth-child(7),
        .trending-topic:nth-child(8) {
            flex: unset; /* Reset flex values from previous rules if they were specific */
            min-width: unset;
            max-width: unset;
            justify-content: unset;
            text-align: unset; /* Let the general text-align or flex alignment handle it */
        }

        .trending-topic:nth-child(4)::after,
        .trending-topic:nth-child(7)::after {
            content: unset; /* Remove these forced line breaks */
            flex-basis: unset;
            height: unset;
        }
    }
        /* Mobile Search Bar - Additional styles for mobile */
        @media (max-width: 768px) {
            .mobile-search-bar {
                display: block !important;
                margin-top: 70px; /* Account for fixed header */
            }
            
            .main-content {
                margin-top: 0px !important; /* Increased to account for header + search bar */
                margin-bottom: 100px;
                padding: 5px;
            }
        }

        /* Hide mobile search bar on desktop */
        @media (min-width: 769px) {
            .mobile-search-bar {
                display: none !important;
            }
        }
        /* HTMX Loading Indicator Styles */
        .htmx-indicator {
            display: none;
        }

        .htmx-request .htmx-indicator {
            display: flex !important;
        }

        .loading-indicator {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(49, 122, 98, 0.95);
            color: white;
            padding: 15px 25px;
            border-radius: 25px;
            display: flex;
            align-items: center;
            gap: 10px;
            z-index: 9999;
            font-size: 14px;
            font-weight: 500;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
        }

        .loading-indicator i {
            font-size: 16px;
        }

        .desktop-loading {
            top: 20%;
        }

        .mobile-loading {
            top: 30%;
        }

        /* Search container positioning */
        .search-container {
            position: relative;
            display: flex;
            align-items: center;
        }

        .search-icon-btn {
            background: none;
            border: none;
            cursor: pointer;
            position: absolute;
            right: 10px;
            z-index: 5;
            padding: 8px;
            color: #666;
        }

        .search-icon-btn:hover {
            color:rgb(45, 112, 95);
        }

        /* Button loading states */
        .htmx-request .category-btn,
        .htmx-request .search-icon-btn,
        .htmx-request .bottom-nav-item,
        .htmx-request .search-btn {
            opacity: 0.7;
            pointer-events: none;
        }

        /* News section loading overlay */
        #news-section {
            position: relative;
        }

        .htmx-request #news-section::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(255, 255, 255, 0.7);
            z-index: 10;
            backdrop-filter: blur(1px);
        }

        /* Responsive adjustments */
        @media (max-width: 768px) {
            .logo-container {
                width: 55px;
                height: 55px;
            }
            
            .header-brand, .mobile-header-brand {
                gap: 8px;
            }

            .loading-indicator {
                padding: 12px 20px;
                font-size: 13px;
            }
        }
        /* Mobile Header */
        .mobile-header {
            display: none;
            background: white;
            padding: 10px 15px;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1000;
        }

        .mobile-header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: relative;
        }

        .mobile-header h1 {
            text-align: center;
            font-size: 1.2rem;
            font-weight: 600;
            color: #34756d;
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 60%;
        }

        /* Search Popup */


        /* Main Content */
        .main-content {
            padding: 20px;
            margin-top: 0;
        }

        .section {
            background: white;
            margin-bottom: 30px;
            padding: 30px;
            border-radius: 15px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            border: 1px solid #e9ecef;
        }

        .section-title {
            text-align: center;
            font-size: 2rem;
            font-weight: 300;
            color: #333;
            margin-bottom: 10px;
        }

        .cards-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            max-width: 1400px;
            margin: 0 auto;
        }

        .card {
            background: white;
            border-radius: 12px;
            padding: 20px;
            transition: all 0.3s ease;
            border: 1px solid #f1f3f4;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            height: 100%; /* Ensure all cards have equal height */
        }
        /* Remove underlines from card links */
        .card a {
            text-decoration: none;
            color: inherit;
            display: block;
            width: 100%;
            height: 100%;
        }

        .card a:hover {
            text-decoration: none;
            color: inherit;
        }

        .card a:visited {
            text-decoration: none;
            color: inherit;
        }

        .card a:active {
            text-decoration: none;
            color: inherit;
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
            border-color: #1E5631;
        }

        .card-image {
            width: 100%;
            height: 160px;
            background: linear-gradient(135deg, #275042, #78e9c3);
            border-radius: 8px;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 2.5rem;
            flex-shrink: 0; /* Prevent image container from shrinking */
        }

        .card-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 8px;
        }

        .card-title {
            font-size: 1.1rem;
            font-weight: 600;
            color: #333;
            margin-bottom: 15px;
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
            flex-grow: 1; /* Allow title to take available space */
        }

        .card-meta {
            display: flex;
            align-items: center;
            justify-content: space-between;
            color: #666;
            font-size: 0.9rem;
            margin-top: auto; /* Push meta to bottom */
            padding-top: 15px;
            border-top: 1px solid #f1f3f4;
            flex-shrink: 0; /* Prevent meta from shrinking */
        }

        .card-author {
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0; /* Allow text to shrink if needed */
        }

        .card-author img {
            width: 24px; /* Fixed width instead of percentage */
            height: 24px; /* Fixed height instead of percentage */
            object-fit: cover;
            border-radius: 4px; /* Slightly rounded corners */
            flex-shrink: 0; /* Prevent logo from shrinking */
        }

        .card-date {
            color: #6f42c1;
            font-weight: 500;
            cursor: pointer;
        }

        /* Mobile Bottom Navigation */
        .mobile-bottom-nav {
            display: none;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(255, 255, 255, 0.9);
            padding: 0px 15px;
            z-index: 1000;
        }

        .bottom-nav-items {
            display: flex;
            justify-content: space-around;
            align-items: center;
            background: rgba(255, 255, 255, 0.9);
            border-radius: 20px;
            padding: 10px 5px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .bottom-nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
            padding: 10px;
            color: #1E5631;
            text-decoration: none;
            font-size: 0.8rem;
            transition: all 0.3s ease;
            border-radius: 12px;
            cursor: pointer;
            min-width: 50px;
        }

        .bottom-nav-item.active {
            color: #1E5631;
            background: rgba(111, 66, 193, 0.1);
        }

        .bottom-nav-item:hover {
            color: #1E5631;
            background: rgba(111, 66, 193, 0.05);
        }

        .bottom-nav-item i {
            font-size: 1.2rem;
        }

        /* Mobile Styles */
        @media (max-width: 768px) {
            .desktop-header {
                display: none;
            }

            .mobile-header {
                display: block;
            }

            .mobile-bottom-nav {
                display: block;
            }

            .main-content {
                margin-top: 70px;
                margin-bottom: 100px;
                padding: 5px;
            }

            .section {
                padding: 10px;
                margin-bottom: 20px;
            }

            .section-title {
                font-size: 1rem;
                margin-bottom: 10px;
            }

            .cards-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 5px;
            }

            .card {
                padding: 10px;
            }

            .card-image {
                height: 120px;
                font-size: 2rem;
            }

            .card-title {
                font-size: 0.8rem;
                -webkit-line-clamp: 2;
                margin-bottom: 2px;
            }

        /* Fix card meta layout for mobile - constrained version */
            .card-meta {
                font-size: 0.6rem;
                flex-direction: row !important;
                align-items: center;
                justify-content: space-between;
                gap: 5px;
                margin-top: 0px;
                padding-top: 5px;
                width: 100%;
                min-width: 0; /* Allow shrinking */
                overflow: hidden; /* Prevent overflow */
            }
            
            .card-author {
                display: flex;
                align-items: center;
                gap: 5px;
                min-width: 0; /* Allow shrinking */
                flex: 1;
                overflow: hidden; /* Prevent overflow */
            }
            
            .card-author span {
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
                max-width: 100px; /* Limit source name width */
            }
            
            .card-date {
                flex-shrink: 0;
                white-space: nowrap;
                font-size: 0.55rem; /* Slightly smaller for mobile */
                max-width: 60px; /* Limit date width */
                overflow: hidden;
                text-overflow: ellipsis;
            }
            
            /* Ensure card maintains proper width */
            .card {
                min-width: 0;
                overflow: hidden;
            }
        }

            .search-popup:target {
                display: flex;
            }

        /* Animations */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .card {
            animation: fadeInUp 0.5s ease forwards;
        }

        .card:nth-child(1) { animation-delay: 0.1s; }
        .card:nth-child(2) { animation-delay: 0.15s; }
        .card:nth-child(3) { animation-delay: 0.2s; }
        .card:nth-child(4) { animation-delay: 0.25s; }
