/* Mobile Bottom Navigation */
:root {
    --mobile-nav-offset: 0px;
}

.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #2d2d2d;
    border-top: 1px solid #404040;
    padding: 6px 2px;
    display: none;
    justify-content: space-between;
    align-items: center;
    z-index: 10050;
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.mobile-nav.hidden {
    transform: translateY(100%);
}

/* Keep Bootstrap modal/backdrop above mobile nav layers while a modal is open. */
body.modal-open .mobile-nav,
body.modal-open .mobile-user-dropdown,
body.modal-open .mobile-notifications-overlay,
body.modal-open .mobile-notifications-panel {
    z-index: 1040 !important;
}

body.modal-open .mobile-nav {
    pointer-events: none;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #fff;
    transition: color 0.2s ease;
    padding: 6px 4px;
    min-width: 0;
    flex: 1 1 0;
}

.nav-item[data-mobile-chat-trigger] {
    position: relative;
}

.nav-item:hover {
    color: #fff;
}

.nav-item.active {
    color: #fff;
}

.nav-icon {
    font-size: 18px;
    margin-bottom: 3px;
    display: block;
}

/* Special styling for the center add button */
.nav-item.add-btn {
    background-color: transparent;
    border-radius: 0;
    width: auto;
    height: auto;
    flex: 1 1 0;
    min-width: 0;
    padding: 6px 4px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    color: white;
}

.nav-item.add-btn:hover {
    background-color: transparent;
    color: white;
}

.nav-item.add-btn .nav-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #A81700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    font-size: 16px;
}

.nav-item.add-btn:hover .nav-icon {
    background-color: #c0392b;
}

.nav-text {
    font-size: 9px;
    margin-top: 1px;
    line-height: 1.15;
    text-align: center;
}

.nav-user {
    position: relative;
    margin-bottom: 2px;
}

.nav-create {
    position: relative;
    margin-bottom: 2px;
}

.nav-user-trigger {
    background: none;
    border: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 0;
    width: 100%;
}

.nav-user-trigger:focus {
    outline: none;
    color: #fff;
}

.nav-create-trigger {
    background: none;
    border: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 0;
    width: 100%;
}

.nav-create-trigger:focus {
    outline: none;
    color: #fff;
}

.nav-notifications {
    position: relative;
}

.nav-notifications-trigger {
    background: none;
    border: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 0;
    width: 100%;
    position: relative;
}

.nav-notifications-trigger:focus {
    outline: none;
    color: #fff;
}

.mobile-notification-badge {
    position: absolute;
    top: -2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #a81700;
    color: #fff;
    font-size: 9px;
    line-height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-chat-badge {
    position: absolute;
    top: -2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ffffff;
    color: #a81700;
    font-size: 9px;
    font-weight: 700;
    line-height: 16px;
    display: none;
    align-items: center;
    justify-content: center;
}

.mobile-notifications-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 1990;
}

.mobile-notifications-panel {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    bottom: 74px;
    width: min(92vw, 360px);
    max-height: 70vh;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 2001;
}

.mobile-notifications-panel .notifications-list {
    max-height: 50vh;
}

.nav-notifications.open .mobile-notifications-overlay {
    opacity: 1;
    visibility: visible;
}

.nav-notifications.open .mobile-notifications-panel {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mobile-user-dropdown {
    position: absolute;
    bottom: 60px;
    right: 0;
    background-color: #fff;
    color: #333;
    border: 1px solid rgba(11, 22, 63, 0.08);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: min(92vw, 360px);
    min-width: 260px;
    padding: 8px 0;
    display: none;
    z-index: 10060;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mobile-user-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-user-dropdown li a {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    column-gap: 10px;
    padding: 10px 14px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.mobile-user-dropdown li a i {
    width: 18px;
    text-align: center;
    line-height: 1.2;
    margin-top: 2px;
}

.mobile-user-dropdown .dropdown-item-text {
    white-space: normal;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
    padding: 10px 14px 6px;
}

.mobile-user-dropdown li a:hover {
    background-color: #f5f5f5;
}

.nav-user.open .mobile-user-dropdown {
    display: block;
}

.mobile-create-dropdown {
    right: 50%;
    transform: translateX(50%);
    width: min(90vw, 252px);
    min-width: 208px;
    overflow-x: hidden;
}

.mobile-create-dropdown li a,
.mobile-create-dropdown li a i {
    color: #111111;
}

.mobile-create-dropdown li {
    padding: 0;
}

.mobile-create-dropdown li a {
    border-radius: 0;
    border: 0;
    transition: transform 0.18s ease, color 0.18s ease;
}

.mobile-create-dropdown li a:hover,
.mobile-create-dropdown li a:focus,
.mobile-create-dropdown li a:hover i,
.mobile-create-dropdown li a:focus i {
    color: #111111;
}

.mobile-create-dropdown li a:hover,
.mobile-create-dropdown li a:focus,
.mobile-create-dropdown li a:active {
    transform: translateX(4px);
}

.nav-create.open .mobile-create-dropdown {
    display: block;
}

/* Hide on desktop */
@media (min-width: 769px) {
    .mobile-nav {
        display: none;
    }
}

/* Show only on mobile */
@media (max-width: 768px) {
    .mobile-nav {
        display: flex;
        padding: 1px 2px;
    }

    .mobile-nav .nav-text {
        display: none;
    }

    .mobile-nav .nav-item {
        padding: 5px 2px;
        justify-content: center;
    }

    .mobile-nav .nav-icon {
        margin-bottom: 0;
        font-size: 20px;
    }

    .mobile-nav .nav-notifications,
    .mobile-nav .nav-user,
    .mobile-nav .nav-create {
        margin-bottom: 0;
    }

    .mobile-nav .nav-notifications-trigger,
    .mobile-nav .nav-user-trigger,
    .mobile-nav .nav-create-trigger {
        justify-content: center;
    }

    .mobile-nav .nav-item.add-btn {
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    body.mobile-nav-visible .footer-section .footer-wrapper {
        padding-bottom: calc(20px + var(--mobile-nav-offset));
    }
}

/* Add note for desktop users */
.desktop-note {
    background-color: #333;
    color: #fff;
    padding: 10px;
    text-align: center;
    font-size: 14px;
    border-bottom: 1px solid #555;
}

@media (max-width: 768px) {
    .desktop-note {
        display: none;
    }
}
