/* 1. The Main Overlay (The Backdrop) */
.action-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 10000;
    display: none;
    transition: background 0.3s ease;
    pointer-events: none;
}

.action-overlay.active {
    display: block;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.4); /* Dim the background */
}

/* 2. Mobile Bottom Sheet */
.action-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.33, 1, 0.68, 1);
    z-index: 10001;
    max-height: 80vh; /* Limits height to 80% of screen */
    display: flex;
    flex-direction: column;
}

.action-sheet.active {
    transform: translateY(0);
}

.action-list {
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; 
    padding: 8px 0;
}

.action-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #ffffff;
    min-width: 190px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border: 1px solid #e1e8ed;
    z-index: 900; 
    display: none; 
}

.action-dropdown.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.action-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 10px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    color: #1c1c1c;
    text-align: left;
    transition: background 0.2s;
}

.action-item:hover {
    background: #f7f9f9;
}

.action-item.danger {
    color: #f4212e;
}

.action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.sheet-handle {
    width: 40px;
    height: 5px;
    background: #e1e8ed;
    border-radius: 10px;
    margin: 12px auto;
    flex-shrink: 0;
}

.sheet-close-btn {
    width: calc(100% - 32px);
    margin: 8px 16px 16px;
    padding: 14px;
    border-radius: 50px;
    border: 1px solid #cfd9de;
    background: #ffffff;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
}
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .action-sheet {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
.menu-container-desktop {
    position: relative;
    display: inline-flex;
}

.action-dropdown.active {
    display: block;
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}
.action-label { 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

@media (min-width: 769px) {
    .action-overlay.active {
        display: none !important;
    }
}