/* Rest of the existing CSS */
.bottom-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--tg-theme-secondary-bg-color);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-evenly;
    padding: 8px 0;
    z-index: 1000;
    margin: 0;
    box-sizing: border-box;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--tg-theme-hint-color);
    text-decoration: none;
    font-size: 10px;
    padding: 4px;
    flex: 1;
    text-align: center;
    min-width: 0;
    max-width: 80px;
    position: relative;
}

/* Collection button styling */
.menu-item[data-page="collection"] {
    background: #E0E0E0;
    border-radius: 50%;
    width: 62px;
    height: 62px;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 62px;
    margin: -18px auto 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    position: relative;
    z-index: 1001;
    border: 2px solid #BDBDBD;
}

.menu-item[data-page="collection"]:hover {
    transform: translateY(-2px);
    background: #D4D4D4;
    border-color: #9E9E9E;
}

.menu-item[data-page="collection"] i {
    color: #424242;
    font-size: 26px;
    margin: 0;
    padding: 0;
    line-height: 1;
}

.menu-item[data-page="collection"] span {
    color: #424242;
    font-size: 10px;
    margin: 2px 0 0 0;
    padding: 0;
    font-weight: 500;
    line-height: 1;
}

/* Updated dropup menu styles for fullscreen display */
.dropup-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    z-index: 1100; /* Higher than other elements */
    display: none;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background overlay */
}

.dropup-menu.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropup-content {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    width: 90%; /* Takes up most of the screen width */
    max-width: 400px; /* But not too wide on larger screens */
    max-height: 80vh; /* Cap the height */
    overflow-y: auto; /* Allow scrolling if needed */
    padding: 16px 0; /* Add padding at the top and bottom */
    margin: 0 auto; /* Center horizontally */
}

.dropup-menu.active .dropup-content {
    transform: translateY(0);
    opacity: 1;
}

.dropup-item {
    display: flex;
    align-items: center;
    padding: 16px; /* Increased padding */
    color: var(--tg-theme-text-color);
    text-decoration: none;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.dropup-item:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.dropup-item i {
    width: 24px; /* Increased width */
    margin-right: 12px; /* Increased margin */
    font-size: 18px; /* Reduced from 20px */
    text-align: center;
}

.dropup-item span {
    font-size: 14px; /* Reduced from 16px */
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500; /* Make text slightly bolder */
}

/* Make the special support item span two columns at the bottom */
.dropup-item[data-page="support"],
.dropup-item[data-page="channel"] {
    grid-column: span 2;
}

/* Add additional space after the last item */
.dropup-item[data-page="support"] {
    margin-bottom: 16px;
}

/* Close button for the fullscreen menu */
.dropup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tg-theme-text-color);
    font-size: 18px;
    z-index: 1101;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.menu-item span {
    margin-top: 8px;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
    line-height: 1;
    min-height: 12px;
    font-size: 9px;
}

.menu-item i {
    font-size: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-item.active {
    color: var(--tg-theme-button-color);
}

.menu-item[data-page="collection"].active {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border-color: var(--tg-theme-button-color);
}

.menu-item[data-page="collection"].active i,
.menu-item[data-page="collection"].active span {
    color: var(--tg-theme-button-text-color);
}

.balance-badge {
    position: absolute;
    top: -2px;
    right: 8px;
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    min-width: 16px;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

.bottom-spacer {
    height: 120px;
}

/* Responsive adjustments */
@media screen and (max-width: 320px) {
    .menu-item {
        padding: 8px 2px;
        font-size: 9px;
    }
    
    .menu-item i {
        font-size: 20px;
        min-height: 20px;
    }
    
    .menu-item span {
        font-size: 8px;
    }

    .menu-item[data-page="collection"] {
        width: 52px;
        height: 52px;
        max-width: 52px;
        margin-top: -14px;
    }

    .menu-item[data-page="collection"] i {
        font-size: 22px;
    }
    
    .dropup-content {
        width: 100%;
        border-radius: 12px 12px 0 0; /* Only round the top corners on very small screens */
        max-height: 85vh;
    }
    
    .dropup-item {
        padding: 12px 10px;
    }
    
    .dropup-item i {
        width: 22px;
        font-size: 16px; /* Reduced from 18px */
    }
    
    .dropup-item span {
        font-size: 12px; /* Reduced from 14px */
    }

    .balance-badge {
        right: 4px;
        padding: 1px 4px;
    }
}

/* Offers badge container styles */
.offers-badge-container {
    margin-left: auto;
    margin-right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-width: 24px;
}

/* Update the balance badge styles for improved visibility */
.offers-badge-container .balance-badge {
    position: static !important;
    transform: none !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    height: 22px; /* Larger badge */
    min-width: 22px;
    padding: 2px 6px;
    font-size: 14px; /* Larger text */
}

.floating-balance {
    position: fixed;
    bottom: 90px;  /* Increased space above the bottom menu */
    right: 16px;   /* Changed from left to right */
    z-index: 1000;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: block;
}

.floating-balance:hover {
    transform: translateY(-2px);
}

.floating-balance .balance-badge {
    position: static;
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    min-width: 20px;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.2s ease-in-out;
    opacity: 0.5;  /* Added 50% transparency */
}

/* Animation for menu appearance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropup-menu.active .dropup-content {
    animation: fadeInUp 0.3s ease forwards;
}