/* Prevent body scrolling when menu is open */
body.no-scroll {
    overflow: hidden;
    height: 100vh; /* Prevent scrolling when the menu is open */
}

/* Popup menu container */
.otherdanji-menu {
    position: fixed;
    bottom: -100%; /* Initially hidden */
    left: 50%;
    transform: translateX(-50%);
    margin: 0px 0px 15px 0px;
    max-width: 600px;
    width: calc(100% - 70px);
    height: 50%;
    background-color: #ffffff;
    border-radius: 15px;
    color: white;
    padding: 20px;
    transition: bottom 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 9999;
    overflow: auto; /* Make the menu scrollable */
}

/* Menu open class to slide up the container and content */
.otherdanji-menu.open {
    bottom: 0; /* When menu is open, slide it to 0 from the bottom */
}

.otherdanji-menu::-webkit-scrollbar {
    display: none; /* Hide the scrollbar */
}

/* Menu container (initially hidden) */
.otherdanji-menu-container {
    opacity: 0; /* Start hidden */
    transform: translateY(100px); /* Start off-screen from the bottom */
    transition: opacity 0.5s ease, transform 0.75s ease; /* Content slides up */
}

/* When the menu is open, make the container visible */
.otherdanji-menu.open .otherdanji-menu-container {
    opacity: 1;
    transform: translateY(0); /* Slide up into view */
}

/* Overlay styling */
.otherdanji-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.15); /* Semi-transparent black */
    display: none; /* Hidden by default */
    z-index: 15; /* Below the menu, above the body */
}

/* Show overlay when the menu is open */
.otherdanji-menu.open + .otherdanji-overlay {
    display: block; /* Show the overlay when the menu is open */
}

/* Each row is a grid of 2x2 */
.otherdanji-menu-row {
    display: grid;
    grid-template-columns: 60% 40%; /* First column is wider */
    grid-template-rows: repeat(2, auto); /* 2 rows */
    gap: 0px 0px; /* Space between items */
    padding: 10px;
}

/* Menu item styling */
.otherdanji-menu-item {
    background-color: inherit;
    color: #000;
    font-size: 14px;
    padding: 0px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
}

/* Align text for the first column (odd items) */
.otherdanji-menu-item:nth-child(odd) {
    text-align: left;
    justify-content: flex-start; /* Move text to the left */
    padding-left: 0px; /* Extra padding for spacing */
}

/* Align text for the second column (even items) */
.otherdanji-menu-item:nth-child(even) {
    text-align: right;
    justify-content: flex-end; /* Move text to the right */
    padding-right: 0px; /* Extra padding for spacing */
}

/* Hover effect */
.otherdanji-menu-row:hover {
    background-color: #fff;
}
