/* 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 {
    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-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;
}

/* 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 {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background-color: #ffffff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}
.breaking-news-section .container {
    max-width: 100%;
    padding: 0;
}
.breaking-news-inner {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.breaking-title {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 6px 15px;
    border-radius: 0;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.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;
}
.ticker-move {
    display: flex;
    align-items: center;
    animation: seamlessTicker 80s linear infinite;
}
.ticker-move:hover {
    animation-play-state: paused;
}
.ticker-item {
    color: var(--text-color);
    font-size: 16px;
    margin-right: 35px;
    text-decoration: none;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
}
.ticker-item:hover {
    color: var(--primary-color);
}
.square-icon {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 2px;
    display: inline-block;
    margin-right: 10px;
    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) {
    .desktop-main-header {
        display: block;
        padding: 15px 0;
    }

    .desktop-header-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 5px;
        text-align: left;
    }

    .header-toggle-mobile {
        display: block;
        flex-shrink: 0;
        order: 3;
    }

    .header-logo-left {
        margin: 0;
        justify-content: flex-start;
        flex-grow: 1;
        order: 1;
    }
    
    .main-header-logo-img {
        max-width: 200px;
        max-height: 55px;
    }

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

    .header-social-top {
        justify-content: center;
        flex-shrink: 0;
        order: 2;
        gap: 8px;
        margin-right: 10px;
    }

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

    .site-header {
        height: 40px;
    }

    .main-navigation {
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    .main-navigation .menu-btn {
        display: none !important;
    }
    
    .main-navigation .search-btn {
        display: inline-block !important;
        margin-left: 20px;
        margin-right: 15px;
    }
    
    .main-navigation .logo {
        display: none !important;
    }
    
    .main-navigation .header-menu {
        display: flex;
        flex-grow: 1;
        justify-content: flex-start;
        padding-left: 10px;
    }
    
    .main-navigation .header-social {
        display: none !important;
    }
    
    .main-navigation .header-social a {
        font-size: 12px;
        width: 24px;
        height: 24px;
    }
    
    /* Hide Twitter on mobile to save space */
    .main-navigation .header-social a:nth-child(2) {
        display: none;
    }
    
    .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 {
        grid-template-columns: 92% 8% !important;
    }
}
