/**
 * MatkaResultt - Unified Header Styles
 * Extracted from category/main-market.php
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@700;800&display=swap');

/* --- HEADER CONTAINER --- */
.headm-header {
    position: sticky;
    top: 0;
    border-radius: 0 0 10px 10px;
    background: linear-gradient(to bottom, #ff007f 0%, #ff3399 100%);
    backdrop-filter: blur(15px);
    border-bottom: 2px solid #4b0082;
    z-index: 9999 !important;
    display: flex;
    align-items: center;
}

.headm-container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 16px 12px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.headm-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.headm-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
}

.headm-center {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    min-width: 0;
    padding: 0 4px;
}

.headm-center a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

/* --- BUTTONS --- */
.headm-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid #ffcc99;
    background: #ffcc99;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #0f172a;
    position: relative;
}

.headm-menu-trigger::after {
    content: '';
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 100%;
    height: 100%;
    background: #e2e8f0;
    border-radius: 12px;
    z-index: -1;
    opacity: 0.6;
}

.headm-refresh-btn {
    position: fixed !important;
    right: 20px !important;
    bottom: 85px !important;
    z-index: 2000 !important;
    border-radius: 50% !important;
    border: 2px solid #4b0082 !important;
    background: #1ea01a !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
}

.headm-refresh-btn:hover {
    background: #ffff00;
    color: #000000;
}

/* --- SEARCH BUTTON --- */
.header-search-btn {
    width: 40px;
    height: 40px;
    background: #ffcc99;
    color: #000000;
    border: 0px solid #4B0082;
    padding: 0;
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    flex: 0 0 auto;
}

.header-search-btn:hover {
    background: #ffddb3;
    border-color: #4B0082;
    transform: translateY(-1px);
}

.header-search-btn.search-open {
    background: #22c55e;
    color: #ffffff;
    border-color: #16a34a;
}

.header-search-btn.search-open:hover {
    background: #16a34a;
    color: #ffffff;
}

/* --- SEARCH WRAPPER & INPUT --- */
#worldSearchWrapper,
#sattaSearchWrapper,
#jackpotSearchWrapper,
#lotterySearchWrapper,
#nplSearchWrapper,
#teerSearchWrapper,
#bombaySearchWrapper,
#lottoSearchWrapper,
.page-search-wrapper {
    position: sticky;
    top: 75px;
    z-index: 1000;
    padding-right: 2px;
    padding-left: 2px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.35s ease;
    opacity: 0;
    pointer-events: none;
    margin: 0 !important;
}

#worldSearchWrapper.active,
#sattaSearchWrapper.active,
#jackpotSearchWrapper.active,
#lotterySearchWrapper.active,
#nplSearchWrapper.active,
#teerSearchWrapper.active,
#bombaySearchWrapper.active,
#lottoSearchWrapper.active,
.page-search-wrapper.active {
    max-height: 140px;
    opacity: 1;
    pointer-events: auto;
    margin: 8px auto 6px auto !important;
}

.search-box {
    position: relative;
    background: #fff;
    border-radius: 10px;
    border: 2px solid #4B0082;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.search-box input {
    width: 100%;
    padding: 12px 45px;
    border: none;
    outline: none;
    font-size: 15px;
    border-radius: 40px;
    box-sizing: border-box;
}

.search-icon-left {
    position: absolute;
    left: 12px;
    top: 10px;
    font-size: 18px;
    color: #888;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 10px;
    font-size: 18px;
    color: #888;
    cursor: pointer;
    display: none;
}

#noResultMsg {
    display: none;
    text-align: center;
    padding-top: 8px;
    color: #ff4d4d;
    font-size: 14px;
}

/* --- BRANDING & LIVE --- */
.headm-brand-text {
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    display: flex;
    gap: 6px;
    line-height: 1.2;
}

.headm-brand-matka {
    color: #ffffff;
}

.headm-brand-result {
    color: #FFCC99;
}

.headm-live-status {
    display: flex;
    align-items: center;
    gap: 5px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.headm-live-dot {
    width: 7px;
    height: 7px;
    background-color: #1ed760;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

.headm-live-text {
    font-size: 10px;
    font-weight: 700;
    color: #f8f8f8;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* --- DROPDOWN MENU --- */
.headm-menu-list {
    position: absolute;
    top: 55px;
    left: 5px;
    width: 260px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid #f1f5f9;
    padding: 8px;
    display: none;
    max-height: 80vh;
    overflow-y: auto;
    text-align: left;
}

.headm-dropdown.headm-active .headm-menu-list {
    display: block;
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.headm-menu-group-label {
    font-size: 9px;
    font-weight: 800;
    color: #cbd5e1;
    padding: 10px 14px 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.headm-menu-item {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    transition: background 0.2s, transform 0.1s ease;
}

.headm-menu-item:hover {
    background: #FFCC99;
    color: #ff007f;
}

/* --- NESTED ACCORDION DROPDOWN IN MENU --- */
.headm-nested-dropdown {
    width: 100%;
}

.headm-nested-trigger {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.headm-nested-caret {
    transition: transform 0.25s ease;
    font-size: 18px;
    color: #64748b;
}

.headm-nested-content {
    display: none;
    padding-left: 12px;
    margin: 2px 0 6px 12px;
    border-left: 2px solid #059669;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    animation: headmSubmenuSlide 0.2s ease;
}

.headm-nested-dropdown.open .headm-nested-content {
    display: block;
}

.headm-nested-dropdown.open .headm-nested-caret {
    transform: rotate(180deg);
}

#headmLotteryNested .headm-nested-content {
    border-left: 2px solid #6366f1;
}

#headmLotteryNested.open>.headm-nested-trigger {
    background: #eef2ff;
    color: #4338ca;
}

#headmLottoNested.open>.headm-nested-trigger {
    background: #ecfdf5;
    color: #047857;
}

#headmToolsNested .headm-nested-content {
    border-left: 2px solid #f59e0b;
}

#headmToolsNested.open>.headm-nested-trigger {
    background: #fffbeb;
    color: #b45309;
}

@keyframes headmSubmenuSlide {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- DESKTOP REFRESH BUTTON POSITION --- */
@media (min-width: 992px) {
    .headm-right {
        display: flex;
        justify-content: flex-end;
    }
}

/* --- ANIMATIONS --- */
.headm-ripple {
    position: absolute;
    background: rgba(30, 215, 96, 0.3);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple-animation 0.5s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.headm-spin-now {
    animation: spin 0.6s linear;
}

/* --- SMART SCROLL BUTTON (Arrow Icon) --- */
.smart-scroll-btn {
    position: fixed !important;
    bottom: 25px !important;
    right: 20px !important;
    width: 48px !important;
    height: 48px !important;
    background-color: #ff0077 !important;
    color: #ffffff !important;
    border: 2px solid #4b0082 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 24px !important;
    cursor: pointer !important;
    z-index: 2000 !important;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
    padding: 0 !important;
}

.smart-scroll-btn:hover {
    transform: scale(1.1);
    background-color: #4b0082 !important;
    color: #ffffff !important;
}

.smart-scroll-btn i {
    transition: transform 0.4s ease;
}

/* --- CONSOLIDATED RESPONSIVE MOBILE STYLES (MATCHES DESKTOP/TABLET BEAUTIFUL PADDING & ZERO OVERLAP) --- */
@media (max-width: 768px) {
    .headm-header {
        border-radius: 0 0 12px 12px !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 9999 !important;
    }

    .headm-container {
        padding: 16px 10px !important;
        gap: 6px !important;
    }

    .headm-left {
        flex: 0 0 auto !important;
        width: auto !important;
        display: flex !important;
        align-items: center !important;
    }

    .headm-icon-btn {
        width: 40px !important;
        height: 40px !important;
        border-radius: 12px !important;
        flex: 0 0 40px !important;
    }

    /* Logo Center: fluid width, auto centering, never clipped by siblings */
    .headm-center {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        padding: 0 6px !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }

    .headm-brand-text {
        font-size: clamp(15px, 4.5vw, 19px) !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        line-height: 1.25 !important;
    }

    .headm-live-status {
        padding: 2px 6px !important;
        font-size: 9px !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        margin-top: 2px !important;
    }

    .headm-live-text {
        font-size: 8.5px !important;
        letter-spacing: 0.8px !important;
    }

    /* Right Controls: grouped, auto-fit, no spillover */
    .headm-right {
        flex: 0 0 auto !important;
        width: auto !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 6px !important;
    }

    .hdr-pwa-btn {
        display: none !important;
    }

    .hdr-dark-toggle {
        width: 40px !important;
        height: 40px !important;
        border-radius: 12px !important;
        font-size: 16px !important;
        border: 0px solid #4B0082 !important;
        box-sizing: border-box !important;
        flex: 0 0 40px !important;
    }

    .hdr-lang-wrap {
        margin: 0 !important;
        flex: 0 0 auto !important;
    }

    .hdr-lang-btn {
        height: 40px !important;
        padding: 0 9px !important;
        border-radius: 12px !important;
        font-size: 13.5px !important;
        border: 0px solid #4B0082 !important;
        box-sizing: border-box !important;
        flex: 0 0 auto !important;
    }

    .header-search-btn {
        width: 40px !important;
        height: 40px !important;
        border-radius: 12px !important;
        font-size: 18px !important;
        border: 0px solid #4B0082 !important;
        box-sizing: border-box !important;
        flex: 0 0 40px !important;
    }

    /* Fixed Floating Buttons on Mobile: Cleanly Separated Stack (Zero Overlap) */
    .smart-scroll-btn {
        bottom: 70px !important;
        right: 12px !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 24px !important;
        border-radius: 50% !important;
    }

    .headm-refresh-btn {
        bottom: 124px !important;
        right: 12px !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 20px !important;
        border-radius: 50% !important;
    }
}

/* Extra Compact Phones (<= 360px) */
@media (max-width: 360px) {
    .headm-container {
        padding: 10px 5px !important;
        gap: 3px !important;
    }

    .headm-brand-text {
        font-size: 14.5px !important;
        gap: 3px !important;
    }

    .headm-live-text {
        font-size: 8px !important;
        letter-spacing: 0.5px !important;
    }

    .headm-icon-btn,
    .hdr-dark-toggle,
    .header-search-btn {
        width: 38px !important;
        height: 38px !important;
        border-radius: 10px !important;
        flex: 0 0 38px !important;
    }

    .hdr-lang-btn {
        height: 38px !important;
        padding: 0 7px !important;
        border-radius: 10px !important;
        font-size: 12.5px !important;
    }

    .headm-right {
        gap: 4px !important;
    }
}

/* --- UNIVERSAL ACTION BUTTONS (PANEL, JODI, ETC.) HOVER & TOUCH FEEDBACK --- */
.btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation;
    user-select: none;
    cursor: pointer;
}

.btn:hover,
.btn:focus,
.btn:active,
.btn.touch-active {
    background: #FF178B !important;
    color: #ffffff !important;
    border-color: #FF178B !important;
    transform: translateY(-1px) scale(1.04) !important;
    box-shadow: 0 4px 12px rgba(255, 23, 139, 0.35) !important;
}