/* Bottom Navigation Bar for Mobile Devices
------------------------------- */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    background-color: #fff;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    height: 60px;
    transition: all 0.3s ease;
    display: none; /* Hidden by default, shown only on mobile */
}

.mobile-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.mobile-bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 8px 0;
}

.mobile-bottom-nav-link:hover,
.mobile-bottom-nav-link:active,
.mobile-bottom-nav-link.active {
    color: var(--main-color);
}

.mobile-bottom-nav-icon {
    position: relative;
    height: 24px;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-bottom-nav-text {
    font-size: 11px;
    margin-top: 2px;
    font-weight: 500;
}

.mobile-bottom-nav-link .notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #f44336;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
}

/* Mobile Profile Menu
------------------------------- */
.mobile-profile-menu {
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
    display: none !important; /* Always hidden by default and important to override .show */
}

.mobile-profile-menu.show {
    display: block !important;
    transform: translateY(0);
}

.mobile-profile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #eee;
    
}

.profile-info {
    display: flex;
    align-items: center;
}

.profile-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.close-profile-menu {
    background: none;
    border: none;
    color: #666;
    padding: 5px;
}

.mobile-profile-menu-items {
    padding: 10px 0;
}

.mobile-profile-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
}

.mobile-profile-menu-item:last-child {
    border-bottom: none;
}

.mobile-profile-menu-item .icon {
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.btn-logout-menu {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 0;
    color: #333;
}

.mobile-profile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none !important; /* Always hidden by default and important to override .show */
}

.mobile-profile-menu-overlay.show {
    display: block !important;
}

/* Mobile Search Panel
------------------------------- */
.mobile-search-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 999;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    display: none; /* Always hidden by default, shown only on mobile via media query */
}

.mobile-search-panel.show {
    transform: translateY(0);
}

.mobile-search-panel-header {
    display: flex;
    align-items: center;
    padding: 15px;
}

.mobile-search-form {
    display: flex;
    flex: 1;
}

.mobile-search-form input {
    flex: 1;
    border-radius: 4px 0 0 4px;
    border: 1px solid #ddd;
    padding: 10px 15px;
    height: auto;
}

.mobile-search-form button {
    border-radius: 0 4px 4px 0;
    background-color: var(--main-color);
    color: #fff;
    border: none;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-search-panel {
    background: none;
    border: none;
    color: #666;
    padding: 5px;
    margin-left: 10px;
}

/* Adjust WhatsApp button when bottom nav is present */
@media (max-width: 1024px) {
    .whatsapp-button {
        bottom: 70px;
    }
    
    html[dir="rtl"] .whatsapp-button {
        left: auto;
        right: 20px;
        bottom: 70px;
    }
    
    .scrollup {
        bottom: 70px;
    }
    
    body {
        padding-bottom: 60px;
    }
    
    .mobile-bottom-nav {
        display: flex;
    }
}

/* Hide mobile menu on desktop completely */
@media (min-width: 1025px) {
    .mobile-profile-menu,
    .mobile-profile-menu.show,
    .mobile-profile-menu-overlay,
    .mobile-profile-menu-overlay.show,
    .mobile-search-panel,
    .mobile-profile-menu-header,
    .mobile-profile-menu-items,
    .mobile-profile-menu-item,
    .mobile-search-panel.show {
        display: none !important;
    }
}

/* RTL Support */
html[dir="rtl"] .profile-info img {
    margin-right: 0;
    margin-left: 10px;
}

html[dir="rtl"] .mobile-profile-menu-item .icon {
    margin-right: 0;
    margin-left: 15px;
}

html[dir="rtl"] .close-search-panel {
    margin-left: 0;
    margin-right: 10px;
}
