/*=============== GOOGLE FONTS ===============*/
@import url("https://fonts.googleapis.com/css2?family=Montserrat+Alternates:wght@400;600;700&display=swap");

/*=============== VARIABLES CSS ===============*/
:root {
    /*========== Colors - Using theme system ==========*/
    --bottom-nav-background: var(--neutral-500, #212121);
    --bottom-nav-surface: var(--light-surface, #FFFFFF);
    --bottom-nav-primary: var(--brand-primary, #CD853F);
    --bottom-nav-secondary: var(--brand-secondary, #A0522D);
    --bottom-nav-text: var(--light-text-secondary, #757575);
    --bottom-nav-text-active: var(--light-surface, #FFFFFF);
    --bottom-nav-shadow: 0 4px 16px rgba(139, 69, 19, 0.25);

    /*========== Font and typography ==========*/
    --bottom-nav-font: 'aile-sade', 'Ramabhadra', sans-serif;
    --bottom-nav-icon-size: 1.5rem;
    --bottom-nav-tiny-font: 0.625rem;

    /*========== z index ==========*/
    --z-bottom-nav: 1050;
    --z-bottom-nav-expand: 1060;
}

/*=============== BOTTOM NAVIGATION ===============*/
.bottom-nav {
    position: fixed !important;
    bottom: 0rem;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--bottom-nav-background), rgba(33, 33, 33, 0.95)) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 100%;
    margin-inline: auto;
    box-shadow: var(--bottom-nav-shadow);
    padding: 1rem 1.75rem;
    z-index: var(--z-bottom-nav) !important;
    transition: all 0.3s ease;
}

.bottom-nav:hover {
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.35);
}

.bottom-nav__list {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    font-family: var(--bottom-nav-font);
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.bottom-nav__item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative; /* Add this for proper expand list positioning */
}

.bottom-nav__link {
    color: var(--bottom-nav-text) !important;
    font-size: var(--bottom-nav-icon-size);
    transition: all 0.4s ease;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-decoration: none !important;
}

.bottom-nav__link::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    background: var(--brand-gradient, linear-gradient(135deg, var(--bottom-nav-primary), var(--bottom-nav-secondary)));
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: -1;
}

.bottom-nav__link:hover {
    color: var(--bottom-nav-text-active) !important;
    transform: translateY(-3px);
}

.bottom-nav__link:hover::before {
    width: 40px;
    height: 40px;
}

/*=============== EXPAND BUTTON ===============*/
.bottom-nav__expand {
    border: none !important;
    outline: none;
    width: 45px;
    height: 45px;
    background: var(--brand-gradient, linear-gradient(135deg, var(--bottom-nav-primary), var(--bottom-nav-secondary))) !important;
    border-radius: 50% !important;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(205, 133, 63, 0.4);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.bottom-nav__expand::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bottom-nav-secondary), var(--bottom-nav-primary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bottom-nav__expand:hover::before {
    opacity: 1;
}

.bottom-nav__expand:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 16px rgba(205, 133, 63, 0.5);
}

.bottom-nav__expand-icon {
    display: inline-block;
    color: var(--bottom-nav-text-active) !important;
    font-size: var(--bottom-nav-icon-size);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    z-index: 1;
}

/*=============== EXPAND LIST ===============*/
.bottom-nav__expand-list {
    position: absolute;
    bottom: 5rem;
    right: 0; /* Changed from left: 50% to right: 0 */
    transform: translateY(-2rem) scale(0.8); /* Removed translateX */
    background: linear-gradient(135deg, var(--bottom-nav-background), rgba(33, 33, 33, 0.95)) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--bottom-nav-shadow);
    border: 1px solid rgba(205, 133, 63, 0.2) !important;
    width: max-content;
    padding: 1rem 1.5rem;
    border-radius: 2rem !important;
    display: flex;
    column-gap: 2rem;
    z-index: var(--z-bottom-nav-expand) !important; /* Changed from -1 to proper z-index */
    overflow: hidden;
    opacity: 0;
    visibility: hidden; /* Add visibility control */
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    list-style: none !important;
    pointer-events: none; /* Disable pointer events when hidden */
}

/* Show list */
.bottom-nav__expand-list.show-list {
    transform: translateY(0) scale(1) !important;
    opacity: 1 !important;
    visibility: visible !important; /* Make visible when shown */
    pointer-events: auto !important; /* Enable pointer events when shown */
}

.bottom-nav__expand-list.show-list li {
    transform: translateY(0) !important;
    opacity: 1 !important;
}

.bottom-nav__expand-list li {
    transform: translateY(-2rem);
    opacity: 0;
    transition: all 0.4s ease;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.bottom-nav__expand-list li:nth-child(1) {
    transition-delay: 0.1s;
}

.bottom-nav__expand-list li:nth-child(2) {
    transition-delay: 0.2s;
}

.bottom-nav__expand-list li:nth-child(3) {
    transition-delay: 0.3s;
}

.bottom-nav__expand-link {
    color: var(--bottom-nav-text) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: 1rem !important;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none !important;
}

.bottom-nav__expand-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--brand-gradient, linear-gradient(135deg, var(--bottom-nav-primary), var(--bottom-nav-secondary)));
    opacity: 0;
    border-radius: 1rem;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.bottom-nav__expand-link i {
    font-size: var(--bottom-nav-icon-size);
    position: relative;
    z-index: 1;
}

.bottom-nav__expand-link span {
    font-size: var(--bottom-nav-tiny-font);
    font-weight: 600;
    font-family: var(--bottom-nav-font);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.bottom-nav__expand-link:hover {
    color: var(--bottom-nav-text-active) !important;
    transform: translateY(-2px);
}

.bottom-nav__expand-link:hover::before {
    opacity: 1;
}

/* Rotate icon */
.bottom-nav__expand-icon.rotate-icon {
    transform: rotate(135deg);
}

/* Active link */
.bottom-nav__link.active-link {
    color: var(--bottom-nav-text-active) !important;
    background: var(--brand-gradient, linear-gradient(135deg, var(--bottom-nav-primary), var(--bottom-nav-secondary))) !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 12px rgba(205, 133, 63, 0.4);
}

.bottom-nav__link.active-link::before {
    width: 40px;
    height: 40px;
}

/*=============== THEME ADAPTATIONS ===============*/
/* Dark theme */
body.theme-dark .bottom-nav {
    background: linear-gradient(135deg, var(--dark-surface, #2D2016), rgba(26, 19, 16, 0.95)) !important;
    border: 1px solid rgba(28, 28, 28, 0.3) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.theme-dark .bottom-nav__expand-list {
    background: linear-gradient(135deg, var(--dark-surface, #2D2016), rgba(26, 19, 16, 0.95)) !important;
    border: 1px solid rgba(28, 28, 28, 0.3) !important;
}

/* Rose theme */
body.theme-rose .bottom-nav {
    --bottom-nav-primary: var(--brand-primary, #E91E63);
    --bottom-nav-secondary: var(--brand-secondary, #AD1457);
    --bottom-nav-shadow: 0 4px 16px rgba(233, 30, 99, 0.25);
}

body.theme-rose .bottom-nav__expand {
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
}

body.theme-rose .bottom-nav__expand:hover {
    box-shadow: 0 6px 16px rgba(233, 30, 99, 0.5);
}

body.theme-rose .bottom-nav__link.active-link {
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
}

/* Mint theme */
body.theme-mint .bottom-nav {
    --bottom-nav-primary: var(--brand-primary, #3EB489);
    --bottom-nav-secondary: var(--brand-secondary, #2C8C6B);
    --bottom-nav-shadow: 0 4px 16px rgba(62, 180, 137, 0.25);
}

body.theme-mint .bottom-nav__expand {
    box-shadow: 0 4px 12px rgba(62, 180, 137, 0.4);
}

body.theme-mint .bottom-nav__expand:hover {
    box-shadow: 0 6px 16px rgba(62, 180, 137, 0.5);
}

body.theme-mint .bottom-nav__link.active-link {
    box-shadow: 0 4px 12px rgba(62, 180, 137, 0.4);
}

/*=============== BREAKPOINTS ===============*/
/* For medium devices */
@media screen and (min-width: 450px) {
    .bottom-nav {
        width: 100%
    }
}

/* For large devices */
@media screen and (min-width: 1150px) {
    .bottom-nav {
        max-width: 450px;
    }
}

/* For mobile devices */
@media screen and (max-width: 480px) {
    .bottom-nav {
        width: 100%;
        padding: 0.8rem 1.25rem;
    }

    .bottom-nav__link {
        font-size: 1.25rem;
        padding: 0.375rem;
    }

    .bottom-nav__expand {
        width: 40px;
        height: 40px;
    }

    .bottom-nav__expand-icon {
        font-size: 1.25rem;
    }

    .bottom-nav__expand-list {
        padding: 0.75rem 1rem;
        column-gap: 1.5rem;
        right: -0.5rem; /* Adjust positioning for mobile */
    }

    .bottom-nav__expand-link i {
        font-size: 1.25rem;
    }

    .bottom-nav__expand-link span {
        font-size: 0.5rem;
    }
}