/* Desktop Main Header */
.desktop-main-header {
    background-color: #ffffff;
    padding: 15px 0;
}

.desktop-header-inner {
    display: flex;
    align-items: center;
    gap: 30px;
}

.header-date-time {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 13px;
    color: var(--text-color, #333);
    line-height: 1.5;
}
.header-date-time .eng-date {
    font-weight: 600;
    color: var(--primary-color);
}
.header-date-time .bn-hijri-date {
    font-size: 12px;
    color: #666;
}

.header-logo-left {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-right: auto;
}

.header-logo-left a {
    text-decoration: none;
    display: inline-block;
}

.header-social-top {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.header-social-top a {
    color: #ffffff;
    background-color: var(--primary-color);
    font-size: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.header-social-top a:hover {
    background-color: #333;
    transform: translateY(-2px);
}

.main-header-logo-img {
    max-width: 300px;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    display: block;
}

.site-title-text {
    margin: 0;
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
}


/* Sticky Header Wrapper */
.sticky-header-wrapper {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

/* Header */
.site-header {
    position: relative;
    z-index: 900;
    background-color: var(--primary-color);
    height: 45px;
}

.site-header .container {
    height: 100%;
}

.main-navigation {
    display: grid;
    grid-template-columns: 20% 60% 12% 8%;
    align-items: center;
    height: 100%;
}

.main-navigation .logo {
    padding-right: 20px; /* Add gap between logo and menu */
}

.main-navigation .logo a {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    height: 100%;
}

.header-logo-img {
    max-height: 30px; /* Constrained to 30px as requested */
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.main-navigation .header-menu {
    display: flex;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
}

.main-navigation .header-menu::-webkit-scrollbar {
    display: none;
}

.main-navigation ul {
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.main-navigation ul li {
    position: relative;
    list-style: none;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.main-navigation ul li a {
    color: #ffffff;
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.main-navigation ul li a:hover {
    opacity: 0.8;
}

/* Flattened Sub-menu for Primary Menu (if not in mega menu) */
.main-navigation ul .sub-menu {
    position: static;
    display: flex;
    gap: 30px;
    margin-left: 30px;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    padding: 0;
    border: none;
}

.main-navigation ul .sub-menu li {
    width: auto;
}

.main-navigation ul .sub-menu li a {
    color: #ffffff;
    font-size: 18px;
    padding: 0;
}

.main-navigation ul .sub-menu li a:hover {
    background: transparent;
    color: #ffffff;
    opacity: 0.8;
}

.header-social {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.header-social a {
    color: var(--primary-color);
    background-color: #ffffff;
    font-size: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.header-social a:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    color: var(--primary-color);
}

.header-epaper {
    display: flex;
    align-items: center;
}

.epaper-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    background-color: #ffffff;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.epaper-btn:hover {
    background-color: #f0f0f0;
    color: var(--primary-color);
    transform: translateY(-1px);
}

.header-toggle {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: flex-end;
}

.action-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.3s ease;
}

.action-btn:hover {
    opacity: 0.8;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    text-decoration: none;
    line-height: 1;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.lang-btn:hover {
    background-color: #ffffff;
    color: var(--primary-color);
    opacity: 1;
}

/* Header Search Form */
.header-search-wrapper {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #f8f9fa;
    padding: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 99;
    border-top: 1px solid #ddd;
}
.header-search-wrapper.active {
    display: block;
}
.header-search-wrapper .search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}
.header-search-wrapper .search-field {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
    outline: none;
    font-family: 'Kalpurush', sans-serif;
}
.header-search-wrapper .search-submit {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 16px;
    transition: opacity 0.3s ease;
    font-family: 'Kalpurush', sans-serif;
}
.header-search-wrapper .search-submit:hover {
    opacity: 0.9;
}

/* Breaking News */
.breaking-news-section {
    background-color: transparent;
    margin-bottom: 15px;
    padding: 10px 0 0 0;
}
.breaking-news-section .container {
    /* Uses default container width */
}
.breaking-news-inner {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}
.breaking-title {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 8px 20px;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.pulse-icon {
    width: 8px;
    height: 8px;
    background-color: #ffffff;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
.breaking-ticker {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    white-space: nowrap;
    padding-left: 15px;
}
.ticker-move {
    display: flex;
    align-items: center;
    animation: seamlessTicker 40s linear infinite; /* Sped up a little */
}
.ticker-move:hover {
    animation-play-state: paused;
}
.ticker-item {
    color: #1f2937;
    font-size: 16px;
    font-weight: 500;
    margin-right: 40px;
    text-decoration: none;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
}
.ticker-item:hover {
    color: var(--primary-color);
}
.square-icon {
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
    border-radius: 50%; /* Make it dot instead of square */
    display: inline-block;
    margin-right: 8px;
    flex-shrink: 0;
}

@keyframes seamlessTicker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Header Gap */
.header-gap {
    height: 25px;
}

/* Trending Tags */
.trending-tags-section {
    margin-bottom: 0; /* Reduced bottom gap */
}
.trending-tags-inner {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: transparent;
    border: none;
    padding: 5px 0; /* Added vertical padding to prevent hover cutoff */
    box-shadow: none;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}
.trending-tags-inner::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}
.trending-label {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    border-right: 2px solid #eaedf1;
    padding-right: 15px;
    padding-left: 4px;
    flex-shrink: 0;
}
.trending-tags-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
}
.trending-tags-list .tag-item {
    background-color: #f1f5f9;
    color: var(--text-color);
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    flex-shrink: 0;
    white-space: nowrap;
}
.trending-tags-list .tag-item:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.trending-tags-list .no-tags {
    color: var(--light-text);
    font-size: 14px;
}

/* Mobile Toggle Icon in Main Header (Hidden on PC) */
.header-toggle-mobile {
    display: none;
}
.header-toggle-mobile .action-btn {
    color: var(--primary-color);
    font-size: 20px;
}

/* Header Responsive */
@media (max-width: 768px) {
    .sticky-header-wrapper {
        position: static;
        box-shadow: none;
        padding-top: 80px;
    }

    .desktop-main-header {
        display: flex;
        align-items: center;
        padding: 5px 0;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 80px;
        z-index: 1000;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
        background-color: #ffffff;
    }

    .desktop-header-inner {
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 5px;
        text-align: center;
    }

    .site-header {
        position: relative;
        z-index: 900;
        height: 44px;
        background-color: var(--primary-color) !important;
        border-bottom: none;
    }

    .action-btn {
        color: #ffffff;
    }

    .header-toggle-mobile {
        display: none !important;
    }

    .header-logo-left {
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        padding: 0 10px;
    }
    
    .main-header-logo-img {
        width: 100%;
        max-width: 100%;
        max-height: 70px;
        object-fit: contain;
    }

    .header-date-time {
        display: none;
    }

    .header-social-top {
        display: none !important;
    }

    .header-social-top a {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }

    .main-navigation {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        height: 100%;
    }

    .main-navigation .header-social {
        display: flex !important;
        align-items: center;
        gap: 6px;
        margin-right: auto;
        padding-left: 0;
    }

    .main-navigation .header-social a {
        font-size: 13px;
        width: 28px;
        height: 28px;
        background-color: rgba(255, 255, 255, 0.2);
        color: #ffffff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        transition: all 0.2s ease;
    }

    .main-navigation .header-social a:hover {
        background-color: rgba(255, 255, 255, 0.35);
        color: #ffffff;
    }

    .header-epaper {
        display: flex;
        align-items: center;
        margin: 0 6px;
    }

    .header-epaper .epaper-btn {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 4px 10px;
        font-size: 13px;
        font-weight: 600;
        color: var(--primary-color);
        background-color: #ffffff;
        border-radius: 4px;
        text-decoration: none;
        box-shadow: 0 1px 3px rgba(0,0,0,0.15);
        white-space: nowrap;
    }

    .main-navigation .header-toggle {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .main-navigation .menu-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        background-color: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 6px;
        color: #ffffff;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
        font-size: 16px;
        cursor: pointer;
    }
    
    .main-navigation .search-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        background-color: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 6px;
        color: #ffffff;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
        font-size: 15px;
        margin-left: 0;
        margin-right: 0;
        cursor: pointer;
    }

    .main-navigation .lang-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        background-color: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 6px;
        color: #ffffff;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
        font-size: 12px;
        font-weight: 700;
        text-decoration: none;
        cursor: pointer;
        padding: 0;
        text-transform: uppercase;
        line-height: 1;
    }
    
    .main-navigation .logo {
        display: none !important;
    }
    
    .main-navigation .header-menu {
        display: none !important;
    }
    
    .main-navigation .logo a {
        font-size: 22px;
    }
    
    .header-logo-img {
        max-width: 150px; /* Reduce width on mobile */
        max-height: 25px; /* Slightly smaller height on mobile */
    }
    
    .header-search-wrapper {
        padding: 15px 0;
    }
    
    .header-search-wrapper .search-field {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .header-search-wrapper .search-submit {
        padding: 8px 15px;
        font-size: 14px;
    }

    .breaking-news-section .container {
        padding-left: 0;
        padding-right: 0;
    }
    .breaking-news-section {
        padding: 0;
    }
    .breaking-title {
        font-size: 14px;
        padding: 4px 10px;
        border-radius: 0;
    }
    .ticker-item {
        font-size: 15px;
        margin-right: 25px;
    }

    .header-gap {
        height: 15px;
    }
    
    .trending-tags-inner {
        padding: 0;
    }
    
    .trending-label {
        font-size: 15px;
        padding-right: 10px;
    }
}

/* Hide nav logo and social on PC and adjust grid */
@media (min-width: 769px) {
    .main-navigation .logo,
    .main-navigation .header-social {
        display: none !important;
    }
    .main-navigation {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }
    .main-navigation .header-menu {
        flex: 1;
    }
    .header-epaper {
        margin-right: 15px;
        margin-left: 15px;
    }
}
