/* =========================================
   হেডার ও নেভিগেশন ডিজাইন (Complete)
   ========================================= */

:root {
    --brand-color: #F42790;
    --hover-bg: rgba(255, 255, 255, 0.2);
    --text-white: #ffffff;
}

/* -----------------------------------------
   ১. মেইন হেডার (ডেস্কটপ)
   ----------------------------------------- */
.main-header {
    background: var(--brand-color);
    color: var(--text-white);
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(244, 39, 144, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    z-index: 1000;
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* লোগো */
.logo a {
    text-decoration: none;
    color: var(--text-white);
}

.logo h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

/* ডেস্কটপ মেনু */
.desktop-menu a {
    color: var(--text-white);
    text-decoration: none;
    margin: 0 5px;
    font-weight: 500;
    font-size: 16px;
    transition: 0.3s;
    padding: 8px 15px;
    border-radius: 5px; /* আগের মতো স্কয়ার */
    border: 1px solid transparent;
}

/* মেনু হোভার */
.desktop-menu a:hover, 
.desktop-menu a.active {
    background: var(--hover-bg);
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ডেস্কটপ আইকনস */
.desktop-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.desktop-icons a {
    color: var(--text-white);
    font-size: 18px;
    position: relative;
    text-decoration: none;
}

.active-icon i {
    color: #FFD700;
    transform: scale(1.1);
}

/* ব্যাজ (ডেস্কটপ) */
.badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: white;
    color: var(--brand-color);
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 50%;
    font-weight: bold;
}

/* -----------------------------------------
   ২. লাইভ সার্চ ডিজাইন (ডেস্কটপ)
   ----------------------------------------- */
.search-box-container {
    position: relative;
    margin-right: 10px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* ইনপুট ফিল্ড */
#live_search {
    background: var(--hover-bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    /* ডানে X এবং মাইক আইকনের জন্য জায়গা */
    padding: 8px 65px 8px 15px; 
    border-radius: 5px;
    outline: none;
    font-size: 14px;
    width: 280px;
    transition: 0.3s;
}

#live_search::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#live_search:focus {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* সার্চ আইকন (লুকানো থাকবে যখন ফোকাস বা টাইপ হবে না) */
.search-icon-inside {
    position: absolute;
    right: 40px; /* মাইকের বামে */
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    font-size: 14px;
}

/* ❌ ক্লিয়ার বাটন (X) - ডিজাইন ফিক্স */
.clear-search {
    position: absolute;
    right: 35px; /* মাইকের বাম পাশে */
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 14px;
    z-index: 11;
    padding: 5px;
    background: transparent;
    transition: 0.2s;
    display: none; /* ডিফল্ট হাইড */
}

.clear-search:hover {
    color: #FFD700;
    transform: translateY(-50%) scale(1.1);
}

/* 🎤 ভয়েস সার্চ বাটন */
.voice-search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    border-radius: 50%;
    z-index: 10;
    transition: 0.3s;
}

.voice-search-btn:hover {
    color: #FFD700;
    background: rgba(255, 255, 255, 0.1);
}

/* সার্চ রেজাল্ট ড্রপডাউন */
#search-result-box {
    position: absolute;
    top: 45px;
    left: 0;
    width: 320px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    z-index: 2000;
    display: none;
    overflow: hidden;
    border: 1px solid #eee;
}

/* সার্চ আইটেম */
.search-item {
    display: flex;
    align-items: center;
    padding: 12px;
    text-decoration: none;
    border-bottom: 1px solid #f4f4f4;
    transition: 0.2s;
    background: white;
}

.search-item:hover {
    background: #fff0f6;
}

.search-item img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    margin-right: 12px;
    border: 1px solid #eee;
}

.search-info h4 {
    font-size: 14px;
    margin: 0;
    color: #333;
    font-weight: 600;
}

.search-info span {
    font-size: 13px;
    color: var(--brand-color);
    font-weight: bold;
}

/* No Result Design */
.no-result-box {
    padding: 20px;
    text-align: center;
    color: #888;
}
.no-result-icon { font-size: 30px; margin-bottom: 10px; color: #ddd; }
.suggestion-text { font-size: 12px; font-weight: bold; color: #555; margin-top: 10px; }
.badge-sug { font-size: 9px; background: #eee; padding: 2px 5px; border-radius: 4px; color: #555; display: inline-block; margin-bottom: 2px; }
.suggested-item { background: #fffcf5; border-left: 3px solid #FFD700; }


/* -----------------------------------------
   ৩. মোবাইল সার্চ ওভারলে
   ----------------------------------------- */
.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    z-index: 3000;
    display: none; /* JS দিয়ে শো হবে */
    flex-direction: column;
    padding: 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.mobile-search-header {
    background: white;
    padding: 10px 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
}

.mobile-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

/* মোবাইল ইনপুট */
#mobile_live_search {
    width: 100%;
    padding: 12px 65px 12px 15px; /* ডানে X এবং মাইকের জন্য জায়গা */
    border: none;
    background: transparent;
    font-size: 16px;
    outline: none;
}

/* মোবাইলে X বাটন */
.mobile-clear-search {
    position: absolute;
    right: 40px; /* মাইকের বামে */
    color: #888;
    padding: 5px;
    font-size: 16px;
    display: none;
}

/* 🎤 মোবাইলে ভয়েস বাটন */
.mobile-voice-btn {
    position: absolute;
    right: 0;
    background: transparent;
    border: none;
    color: var(--brand-color);
    font-size: 20px;
    padding: 5px;
}

.close-search {
    font-size: 14px;
    color: #555;
    font-weight: 600;
    cursor: pointer;
    padding: 5px;
}

/* মোবাইলে রেজাল্ট এরিয়া */
#mobile-search-result-box {
    margin-top: 15px;
    max-height: 70vh;
    overflow-y: auto;
}

/* ভয়েস লিসেনিং এনিমেশন */
.listening {
    color: #ff3b3b !important;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.2); }
    100% { transform: translateY(-50%) scale(1); }
}


/* -----------------------------------------
   ৪. মোবাইল বটম নেভিগেশন (Badge & Layout)
   ----------------------------------------- */
@media (max-width: 768px) {
    /* ডেস্কটপ এলিমেন্ট হাইড */
    .search-box-container { display: none; }
    .main-header { height: 60px; }
    .header-content { justify-content: center !important; }
    .desktop-menu, .desktop-icons { display: none !important; }

    /* বটম নেভিগেশন */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: white;
        height: 60px;
        display: flex;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -2px 15px rgba(0,0,0,0.1);
        z-index: 1000;
        border-top-left-radius: 15px;
        border-top-right-radius: 15px;
        padding: 0;
    }

    .nav-item {
        text-decoration: none;
        color: #888;
        font-size: 10px;
        font-weight: 600;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 19%;
        position: relative; /* ব্যাজ পজিশন */
        height: 100%;
    }

    .nav-item i {
        font-size: 20px;
        margin-bottom: 4px;
        position: relative;
    }

    .nav-item.active {
        color: var(--brand-color);
    }

    .nav-item.active i {
        transform: translateY(-2px);
    }

    /* মোবাইল ব্যাজ ডিজাইন (Perfect Circle Fix) */
    .mobile-badge {
        position: absolute;
        top: 3px;
        left: 55%;
        background: var(--brand-color);
        color: white;
        font-size: 10px;
        font-weight: bold;
        width: 18px;  /* গোল করার জন্য ফিক্সড */
        height: 18px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid white;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        z-index: 10;
    }
}